--
Locate every resource and every script used in the tests using a path
relative to the top of the source tree.
This is a purely mechanical change, mostly done using regular
expressions, with a few manual fixups here and there.
Signed-off-by: Justus Winter <justus@g10code.com>
* g10/test.c: Include string.h.
(prepend_srcdir): New. Taken from Libgcrypt.
(test_free): New.
* g10/t-keydb.c (do_test): Malloc the filename.
* g10/Makefile.am (AM_CPPFLAGS): Remove -DSOURCE_DIR
(EXTRA_DIST): Add t-keydb-keyring.kbx.
--
Using SOURCE_DIR should in general work but we have seen problems when
doing this in Libgcrypt. Using the srcdir variable gives us anyway
more flexibility and aligns with the way we do it in tests/openpgp.
Signed-off-by: Werner Koch <wk@gnupg.org>
* g10/test.c: Include stdio.h and stdlib.h.
(verbose): New.
(print_results): Rename to exit_tests.
(main): Remove atexit and call exit_tests. Set verbose.
(ASSERT, ABORT): Call exit_tests instead of exit.
--
Calling exit from an exit handler is undefined behaviour. It works on
Linux but other systems will hit an endless loop. That is indeed
unfortunate but we can't do anything about it. Calling _exit() would
be possible but that may lead to other problems. Thus we change to
call a custom exit function :-(.
Using "make check verbose=1" is supported by tests/openpgp and thus
we add the same mechanism here.
Signed-off-by: Werner Koch <wk@gnupg.org>