diff --git a/test/standalone.zig b/test/standalone.zig index 6e0adcaa00..29a32d878f 100644 --- a/test/standalone.zig +++ b/test/standalone.zig @@ -5,6 +5,8 @@ pub const SimpleCase = struct { target: std.zig.CrossTarget = .{}, is_test: bool = false, is_exe: bool = true, + /// Run only on this OS. + os_filter: ?std.Target.Os.Tag = null, }; pub const BuildCase = struct { @@ -50,7 +52,7 @@ pub const simple_cases = [_]SimpleCase{ .{ .src_path = "test/standalone/issue_9402/main.zig", - .target = .{ .os_tag = .windows }, + .os_filter = .windows, .link_libc = true, }, diff --git a/test/tests.zig b/test/tests.zig index c07b669376..9ba9639e2a 100644 --- a/test/tests.zig +++ b/test/tests.zig @@ -571,6 +571,9 @@ pub fn addStandaloneTests( for (standalone.simple_cases) |case| { for (optimize_modes) |optimize| { if (!case.all_modes and optimize != .Debug) continue; + if (case.os_filter) |os_tag| { + if (os_tag != builtin.os.tag) continue; + } if (case.is_exe) { const exe = b.addExecutable(.{