More small changes

This commit is contained in:
2025-08-27 22:12:19 +02:00
parent 4825623c73
commit 14f8b20d5f
4 changed files with 24 additions and 57 deletions

View File

@@ -154,7 +154,8 @@ do_golden_comparison :: (golden_path : string, comparison_text : string, result_
}
run_codegen_test :: (file_path : string, result : *Compile_Result, output_type : Output_Type = 0) -> Result {
add_file(result, file_path);
result.file = make_file(result, file_path);
result.allocator = make_arena(*result.arena);
result_data : Result;
result_data.path = file_path;
@@ -219,7 +220,9 @@ run_lexer_test :: (file_path : string, result : *Compile_Result, output_type : O
result_text : string;
add_file(result, file_path);
result.file = make_file(result, file_path);
result.allocator = make_arena(*result.arena);
lex(result);
if result.had_error {
result_data.type = .Failed;
@@ -243,7 +246,8 @@ run_parser_test :: (file_path : string, result : *Compile_Result, output_type :
result_data : Result;
result_data.path = file_path;
add_file(result, file_path);
result.file = make_file(result, file_path);
result.allocator = make_arena(*result.arena);
lex(result);
if result.had_error {
@@ -306,7 +310,8 @@ run_semantic_analysis_test :: (result : *Compile_Result, output_type : Output_Ty
}
run_semantic_analysis_test :: (file_path : string, result : *Compile_Result, output_type : Output_Type = 0) -> Result {
add_file(result, file_path);
result.file = make_file(result, file_path);
result.allocator = make_arena(*result.arena);
result_data : Result;
result_data.path = file_path;
@@ -334,7 +339,10 @@ make_test_case :: (path : string, stage_flags : Stage_Flags, allocator := contex
run_test_new :: (file_path : string, stage_flags : Stage_Flags, results : *[..]Result, output_type : Output_Type = 0) {
compile_result : Compile_Result;
add_file(*compile_result, file_path);
compile_result.file = make_file(*compile_result, file_path);
compile_result.allocator = make_arena(*compile_result.arena);
result : Result;
if stage_flags & .Lexer {
result = run_lexer_test(file_path, *compile_result, output_type);