authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2024-10-05 02:25:13+02:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2024-11-03 09:29:33+01:00
logd89cf3e7d86e21cd418795d1c0f0057f6d6eb60b
tree495b32dbc252090ae4ba1748ce57c264e032d252
parent3a2647b7d3b68fe32bab488f1fa8eaa1ec57f31a
signaturebadge-check Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM

test: Add the ability to skip specific modules for a target.


1 files changed, 8 insertions(+), 1 deletions(-)

test/tests.zig+8-1
...@@ -28,6 +28,7 @@ const TestTarget = struct {...@@ -28,6 +28,7 @@ const TestTarget = struct {
28 use_lld: ?bool = null,28 use_lld: ?bool = null,
29 pic: ?bool = null,29 pic: ?bool = null,
30 strip: ?bool = null,30 strip: ?bool = null,
31 skip_modules: []const []const u8 = &.{},
3132
32 // This is intended for targets that are known to be slow to compile. These are acceptable to33 // This is intended for targets that are known to be slow to compile. These are acceptable to
33 // run in CI, but should not be run on developer machines by default. As an example, at the time34 // 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 {...@@ -1225,7 +1226,13 @@ const ModuleTestOptions = struct {
1225pub fn addModuleTests(b: *std.Build, options: ModuleTestOptions) *Step {1226pub fn addModuleTests(b: *std.Build, options: ModuleTestOptions) *Step {
1226 const step = b.step(b.fmt("test-{s}", .{options.name}), options.desc);1227 const step = b.step(b.fmt("test-{s}", .{options.name}), options.desc);
12271228
1228 for (test_targets) |test_target| {1229 for_targets: for (test_targets) |test_target| {
1230 if (test_target.skip_modules.len > 0) {
1231 for (test_target.skip_modules) |skip_mod| {
1232 if (std.mem.eql(u8, options.name, skip_mod)) continue :for_targets;
1233 }
1234 }
1235
1229 if (!options.test_slow_targets and test_target.slow_backend) continue;1236 if (!options.test_slow_targets and test_target.slow_backend) continue;
12301237
1231 if (options.skip_non_native and !test_target.target.isNative())1238 if (options.skip_non_native and !test_target.target.isNative())