diff options
author | Werner Koch <[email protected]> | 2003-01-09 13:15:07 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2003-01-09 13:15:07 +0000 |
commit | 29ef9bd0fbd5b4a9c6a166ce9e335957a7d78091 (patch) | |
tree | 5b3ba5a12adc6adae2b295953aace67b54067b7d /tests | |
parent | Updated from latest NewPG project (diff) | |
download | gnupg-29ef9bd0fbd5b4a9c6a166ce9e335957a7d78091.tar.gz gnupg-29ef9bd0fbd5b4a9c6a166ce9e335957a7d78091.zip |
Updated from latest NewPG project
Diffstat (limited to 'tests')
-rw-r--r-- | tests/ChangeLog | 16 | ||||
-rw-r--r-- | tests/Makefile.am | 44 | ||||
-rw-r--r-- | tests/asschk.c | 15 | ||||
-rwxr-xr-x | tests/inittests | 3 |
4 files changed, 55 insertions, 23 deletions
diff --git a/tests/ChangeLog b/tests/ChangeLog index d9ff7eb8f..c6b3b9af1 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,3 +1,19 @@ +2002-12-04 Werner Koch <[email protected]> + + * inittests (gpgsm.conf): Fake system time. + +2002-10-31 Neal H. Walfield <[email protected]> + + * Makefile.am (inittests.stamp): Do not set LD_LIBRARY_PATH here. + (TESTS_ENVIRONMENT): Do it here. And also frob $(LIBGCRYPT_LIBS) + and $(PTH_LIBS). + +2002-10-31 Neal H. Walfield <[email protected]> + + * asschk.c (die): New macro. + (read_assuan): If in verbose mode, dump the string that was read. + (write_assuan): Be more verbose on failure. + 2002-09-04 Neal H. Walfield <[email protected]> * Makefile.am (inittests.stamp): Do not set LD_LIBRARY_PATH, but diff --git a/tests/Makefile.am b/tests/Makefile.am index b2fa56704..622b5fe58 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -22,7 +22,27 @@ GPGSM = ../sm/gpgsm # We can't unset a variable here so we unset GPG_AGENT_INFO in runtest -TESTS_ENVIRONMENT = GNUPGHOME=`pwd` LC_ALL=C GPGSM=$(GPGSM) $(srcdir)/runtest +TESTS_ENVIRONMENT = GNUPGHOME=`pwd` LC_ALL=C GPGSM=$(GPGSM) \ + LD_LIBRARY_PATH=$$(seen=0; \ + for i in $(LDFLAGS) $(LIBGCRYPT_LIBS) $(PTH_LIBS); \ + do \ + if echo "$$i" | egrep '^-L' >/dev/null 2>&1; \ + then \ + if test $$seen = 0; \ + then \ + seen=1; \ + else \ + printf ":"; \ + fi; \ + printf "%s" "$${i}" | sed 's/^-L//'; \ + fi; \ + done; \ + if test $$seen != 0 \ + && test x$${LD_LIBRARY_PATH} != x; \ + then \ + printf ":"; \ + fi; \ + printf "%s" "$${LD_LIBRARY_PATH}") $(srcdir)/runtest testscripts = sm-sign+verify sm-verify @@ -53,26 +73,6 @@ clean-local: srcdir=$(srcdir) $(TESTS_ENVIRONMENT) $(srcdir)/inittests --clean inittests.stamp: inittests - LD_LIBRARY_PATH=$$(seen=0; \ - for i in $(LDFLAGS); \ - do \ - if echo "$$i" | egrep '^-L' >/dev/null 2>&1; \ - then \ - if test $$seen = 0; \ - then \ - seen=1; \ - else \ - printf ":"; \ - fi; \ - printf "%s" "$${i}" | sed 's/^-L//'; \ - fi; \ - done; \ - if test $$seen != 0 \ - && test x$${LD_LIBRARY_PATH} != x; \ - then \ - printf ":"; \ - fi; \ - printf "%s" "$${LD_LIBRARY_PATH}") \ - srcdir=$(srcdir) $(TESTS_ENVIRONMENT) $(srcdir)/inittests + srcdir=$(srcdir) $(TESTS_ENVIRONMENT) $(srcdir)/inittests echo timestamp >./inittests.stamp diff --git a/tests/asschk.c b/tests/asschk.c index 1a11ead33..83a8ca5af 100644 --- a/tests/asschk.c +++ b/tests/asschk.c @@ -188,6 +188,8 @@ die (const char *format, ...) exit (1); } +#define die(format, args...) (die) ("%s: " format, __FUNCTION__ , ##args) + static void err (const char *format, ...) { @@ -282,6 +284,16 @@ read_assuan (int fd) } else n = read (fd, buf, nleft); + + if (opt_verbose) + { + int i; + printf ("%s: read \"", __FUNCTION__); + for (i = 0; i < n; i ++) + putc (buf[i], stdout); + printf ("\"\n"); + } + if (n < 0) { if (errno == EINTR) @@ -359,7 +371,8 @@ write_assuan (int fd, const char *line) buffer[n++] = '\n'; if (writen (fd, buffer, n)) - die ("sending line to %d failed: %s", fd, strerror (errno)); + die ("sending line (\"%s\") to %d failed: %s", buffer, fd, + strerror (errno)); } diff --git a/tests/inittests b/tests/inittests index b1860f5fd..05a94eb68 100755 --- a/tests/inittests +++ b/tests/inittests @@ -73,10 +73,13 @@ for i in ${private_keys}; do done # Create the configuration scripts +# Note, die to an expired test certificate, we need to use +# the faked system time option. cat > gpgsm.conf <<EOF no-secmem-warning disable-crl-checks agent-program ../agent/gpg-agent +faked-system-time 1038835799 EOF cat > gpg-agent.conf <<EOF |