summaryrefslogtreecommitdiffstats
path: root/test/testutil.h
diff options
context:
space:
mode:
authorMike Bland <mbland@acm.org>2014-06-19 12:27:54 -0400
committerMatt Caswell <matt@openssl.org>2014-07-19 19:24:35 +0100
commit5e3de8e609d1cb16696ac2896984ac4d1969ae26 (patch)
tree3fcde505ab421dd78dcc7cf73e36c1435686e268 /test/testutil.h
parentd31fed73e25391cd71a0de488d88724db78f6f8a (diff)
test/testutil.c test registry functions.
These help standardize the structure of main() and result reporting. Reviewed-by: Tim Hudson <tjh@openssl.org>
Diffstat (limited to 'test/testutil.h')
-rw-r--r--test/testutil.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/testutil.h b/test/testutil.h
index 3e9cb84015..adb092a2f1 100644
--- a/test/testutil.h
+++ b/test/testutil.h
@@ -113,4 +113,12 @@
#define TEST_CASE_NAME __func__
#endif /* __STDC_VERSION__ */
+/* In main(), call ADD_TEST to register each test case function, then call
+ * run_tests() to execute all tests and report the results. The result
+ * returned from run_tests() should be used as the return value for main().
+ */
+#define ADD_TEST(test_function) add_test(#test_function, test_function)
+void add_test(const char* test_case_name, int (*test_fn)());
+int run_tests(const char* test_prog_name);
+
#endif /* HEADER_TESTUTIL_H */