diff options
author | Tomasz Kramkowski <tk@the-tk.com> | 2020-09-10 22:27:15 +0100 |
---|---|---|
committer | Tomasz Kramkowski <tk@the-tk.com> | 2020-09-10 22:35:16 +0100 |
commit | a06c89e8de9cb681a4dbdb6c66ef923010b97081 (patch) | |
tree | 1e8495b85a23313eb76522a1140c94f851890a20 | |
parent | a0afb78d648757c98fbd90671133d6f0e65bd162 (diff) | |
download | pack-a06c89e8de9cb681a4dbdb6c66ef923010b97081.tar.gz pack-a06c89e8de9cb681a4dbdb6c66ef923010b97081.tar.xz pack-a06c89e8de9cb681a4dbdb6c66ef923010b97081.zip |
unpack_test: Additional reporting.
-rw-r--r-- | unpack_test.c | 14 |
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); + } } |