From a06c89e8de9cb681a4dbdb6c66ef923010b97081 Mon Sep 17 00:00:00 2001 From: Tomasz Kramkowski Date: Thu, 10 Sep 2020 22:27:15 +0100 Subject: unpack_test: Additional reporting. --- unpack_test.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'unpack_test.c') 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); + } } -- cgit v1.2.3-54-g00ecf