diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test.h | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/tests/test.h b/tests/test.h index 28e13572..06cd1e29 100644 --- a/tests/test.h +++ b/tests/test.h @@ -121,21 +121,6 @@ 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) \ - 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 * test_group() in the intervening section. This will cause a new main @@ -163,6 +148,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 * test code driven separately, you can use inject test_block() in |
