mirror of
https://github.com/ziglang/zig.git
synced 2025-01-22 09:52:01 +00:00
38 lines
1.5 KiB
Zig
38 lines
1.5 KiB
Zig
const Builder = @import("std").build.Builder;
|
|
const tests = @import("test/tests.zig");
|
|
|
|
pub fn build(b: &Builder) {
|
|
const mode = b.standardReleaseOptions();
|
|
|
|
var exe = b.addExecutable("zig", "src-self-hosted/main.zig");
|
|
exe.setBuildMode(mode);
|
|
exe.linkSystemLibrary("c");
|
|
b.default_step.dependOn(&exe.step);
|
|
|
|
b.installArtifact(exe);
|
|
|
|
|
|
const test_filter = b.option([]const u8, "test-filter", "Skip tests that do not match filter");
|
|
const with_lldb = b.option(bool, "with-lldb", "Run tests in LLDB to get a backtrace if one fails") ?? false;
|
|
const test_step = b.step("test", "Run all the tests");
|
|
|
|
test_step.dependOn(tests.addPkgTests(b, test_filter,
|
|
"test/behavior.zig", "behavior", "Run the behavior tests",
|
|
with_lldb));
|
|
|
|
test_step.dependOn(tests.addPkgTests(b, test_filter,
|
|
"std/index.zig", "std", "Run the standard library tests",
|
|
with_lldb));
|
|
|
|
test_step.dependOn(tests.addPkgTests(b, test_filter,
|
|
"std/special/compiler_rt/index.zig", "compiler-rt", "Run the compiler_rt tests",
|
|
with_lldb));
|
|
|
|
test_step.dependOn(tests.addCompareOutputTests(b, test_filter));
|
|
test_step.dependOn(tests.addBuildExampleTests(b, test_filter));
|
|
test_step.dependOn(tests.addCompileErrorTests(b, test_filter));
|
|
test_step.dependOn(tests.addAssembleAndLinkTests(b, test_filter));
|
|
test_step.dependOn(tests.addDebugSafetyTests(b, test_filter));
|
|
test_step.dependOn(tests.addParseCTests(b, test_filter));
|
|
}
|