diff options
author | Bjoern Brandenburg <bbb@mpi-sws.org> | 2012-06-25 08:06:08 -0400 |
---|---|---|
committer | Bjoern Brandenburg <bbb@mpi-sws.org> | 2012-07-23 06:02:33 -0400 |
commit | 8afa727c28064c7672f656b889d8049b49370139 (patch) | |
tree | 954b0845e87a9d187dc6e149db654c981e67fa3c /tests | |
parent | 3740f63a46e1a7fa328a157d25f11e3d307cde13 (diff) |
Properly report tests that segfault.
Segmentation faults are clearly test failures;
make sure to report them accordingly.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/runner.c | 7 |
1 files changed, 5 insertions, 2 deletions
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) { | |||
27 | } else { | 27 | } else { |
28 | /* parent: wait for completion of test */ | 28 | /* parent: wait for completion of test */ |
29 | SYSCALL( waitpid(pid, &status, 0) ); | 29 | SYSCALL( waitpid(pid, &status, 0) ); |
30 | if (WEXITSTATUS(status) == 0) | 30 | if (WIFEXITED(status) && WEXITSTATUS(status) == 0) |
31 | printf("ok.\n"); | 31 | printf("ok.\n"); |
32 | else if (WIFSIGNALED(status)) { | ||
33 | printf("failed (%s)!\n", strsignal(WTERMSIG(status))); | ||
34 | } | ||
32 | } | 35 | } |
33 | return WEXITSTATUS(status) == 0; | 36 | return WIFEXITED(status) && WEXITSTATUS(status) == 0; |
34 | } | 37 | } |
35 | 38 | ||
36 | int run_tests(int* testidx, int num_tests, const char* plugin) | 39 | int run_tests(int* testidx, int num_tests, const char* plugin) |