build system (first pass)
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user