diff options
author | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2019-01-03 09:51:34 +0100 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2019-01-04 17:12:43 +0100 |
commit | 81f8d97b3486928048bb8ad701b4af62ddce9901 (patch) | |
tree | 2b072a5b2e41ed38fbd052b73a07f1c7c54f21b8 /tests/utils.h | |
parent | b978a25de5ef06754bf94bdfb2e6442b7fb6f1fa (diff) | |
download | gnutls-81f8d97b3486928048bb8ad701b4af62ddce9901.tar.gz |
tests: treat all signals as errortmp-tests-fail-on-signals
Previously we were only treating SIGSEGV as error though there is
no reason to treat other signals as success and they may hide an
actual error case (e.g., when SIGPIPE is received). With this change we
treat any signals received by the child except SIGTERM as error, and
we ensure that SIGPIPE is ignored in all tests.
This also updates tests/slow/cipher-api-test.c to test failures with
SIGABRT or otherwise consistently.
Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
Diffstat (limited to 'tests/utils.h')
-rw-r--r-- | tests/utils.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/utils.h b/tests/utils.h index b905065c52..e5728374fa 100644 --- a/tests/utils.h +++ b/tests/utils.h @@ -24,6 +24,7 @@ #define UTILS_H #include <stdio.h> +#include <stdlib.h> #include <signal.h> #include <string.h> #include <stdarg.h> @@ -148,7 +149,7 @@ inline static void _check_wait_status(int status, unsigned sigonly) { #if defined WEXITSTATUS && defined WIFSIGNALED if (WEXITSTATUS(status) != 0 || - (WIFSIGNALED(status) && WTERMSIG(status) == SIGSEGV)) { + (WIFSIGNALED(status) && WTERMSIG(status) != SIGTERM)) { if (WIFSIGNALED(status)) { fail("Child died with signal %d\n", WTERMSIG(status)); } else { |