summaryrefslogtreecommitdiffstats
path: root/test/testutil.h
diff options
context:
space:
mode:
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 */