diff options
author | Richard Levitte <levitte@openssl.org> | 2017-04-25 21:13:26 +0200 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2017-04-25 21:13:26 +0200 |
commit | 7531b3a6cd4b42bece94c0aab5b963fe03d1b139 (patch) | |
tree | 6e6f54fb7308d6f74feeb25096af118657a6d48f /test/testutil/driver.c | |
parent | 4114f8f0b686958aeb678feea37e058d0c9f3d72 (diff) |
Tapify libtestutil a bit better
This includes better signals of skips and subtests according to TAP 12,
and flushing stdout and stderr at the end of every test function to
make sure we get the output in good order.
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3309)
Diffstat (limited to 'test/testutil/driver.c')
-rw-r--r-- | test/testutil/driver.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/test/testutil/driver.c b/test/testutil/driver.c index 4f6b5119c3..29c97a9912 100644 --- a/test/testutil/driver.c +++ b/test/testutil/driver.c @@ -138,13 +138,23 @@ int run_tests(const char *test_prog_name) char *verdict = NULL; int i, j; - helper_printf_stdout("%*s%d..%d\n", level, "", 1, num_tests); + if (num_tests < 1) + helper_printf_stdout("%*s1..0 # Skipped: %s\n", level, "", + test_prog_name); + else if (level > 0) + helper_printf_stdout("%*s1..%d # Subtest: %s\n", level, "", num_tests, + test_prog_name); + else + helper_printf_stdout("%*s1..%d\n", level, "", num_tests); test_flush_stdout(); for (i = 0; i != num_tests; ++i) { if (all_tests[i].num == -1) { int ret = all_tests[i].test_fn(); + test_flush_stdout(); + test_flush_stderr(); + verdict = "ok"; if (!ret) { verdict = "not ok"; @@ -169,6 +179,9 @@ int run_tests(const char *test_prog_name) for (j = 0; j < all_tests[i].num; j++) { int ret = all_tests[i].param_test_fn(j); + test_flush_stdout(); + test_flush_stderr(); + if (!ret) ++num_failed_inner; |