From d42a1a35b0c2f2178e459b9328f97f9e988a1cb0 Mon Sep 17 00:00:00 2001 From: Aris Adamantiadis Date: Tue, 2 Sep 2014 09:07:17 +0200 Subject: tests: allow conditionnal execution on pattern Option can be used to filter out irrelevant tests usage: ./torture_pki '*ed25519' Signed-off-by: Aris Adamantiadis Reviewed-by: Andreas Schneider --- tests/torture.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'tests/torture.h') diff --git a/tests/torture.h b/tests/torture.h index e1738ab0..f5897561 100644 --- a/tests/torture.h +++ b/tests/torture.h @@ -42,7 +42,7 @@ /* Used by main to communicate with parse_opt. */ struct argument_s { - char *args[2]; + const char *pattern; int verbose; }; @@ -83,6 +83,9 @@ const char *torture_get_testkey_passphrase(void); void torture_write_file(const char *filename, const char *data); +#define torture_filter_tests(tests) _torture_filter_tests(tests, sizeof(tests) / sizeof(tests)[0]) +void _torture_filter_tests(UnitTest *tests, size_t ntests); + /* * This function must be defined in every unit test file. */ -- cgit