From 75bbb82058795d7ef72fadc382280730192ccebe Mon Sep 17 00:00:00 2001 From: Abdelrahman Date: Sun, 2 Jun 2024 23:55:41 +0100 Subject: [PATCH] Add helper macro for running test functions --- src/tester/tester.h | 1 + tests/wapptest.c | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/tester/tester.h b/src/tester/tester.h index b48084d..fe1f090 100644 --- a/src/tester/tester.h +++ b/src/tester/tester.h @@ -8,6 +8,7 @@ extern "C" { #endif // __cplusplus #define TEST_RESULT(BOOL) ((TestFuncResult){.name = __func__, .success = BOOL}) +#define RUN_TEST_FUNCS(...) run_tests(__VA_ARGS__, NULL) typedef struct test_func_result TestFuncResult; struct test_func_result { diff --git a/tests/wapptest.c b/tests/wapptest.c index 3b361e5..b04c7d8 100644 --- a/tests/wapptest.c +++ b/tests/wapptest.c @@ -3,9 +3,10 @@ #include int main(void) { - run_tests(test_arena_init, test_arena_alloc_succeeds_when_within_capacity, - test_arena_alloc_fails_when_over_capacity, test_arena_clear, - test_arena_destroy); + RUN_TEST_FUNCS(test_arena_init, + test_arena_alloc_succeeds_when_within_capacity, + test_arena_alloc_fails_when_over_capacity, test_arena_clear, + test_arena_destroy); return EXIT_SUCCESS; }