mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-08-14 09:18:09 +00:00
WIP test PDB determinism
This commit is contained in:
@@ -60,6 +60,16 @@ t_read_file(Arena *arena, String8 name)
|
||||
return data;
|
||||
}
|
||||
|
||||
internal B32
|
||||
t_delete_file(String8 name)
|
||||
{
|
||||
Temp scratch = scratch_begin(0,0);
|
||||
String8 path = t_make_file_path(scratch.arena, name);
|
||||
B32 is_deleted = os_delete_file_at_path(path);
|
||||
scratch_end(scratch);
|
||||
return is_deleted;
|
||||
}
|
||||
|
||||
internal String8
|
||||
t_make_file_path(Arena *arena, String8 name)
|
||||
{
|
||||
|
||||
@@ -83,6 +83,7 @@ return result_; \
|
||||
internal B32 t_write_file_list(String8 name, String8List data);
|
||||
internal B32 t_write_file(String8 name, String8 data);
|
||||
internal String8 t_read_file(Arena *arena, String8 name);
|
||||
internal B32 t_delete_file(String8 name);
|
||||
internal String8 t_make_file_path(Arena *arena, String8 name);
|
||||
|
||||
// test runner
|
||||
|
||||
@@ -4758,6 +4758,36 @@ T_BeginTest(patch_cv_symbol_tree)
|
||||
}
|
||||
T_EndTest;
|
||||
|
||||
#if 0
|
||||
T_BeginTest(pdb_determ_test)
|
||||
{
|
||||
T_Ok(os_copy_file_path(t_make_file_path(scratch.arena, str8_lit("torture_main.obj")), str8_lit("torture_main.obj")));
|
||||
|
||||
t_delete_file(str8_lit("a.pdb"));
|
||||
t_delete_file(str8_lit("b.pdb"));
|
||||
|
||||
String8 refs_path = t_make_file_path(scratch.arena, str8_lit("b.types"));
|
||||
t_invoke_linkerf("torture_main.obj /debug:full /rad_time_stamp:0 /rad_workers:1 /rad_store_types:%S /out:a.exe", refs_path);
|
||||
T_Ok(g_last_exit_code == 0);
|
||||
T_Ok(os_move_file_path(t_make_file_path(scratch.arena, str8_lit("b.pdb")), t_make_file_path(scratch.arena, str8_lit("a.pdb"))));
|
||||
String8 b = t_read_file(scratch.arena, str8_lit("b.pdb"));
|
||||
|
||||
for EachIndex(i, 50) {
|
||||
Temp temp = temp_begin(scratch.arena);
|
||||
|
||||
t_delete_file(str8_lit("a.pdb"));
|
||||
t_invoke_linkerf("torture_main.obj /debug:full /rad_time_stamp:0 /out:a.exe");
|
||||
T_Ok(g_last_exit_code == 0);
|
||||
|
||||
String8 a = t_read_file(temp.arena, str8_lit("a.pdb"));
|
||||
T_Ok(str8_match(a, b, 0));
|
||||
|
||||
temp_end(temp);
|
||||
}
|
||||
}
|
||||
T_EndTest;
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
|
||||
T_BeginTest(fold_two_funcs)
|
||||
|
||||
Reference in New Issue
Block a user