aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test-runner.c
diff options
context:
space:
mode:
authorPekka Paalanen <ppaalanen@gmail.com>2012-04-19 14:26:51 +0300
committerPekka Paalanen <ppaalanen@gmail.com>2012-04-19 14:26:51 +0300
commitbb74adbc4d77bd3f787041ad236b6d5a5014b7ba (patch)
tree2e4e4d5cc224fa69ab4909a25b8a775c400ffc63 /tests/test-runner.c
parenttests: stylish test-runner.c (diff)
downloadwayland-bb74adbc4d77bd3f787041ad236b6d5a5014b7ba.tar
wayland-bb74adbc4d77bd3f787041ad236b6d5a5014b7ba.tar.gz
wayland-bb74adbc4d77bd3f787041ad236b6d5a5014b7ba.tar.bz2
wayland-bb74adbc4d77bd3f787041ad236b6d5a5014b7ba.tar.lz
wayland-bb74adbc4d77bd3f787041ad236b6d5a5014b7ba.tar.xz
wayland-bb74adbc4d77bd3f787041ad236b6d5a5014b7ba.tar.zst
wayland-bb74adbc4d77bd3f787041ad236b6d5a5014b7ba.zip
tests: add support for tests expected to fail
Add a new macro FAIL_TEST that can be used to define tests that are supposed to fail. To distinguish the supposed outcome of a test, add a field to 'struct test'. However, simply adding a field to 'struct test' will make all tests past the first one in an executable to be garbage. Apparently, the variables of type 'struct test' have different alignment when put into a special section than otherwise, and the compiler will get the skip from one 'struct test' to the next wrong. Explicitly specify the alingment of 'struct test' to be 16 bytes, which is what it seems to be in the special section on x86_64. Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Diffstat (limited to 'tests/test-runner.c')
-rw-r--r--tests/test-runner.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/test-runner.c b/tests/test-runner.c
index bb07013..24ae317 100644
--- a/tests/test-runner.c
+++ b/tests/test-runner.c
@@ -124,6 +124,9 @@ int main(int argc, char *argv[])
break;
}
+ if (t->must_fail)
+ success = !success;
+
if (success) {
pass++;
fprintf(stderr, ", pass.\n");