aboutsummaryrefslogtreecommitdiff
path: root/test/testutil/tests.c
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2017-04-19 10:34:54 +0200
committerRichard Levitte <levitte@openssl.org>2017-04-25 15:43:04 +0200
commit208d721a004026b128dc66300e32e65a9dc7df1d (patch)
treecd95d9de87063bb4040ce438414d77518467a2f8 /test/testutil/tests.c
parent65d62488b8c808350f440d2276034f5223b391ad (diff)
downloadopenssl-208d721a004026b128dc66300e32e65a9dc7df1d.zip
openssl-208d721a004026b128dc66300e32e65a9dc7df1d.tar.gz
openssl-208d721a004026b128dc66300e32e65a9dc7df1d.tar.bz2
TAPify testutil
With the perl test framework comes the output format TAP (Test Anything Protocol, see http://testanything.org/) with extra extension for subtests. This change extends that same output format to any test program using testutil. In this implementation, each test program is seen as a full test that can be used as a subtest. The perl framework passes on the subtest level to the test programs with the environment variable HARNESS_OSSL_LEVEL. Furthermore, and series of tests added with ADD_ALL_TESTS is regarded as another subtest level. Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3296)
Diffstat (limited to 'test/testutil/tests.c')
-rw-r--r--test/testutil/tests.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/test/testutil/tests.c b/test/testutil/tests.c
index f00ec6c..67b20a5 100644
--- a/test/testutil/tests.c
+++ b/test/testutil/tests.c
@@ -43,6 +43,7 @@
static void test_fail_message(const char *prefix, const char *file, int line,
const char *type, const char *fmt, ...)
PRINTF_FORMAT(5, 6);
+int subtest_level(void);
static void helper_printf_stderr(const char *fmt, ...)
{
@@ -56,6 +57,7 @@ static void helper_printf_stderr(const char *fmt, ...)
static void test_fail_message_va(const char *prefix, const char *file, int line,
const char *type, const char *fmt, va_list ap)
{
+ helper_printf_stderr("%*s# ", subtest_level(), "");
test_puts_stderr(prefix != NULL ? prefix : "ERROR");
test_puts_stderr(":");
if (type)