mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-10-02 05:58:41 +00:00
sketch out stepping/eval exemplar testing; step-to-exit first pass
This commit is contained in:
@@ -23,7 +23,7 @@ struct TestResult
|
||||
char *fail_cond;
|
||||
};
|
||||
|
||||
#define TEST_FUNCTION_SIG(name) void name(Arena *arena, CmdLine *cmdline, String8 test_artifacts_path, TestResult *result_out, String8List *test_out)
|
||||
#define TEST_FUNCTION_SIG(name) void name(Arena *arena, CmdLine *cmdline, String8 test_exemplars_path, String8 test_artifacts_path, TestResult *result_out, String8List *test_out)
|
||||
#define TEST_FUNCTION_DEF(name) TEST_FUNCTION_SIG(test__##name)
|
||||
typedef TEST_FUNCTION_SIG(TestFunctionType);
|
||||
|
||||
@@ -76,10 +76,18 @@ TEST_FUNCTION_DEF(name)
|
||||
#define SkippedTest(name) DeclareTest(name, 1)\
|
||||
TEST_FUNCTION_DEF(name)
|
||||
|
||||
#define test_out(string) str8_list_push(arena, test_out, (string))
|
||||
#define test_outf(...) str8_list_pushf(arena, test_out, __VA_ARGS__)
|
||||
|
||||
#define TestCheck(c) do { if (!(c)) {\
|
||||
*result_out = (TestResult){ .fail_file = __FILE__, .fail_line = __LINE__, .fail_cond = Stringify(c) };\
|
||||
if(debugger_is_attached()) { Trap(); }\
|
||||
return;\
|
||||
} } while(0)
|
||||
|
||||
#define TestSkip() do {\
|
||||
*result_out = (TestResult){ .status = TestStatus_Skip };\
|
||||
return;\
|
||||
} while(0)
|
||||
|
||||
#endif // BASE_TEST_H
|
||||
|
||||
Reference in New Issue
Block a user