summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPekka Paalanen <ppaalanen@gmail.com>2012-12-18 17:30:16 +0200
committerKristian Høgsberg <krh@bitplanet.net>2013-01-24 20:22:54 -0500
commita533a85820cc78cc912cbe47b9cd88f26648c4ec (patch)
tree877c7994a81ba0c8cfad8855aaacfac39ffeaea2
parentf03435717c6cf6627cb34eb16b21096b026f944b (diff)
downloadweston-a533a85820cc78cc912cbe47b9cd88f26648c4ec.tar.gz
tests: make signal other than ABRT a hard failure
We handle FAIL_TEST tests by simply inverting the success flag. The problem with this is, that if a FAIL_TEST fails by a SIGSEGV, it will be interpreted as passed. However, no code should ever cause a SEGV, or any other signal than ABRT. And even ABRT only in the case of an assert() that is meant to fail. We would probably need more sophistication for the FAIL_TEST cases. For now, just interpret any other signal than ABRT as a hard failure, regardless whether it is a TEST or FAIL_TEST. At least segfaults do not cause false passes anymore. Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
-rw-r--r--tests/weston-test-runner.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/weston-test-runner.c b/tests/weston-test-runner.c
index e60d4d21..27ea9e42 100644
--- a/tests/weston-test-runner.c
+++ b/tests/weston-test-runner.c
@@ -28,6 +28,7 @@
#include <string.h>
#include <assert.h>
#include <errno.h>
+#include <signal.h>
#include "weston-test-runner.h"
extern const struct weston_test __start_test_section, __stop_test_section;
@@ -71,6 +72,7 @@ int main(int argc, char *argv[])
pass = 0;
for (t = &__start_test_section; t < &__stop_test_section; t++) {
int success = 0;
+ int hardfail = 0;
pid = fork();
assert(pid >= 0);
@@ -93,13 +95,15 @@ int main(int argc, char *argv[])
case CLD_KILLED:
case CLD_DUMPED:
fprintf(stderr, "signal %d", info.si_status);
+ if (info.si_status != SIGABRT)
+ hardfail = 1;
break;
}
if (t->must_fail)
success = !success;
- if (success) {
+ if (success && !hardfail) {
pass++;
fprintf(stderr, ", pass.\n");
} else