authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2017-10-03 01:15:07-04:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2017-10-03 01:15:07-04:00
log8d4668231a9812067d5b12ebabd78871dfb8517a
treea49ae3ffe1f942a0a304a79dfc56601d56ab1c15
parent3c6eff465d84ce44182a0056e91610765c5010e6

compiler-rt tests pass with and without libc


2 files changed, 2 insertions(+), 15 deletions(-)

build.zig+1-1
......@@ -14,7 +14,7 @@ pub fn build(b: &Builder) {
1414 "std/index.zig", "std", "Run the standard library tests",
1515 with_lldb));
1616
17 test_step.dependOn(tests.addPkgTestsAlwaysLibc(b, test_filter,
17 test_step.dependOn(tests.addPkgTests(b, test_filter,
1818 "std/special/compiler_rt/index.zig", "compiler-rt", "Run the compiler_rt tests",
1919 with_lldb));
2020
test/tests.zig+1-14
......@@ -137,24 +137,11 @@ pub fn addParseCTests(b: &build.Builder, test_filter: ?[]const u8) -> &build.Ste
137137pub fn addPkgTests(b: &build.Builder, test_filter: ?[]const u8, root_src: []const u8,
138138 name:[] const u8, desc: []const u8, with_lldb: bool) -> &build.Step
139139{
140 return addPkgTestsRaw(b, test_filter, root_src, name, desc, false, with_lldb);
141}
142
143pub fn addPkgTestsAlwaysLibc(b: &build.Builder, test_filter: ?[]const u8, root_src: []const u8,
144 name:[] const u8, desc: []const u8, with_lldb: bool) -> &build.Step
145{
146 return addPkgTestsRaw(b, test_filter, root_src, name, desc, true, with_lldb);
147}
148
149pub fn addPkgTestsRaw(b: &build.Builder, test_filter: ?[]const u8, root_src: []const u8,
150 name:[] const u8, desc: []const u8, always_link_libc: bool, with_lldb: bool) -> &build.Step
151{
152 const libc_bools = if (always_link_libc) []bool{true} else []bool{false, true};
153140 const step = b.step(b.fmt("test-{}", name), desc);
154141 for (test_targets) |test_target| {
155142 const is_native = (test_target.os == builtin.os and test_target.arch == builtin.arch);
156143 for ([]Mode{Mode.Debug, Mode.ReleaseSafe, Mode.ReleaseFast}) |mode| {
157 for (libc_bools) |link_libc| {
144 for ([]bool{false, true}) |link_libc| {
158145 if (link_libc and !is_native) {
159146 // don't assume we have a cross-compiling libc set up
160147 continue;