2017-04-19 05:13:15 +00:00
|
|
|
const Builder = @import("std").build.Builder;
|
|
|
|
const tests = @import("test/tests.zig");
|
|
|
|
|
|
|
|
pub fn build(b: &Builder) {
|
2017-10-21 21:31:06 +00:00
|
|
|
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);
|
|
|
|
|
|
|
|
|
2017-04-19 05:13:15 +00:00
|
|
|
const test_filter = b.option([]const u8, "test-filter", "Skip tests that do not match filter");
|
2017-09-17 18:43:51 +00:00
|
|
|
const with_lldb = b.option(bool, "with-lldb", "Run tests in LLDB to get a backtrace if one fails") ?? false;
|
2017-04-19 05:13:15 +00:00
|
|
|
const test_step = b.step("test", "Run all the tests");
|
|
|
|
|
2017-04-30 22:56:24 +00:00
|
|
|
test_step.dependOn(tests.addPkgTests(b, test_filter,
|
2017-09-17 18:43:51 +00:00
|
|
|
"test/behavior.zig", "behavior", "Run the behavior tests",
|
|
|
|
with_lldb));
|
2017-04-19 08:12:22 +00:00
|
|
|
|
2017-04-30 22:56:24 +00:00
|
|
|
test_step.dependOn(tests.addPkgTests(b, test_filter,
|
2017-09-17 18:43:51 +00:00
|
|
|
"std/index.zig", "std", "Run the standard library tests",
|
|
|
|
with_lldb));
|
2017-04-20 06:26:36 +00:00
|
|
|
|
2017-10-03 05:15:07 +00:00
|
|
|
test_step.dependOn(tests.addPkgTests(b, test_filter,
|
2017-09-17 18:43:51 +00:00
|
|
|
"std/special/compiler_rt/index.zig", "compiler-rt", "Run the compiler_rt tests",
|
|
|
|
with_lldb));
|
2017-08-18 17:51:16 +00:00
|
|
|
|
2017-04-30 22:56:24 +00:00
|
|
|
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));
|
2017-09-06 02:55:03 +00:00
|
|
|
test_step.dependOn(tests.addParseCTests(b, test_filter));
|
2017-04-19 05:13:15 +00:00
|
|
|
}
|