aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--unpack_test.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/unpack_test.c b/unpack_test.c
index a9e599b..a0eb35e 100644
--- a/unpack_test.c
+++ b/unpack_test.c
@@ -42,6 +42,16 @@ int main(void)
pack_trace = PACK_TRACE_OFF;
- for (struct test *t = &__start_tests; t < &__stop_tests; t++)
- printf("%s %s\n", t->func() ? " OK " : "FAIL", t->desc);
+ for (struct test *t = &__start_tests; t < &__stop_tests; t++) {
+ if (t->func()) {
+ printf(" OK %s\n", t->desc);
+ continue;
+ }
+ pack_trace = PACK_TRACE_ALL;
+ fprintf(stderr, ">>> Test failure trace for '%s'\n", t->desc);
+ t->func();
+ fprintf(stderr, "<<<\n");
+ pack_trace = PACK_TRACE_OFF;
+ printf("FAIL %s\n", t->desc);
+ }
}