build system (first pass)

This commit is contained in:
2026-07-04 16:23:24 +02:00
parent 4ebe9c90e9
commit cdde49e68b
15 changed files with 1914 additions and 1 deletions
+25
View File
@@ -2551,6 +2551,31 @@ valid_program_compiles_and_runs :: proc(t: ^testing.T) {
testing.expect_value(t, state.exit_code, 0)
}
@(test)
build_command_is_recognized :: proc(t: ^testing.T) {
testing.expect(t, is_build_command("build"))
testing.expect(t, !is_build_command("translate-c"))
testing.expect(t, !is_build_command("--build"))
}
@(test)
build_subcommand_compiles_and_runs :: proc(t: ^testing.T) {
defer _ = os.remove("hello")
status := compiler_core.run_build("examples/build/hello")
testing.expect_value(t, status, 0)
state := run_executable("./hello")
testing.expect_value(t, state.exit_code, 0)
}
@(test)
build_subcommand_links_c_source_via_list_field :: proc(t: ^testing.T) {
defer _ = os.remove("manual_build")
status := compiler_core.run_build("examples/build/manual")
testing.expect_value(t, status, 0)
state := run_executable("./manual_build")
testing.expect_value(t, state.exit_code, 42)
}
@(test)
c_printf_accepts_a_string_literal :: proc(t: ^testing.T) {
output := "/tmp/brolang-test-printf"