Compare commits
1 Commits
62c24c3e2c
...
a0334e50b4
Author | SHA1 | Date | |
---|---|---|---|
a0334e50b4 |
@ -605,44 +605,40 @@ void entry_point(Slice<char* const> arguments, Slice<char* const> envp)
|
|||||||
|
|
||||||
for (auto name: names)
|
for (auto name: names)
|
||||||
{
|
{
|
||||||
for (auto is_host_cpu_model : is_host_cpu_model_array)
|
for (BuildMode build_mode = BuildMode::debug_none; build_mode < BuildMode::count; build_mode = (BuildMode)((backing_type(BuildMode))build_mode + 1))
|
||||||
{
|
{
|
||||||
for (BuildMode build_mode = BuildMode::debug_none; build_mode < BuildMode::count; build_mode = (BuildMode)((backing_type(BuildMode))build_mode + 1))
|
for (bool has_debug_info : has_debug_info_array)
|
||||||
{
|
{
|
||||||
for (bool has_debug_info : has_debug_info_array)
|
auto position = arena->position;
|
||||||
|
|
||||||
|
String relative_file_path_parts[] = { string_literal("tests/"), name, string_literal(".bbb") };
|
||||||
|
auto relative_file_path = arena_join_string(arena, array_to_slice(relative_file_path_parts));
|
||||||
|
|
||||||
|
auto executable_path = compile_file(arena, {
|
||||||
|
.relative_file_path = relative_file_path,
|
||||||
|
.build_mode = build_mode,
|
||||||
|
.has_debug_info = has_debug_info,
|
||||||
|
.silent = true,
|
||||||
|
});
|
||||||
|
|
||||||
|
char* const arguments[] =
|
||||||
{
|
{
|
||||||
auto position = arena->position;
|
(char*)executable_path.pointer,
|
||||||
|
0,
|
||||||
String relative_file_path_parts[] = { string_literal("tests/"), name, string_literal(".bbb") };
|
};
|
||||||
auto relative_file_path = arena_join_string(arena, array_to_slice(relative_file_path_parts));
|
Slice<char* const> arg_slice = array_to_slice(arguments);
|
||||||
|
arg_slice.length -= 1;
|
||||||
auto executable_path = compile_file(arena, {
|
auto execution = os_execute(arena, arg_slice, environment, {});
|
||||||
.relative_file_path = relative_file_path,
|
auto success = execution.termination_kind == TerminationKind::exit && execution.termination_code == 0;
|
||||||
.build_mode = build_mode,
|
if (!success)
|
||||||
.has_debug_info = has_debug_info,
|
{
|
||||||
.host_cpu_model = is_host_cpu_model,
|
print(string_literal("Test failed: "));
|
||||||
.silent = true,
|
print(executable_path);
|
||||||
});
|
print(string_literal("\n"));
|
||||||
|
bb_fail();
|
||||||
char* const arguments[] =
|
|
||||||
{
|
|
||||||
(char*)executable_path.pointer,
|
|
||||||
0,
|
|
||||||
};
|
|
||||||
Slice<char* const> arg_slice = array_to_slice(arguments);
|
|
||||||
arg_slice.length -= 1;
|
|
||||||
auto execution = os_execute(arena, arg_slice, environment, {});
|
|
||||||
auto success = execution.termination_kind == TerminationKind::exit && execution.termination_code == 0;
|
|
||||||
if (!success)
|
|
||||||
{
|
|
||||||
print(string_literal("Test failed: "));
|
|
||||||
print(executable_path);
|
|
||||||
print(string_literal("\n"));
|
|
||||||
bb_fail();
|
|
||||||
}
|
|
||||||
|
|
||||||
arena_restore(arena, position);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
arena_restore(arena, position);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user