convert std lib tests to zig build system

This commit is contained in:
Andrew Kelley 2017-04-19 04:12:22 -04:00
parent 10525b869d
commit d0a17b6937
4 changed files with 1830 additions and 1815 deletions

View File

@ -11,6 +11,7 @@ pub fn build(b: &Builder) {
run_tests_cmd.step.dependOn(&run_tests_exe.step);
const self_hosted_tests = b.step("test-self-hosted", "Run the self-hosted tests");
test_step.dependOn(self_hosted_tests);
for ([]bool{false, true}) |release| {
for ([]bool{false, true}) |link_libc| {
const these_tests = b.addTest("test/self_hosted.zig");
@ -24,9 +25,24 @@ pub fn build(b: &Builder) {
}
}
test_step.dependOn(self_hosted_tests);
const std_lib_tests = b.step("test-std", "Run the standard library tests");
test_step.dependOn(std_lib_tests);
for ([]bool{false, true}) |release| {
for ([]bool{false, true}) |link_libc| {
const these_tests = b.addTest("std/index.zig");
// TODO add prefix to test names
// TODO pass test_filter to these_tests
these_tests.setRelease(release);
if (link_libc) {
these_tests.linkLibrary("c");
}
std_lib_tests.dependOn(&these_tests.step);
}
}
//test_step.dependOn(&run_tests_cmd.step);
test_step.dependOn(tests.addCompareOutputTests(b, test_filter));
test_step.dependOn(tests.addBuildExampleTests(b, test_filter));
test_step.dependOn(tests.addCompileErrorTests(b, test_filter));
}

1812
test/compile_errors.zig Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,2 +1,3 @@
pub const addCompareOutputTests = @import("compare_output.zig").addCompareOutputTests;
pub const addBuildExampleTests = @import("build_examples.zig").addBuildExampleTests;
pub const addCompileErrorTests = @import("compile_errors.zig").addCompileErrorTests;