From 4847c64536a5c8be22051c93939034b308d1e717 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Sun, 18 Dec 2016 23:15:30 -0800 Subject: test_main in terms of test_main_group and test_group. --- tests/test.h | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) (limited to 'tests') diff --git a/tests/test.h b/tests/test.h index 28e13572..06cd1e29 100644 --- a/tests/test.h +++ b/tests/test.h @@ -120,21 +120,6 @@ extern void test_i_fatal(const char *, int, const char *); test_i_finish(&T_ctx, T_rvp); \ } while (0) -/* - * test_main is used to wrap the top-level of your test suite, and is - * used in lieu of a normal main() function. This is the usual case where - * the executable only contains a single top level test group. - */ -#define test_main(T_name, T_code) \ - int test_main_impl(void) { \ - int T_rv; \ - test_i_run(T_name, T_code, &T_rv); \ - return (T_rv); \ - } \ - int main(int argc, char **argv) { \ - return (test_i_main(argc, argv)); \ - } - /* * If you want multiple top-level tests in your test suite, the test * code should create a test_main_group(), with multiple calls to @@ -162,6 +147,17 @@ extern void test_i_fatal(const char *, int, const char *); }; \ } while (0) +/* + * test_main is used to wrap the top-level of your test suite, and is + * used in lieu of a normal main() function. This is the usual case where + * the executable only contains a single top level test group. + */ +#define test_main(T_name, T_code) \ + test_main_group({ \ + test_group(T_name, T_code); \ + }) + + /* * If you don't want to use the test framework's main routine, but * prefer (or need, because of threading for example) to have your -- cgit v1.2.3-70-g09d2