aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/ChangeLog6
-rw-r--r--tests/run-sign.c16
-rw-r--r--tests/run-support.h2
3 files changed, 20 insertions, 4 deletions
diff --git a/tests/ChangeLog b/tests/ChangeLog
index 294f7d84..5d929a93 100644
--- a/tests/ChangeLog
+++ b/tests/ChangeLog
@@ -1,3 +1,9 @@
+2009-11-03 Werner Koch <[email protected]>
+
+ * run-support.h (fail_if_err): Include program name.
+
+ * run-sign.c (main): Add option --uiserver.
+
2009-10-26 Marcus Brinkmann <[email protected]>
* opassuan/t-command.c: Update to new interface.
diff --git a/tests/run-sign.c b/tests/run-sign.c
index 7c3d51d7..b16b9ef5 100644
--- a/tests/run-sign.c
+++ b/tests/run-sign.c
@@ -69,6 +69,7 @@ show_usage (int ex)
" --verbose run in verbose mode\n"
" --openpgp use the OpenPGP protocol (default)\n"
" --cms use the CMS protocol\n"
+ " --uiserver use the UI server\n"
" --key NAME use key NAME for signing\n"
, stderr);
exit (ex);
@@ -115,6 +116,11 @@ main (int argc, char **argv)
protocol = GPGME_PROTOCOL_CMS;
argc--; argv++;
}
+ else if (!strcmp (*argv, "--uiserver"))
+ {
+ protocol = GPGME_PROTOCOL_UISERVER;
+ argc--; argv++;
+ }
else if (!strcmp (*argv, "--key"))
{
argc--; argv++;
@@ -131,6 +137,12 @@ main (int argc, char **argv)
if (argc != 1)
show_usage (1);
+ if (key_string && protocol == GPGME_PROTOCOL_UISERVER)
+ {
+ fprintf (stderr, PGM ": ignoring --key in UI-server mode\n");
+ key_string = NULL;
+ }
+
init_gpgme (protocol);
err = gpgme_new (&ctx);
@@ -141,12 +153,10 @@ main (int argc, char **argv)
if (key_string)
{
gpgme_key_t akey;
-
+
err = gpgme_get_key (ctx, key_string, &akey, 1);
if (err)
{
- fprintf (stderr, PGM ": error getting key `%s': %s\n",
- key_string, gpg_strerror (err));
exit (1);
}
err = gpgme_signers_add (ctx, akey);
diff --git a/tests/run-support.h b/tests/run-support.h
index 40e2beaf..d7f0923b 100644
--- a/tests/run-support.h
+++ b/tests/run-support.h
@@ -38,7 +38,7 @@
{ \
if (err) \
{ \
- fprintf (stderr, "%s:%d: %s: %s\n", \
+ fprintf (stderr, PGM": file %s line %d: <%s> %s\n", \
__FILE__, __LINE__, gpgme_strsource (err), \
gpgme_strerror (err)); \
exit (1); \