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