Compare commits

..

1 Commits

Author SHA1 Message Date
09c92d666c Move self-hosted tests to self-hosted compiler
All checks were successful
CI / ci (MinSizeRel, ubuntu-latest) (pull_request) Successful in 31s
CI / ci (RelWithDebInfo, ubuntu-latest) (pull_request) Successful in 35s
CI / ci (Release, ubuntu-latest) (pull_request) Successful in 30s
CI / ci (Debug, ubuntu-latest) (pull_request) Successful in 2m53s
CI / ci (Release, ubuntu-latest) (push) Successful in 33s
CI / ci (MinSizeRel, ubuntu-latest) (push) Successful in 36s
CI / ci (RelWithDebInfo, ubuntu-latest) (push) Successful in 40s
CI / ci (Debug, ubuntu-latest) (push) Successful in 2m53s
2025-06-06 12:18:31 -06:00

View File

@ -548,45 +548,45 @@ void entry_point(Slice<char* const> arguments, Slice<char* const> envp)
bool has_debug_info_array[] = {true, false};
// 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 (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[] =
// {
// (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);
// }
// }
// }
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 (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[] =
{
(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);
}
}
}
for (BuildMode compiler_build_mode = BuildMode::debug_none; compiler_build_mode < BuildMode::count; compiler_build_mode = (BuildMode)((backing_type(BuildMode))compiler_build_mode + 1))
{