sketch out stepping/eval exemplar testing; step-to-exit first pass

This commit is contained in:
Ryan Fleury
2026-06-02 12:11:04 -07:00
parent a0bf825169
commit dc61f20e3b
20 changed files with 568 additions and 75 deletions
+9 -1
View File
@@ -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