diff --git a/test/standalone.zig b/test/standalone.zig index 6e0adcaa005622f8be29ff83b336a088f929cfbe..29a32d878f4c1bd1d4acb26144a0e3b4c07e8a13 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 c07b6693765935f62a77b0ad041554b2d80058e1..9ba9639e2a4535af922975bf25cf2e13bf5f4ead 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(.{