// vim:fileencoding=utf-8:foldmethod=marker #ifndef TESTER_H #define TESTER_H #include "../../common/misc/misc_utils.h" #include "../../common/platform/platform.h" #include "../../base/strings/str8/str8.h" #ifdef WAPP_PLATFORM_CPP BEGIN_C_LINKAGE #define wapp_tester_result(PASSED) (TestFuncResult{wapp_str8_lit_ro(__func__), PASSED, {}}) #else #define wapp_tester_result(PASSED) ((TestFuncResult){.name = wapp_str8_lit_ro(__func__), .passed = PASSED}) #endif // !WAPP_PLATFORM_CPP #define wapp_tester_run_tests(...) run_tests(__VA_ARGS__, NULL) typedef struct TestFuncResult TestFuncResult; struct TestFuncResult { Str8 name; b8 passed; wapp_misc_utils_reserve_padding(sizeof(Str8) + sizeof(b8)); }; typedef TestFuncResult(TestFunc)(void); void run_tests(TestFunc *func1, ...); #ifdef WAPP_PLATFORM_CPP END_C_LINKAGE #endif // !WAPP_PLATFORM_CPP #endif // !TESTER_H