diff --git a/test.h b/test.h index 6601e7b..c8cc564 100644 --- a/test.h +++ b/test.h @@ -36,7 +36,7 @@ static test_func_t test_functions[MAX_TEST_FUNCS]; return (failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; \ } -#define TEST(NAME, BLOCK) \ +#define TEST(NAME, ...) \ static int test_##NAME(); \ __attribute__((constructor)) static void register_test_##NAME() { \ if (total < MAX_TEST_FUNCS) { \ @@ -50,7 +50,7 @@ static test_func_t test_functions[MAX_TEST_FUNCS]; printf("\ntest_" #NAME "\n"); \ int total_assert = 0; \ int total_success = 0; \ - BLOCK \ + __VA_ARGS__ \ printf("\t(%d/%d) passed (%d) failed\n", total_success, total_assert, total_assert - total_success); \ return (total_assert == total_success); \ }