authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-03-10 14:32:49-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-03-15 10:48:14-07:00
log2956232b427276c6ad1e52678e1cf3651976ec39
tree89effad800b1a314a4a2d737bd7187036c8755c6
parent2c326c87b16a0b8febf5347292ba61a592467d8c

standalone tests: avoid running on strange target

Without this, aarch64-linux tried to compile this test for aarch64-windows with the same CPU settings, which is not an intended test combination.

2 files changed, 6 insertions(+), 1 deletions(-)

test/standalone.zig+3-1
......@@ -5,6 +5,8 @@ pub const SimpleCase = struct {
55 target: std.zig.CrossTarget = .{},
66 is_test: bool = false,
77 is_exe: bool = true,
8 /// Run only on this OS.
9 os_filter: ?std.Target.Os.Tag = null,
810};
911
1012pub const BuildCase = struct {
......@@ -50,7 +52,7 @@ pub const simple_cases = [_]SimpleCase{
5052
5153 .{
5254 .src_path = "test/standalone/issue_9402/main.zig",
53 .target = .{ .os_tag = .windows },
55 .os_filter = .windows,
5456 .link_libc = true,
5557 },
5658
test/tests.zig+3
......@@ -571,6 +571,9 @@ pub fn addStandaloneTests(
571571 for (standalone.simple_cases) |case| {
572572 for (optimize_modes) |optimize| {
573573 if (!case.all_modes and optimize != .Debug) continue;
574 if (case.os_filter) |os_tag| {
575 if (os_tag != builtin.os.tag) continue;
576 }
574577
575578 if (case.is_exe) {
576579 const exe = b.addExecutable(.{