From 8afa727c28064c7672f656b889d8049b49370139 Mon Sep 17 00:00:00 2001 From: Bjoern Brandenburg Date: Mon, 25 Jun 2012 14:06:08 +0200 Subject: Properly report tests that segfault. Segmentation faults are clearly test failures; make sure to report them accordingly. --- tests/runner.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/runner.c b/tests/runner.c index ccf8d46..11470bc 100644 --- a/tests/runner.c +++ b/tests/runner.c @@ -27,10 +27,13 @@ int run_test(struct testcase *tc) { } else { /* parent: wait for completion of test */ SYSCALL( waitpid(pid, &status, 0) ); - if (WEXITSTATUS(status) == 0) + if (WIFEXITED(status) && WEXITSTATUS(status) == 0) printf("ok.\n"); + else if (WIFSIGNALED(status)) { + printf("failed (%s)!\n", strsignal(WTERMSIG(status))); + } } - return WEXITSTATUS(status) == 0; + return WIFEXITED(status) && WEXITSTATUS(status) == 0; } int run_tests(int* testidx, int num_tests, const char* plugin) -- cgit v1.2.2