mirror of
https://github.com/ziglang/zig.git
synced 2026-02-21 00:35:10 +00:00
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.
This commit is contained in:
parent
2c326c87b1
commit
2956232b42
@ -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,
|
||||
},
|
||||
|
||||
|
||||
@ -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(.{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user