diff options
author | Richard Levitte <levitte@openssl.org> | 2017-04-19 10:34:54 +0200 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2017-04-25 15:43:04 +0200 |
commit | 208d721a004026b128dc66300e32e65a9dc7df1d (patch) | |
tree | cd95d9de87063bb4040ce438414d77518467a2f8 /test/testutil.h | |
parent | 65d62488b8c808350f440d2276034f5223b391ad (diff) | |
download | openssl-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.h')
-rw-r--r-- | test/testutil.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/test/testutil.h b/test/testutil.h index 5d96ddd..ecf9934 100644 --- a/test/testutil.h +++ b/test/testutil.h @@ -53,7 +53,12 @@ * Simple parameterized tests. Calls test_function(idx) for each 0 <= idx < num. */ # define ADD_ALL_TESTS(test_function, num) \ - add_all_tests(#test_function, test_function, num) + add_all_tests(#test_function, test_function, num, 1) +/* + * A variant of the same without TAP output. + */ +# define ADD_ALL_TESTS_NOSUBTEST(test_function, num) \ + add_all_tests(#test_function, test_function, num, 0) /*- * Test cases that share common setup should use the helper @@ -131,7 +136,8 @@ void setup_test(void); __owur int finish_test(int ret); void add_test(const char *test_case_name, int (*test_fn) ()); -void add_all_tests(const char *test_case_name, int (*test_fn)(int idx), int num); +void add_all_tests(const char *test_case_name, int (*test_fn)(int idx), int num, + int subtest); __owur int run_tests(const char *test_prog_name); /* @@ -369,3 +375,5 @@ int test_flush_stderr(void); extern BIO *bio_out; extern BIO *bio_err; + +int subtest_level(void); |