summaryrefslogtreecommitdiffstats
path: root/test/test_test.c
diff options
context:
space:
mode:
authorPauli <paul.dale@oracle.com>2019-04-15 01:53:53 +0200
committerPauli <paul.dale@oracle.com>2019-05-09 12:21:09 +0200
commitc5f7a99645aa1718e226e6d867efcd5cabcbd610 (patch)
tree1c88c93f60a4bc51c9f43e24133ecded33b07040 /test/test_test.c
parentSkip the no derivation functions when in FIPS mode because they are not (diff)
downloadopenssl-c5f7a99645aa1718e226e6d867efcd5cabcbd610.tar.xz
openssl-c5f7a99645aa1718e226e6d867efcd5cabcbd610.zip
Test skip option.
Provide C test cases with the option to skip tests and subtests. Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/8695)
Diffstat (limited to 'test/test_test.c')
-rw-r--r--test/test_test.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/test_test.c b/test/test_test.c
index 3741e17122..ba66a158ad 100644
--- a/test/test_test.c
+++ b/test/test_test.c
@@ -531,6 +531,25 @@ static int test_bn_output(int n)
return 1;
}
+static int test_skip_one(void)
+{
+ return TEST_skip("skip test");
+}
+
+static int test_skip_many(int n)
+{
+ return TEST_skip("skip tests: %d", n);
+}
+
+static int test_skip_null(void)
+{
+ /*
+ * This is not a recommended way of skipping a test, a reason or
+ * description should be included.
+ */
+ return TEST_skip(NULL);
+}
+
int setup_tests(void)
{
ADD_TEST(test_int);
@@ -553,5 +572,8 @@ int setup_tests(void)
ADD_TEST(test_single_eval);
ADD_TEST(test_output);
ADD_ALL_TESTS(test_bn_output, OSSL_NELEM(bn_output_tests));
+ ADD_TEST(test_skip_one);
+ ADD_TEST(test_skip_null);
+ ADD_ALL_TESTS(test_skip_many, 3);
return 1;
}