From d89cf3e7d86e21cd418795d1c0f0057f6d6eb60b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20R=C3=B8nne=20Petersen?= Date: Sat, 5 Oct 2024 02:25:13 +0200 Subject: [PATCH] test: Add the ability to skip specific modules for a target. --- test/tests.zig | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/test/tests.zig b/test/tests.zig index a9035560b3..32e618d939 100644 --- a/test/tests.zig +++ b/test/tests.zig @@ -28,6 +28,7 @@ const TestTarget = struct { use_lld: ?bool = null, pic: ?bool = null, strip: ?bool = null, + skip_modules: []const []const u8 = &.{}, // This is intended for targets that are known to be slow to compile. These are acceptable to // run in CI, but should not be run on developer machines by default. As an example, at the time @@ -1225,7 +1226,13 @@ const ModuleTestOptions = struct { pub fn addModuleTests(b: *std.Build, options: ModuleTestOptions) *Step { const step = b.step(b.fmt("test-{s}", .{options.name}), options.desc); - for (test_targets) |test_target| { + for_targets: for (test_targets) |test_target| { + if (test_target.skip_modules.len > 0) { + for (test_target.skip_modules) |skip_mod| { + if (std.mem.eql(u8, options.name, skip_mod)) continue :for_targets; + } + } + if (!options.test_slow_targets and test_target.slow_backend) continue; if (options.skip_non_native and !test_target.target.isNative())