Home GnuPG
Diffusion GnuPG fbf24cd09abc

g10: Improve portability of the new test driver.
fbf24cd09abcUnpublished

Unpublished Commit · Learn More

Not On Permanent Ref: This commit is not an ancestor of any permanent ref.

Description

g10: Improve portability of the new test driver.

* 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>

Details

Provenance
wernerAuthored on Sep 10 2015, 5:43 PM
Parents
rGcafcd4336a0a: po: Auto-update
Branches
Unknown
Tags
Unknown

Event Timeline

Werner Koch <wk@gnupg.org> committed rGfbf24cd09abc: g10: Improve portability of the new test driver. (authored by Werner Koch <wk@gnupg.org>).Sep 10 2015, 5:43 PM