Skip to content

Commit f234cbe

Browse files
committed
build: Rename -Dtest-slow-targets to -Dtest-extra-targets.
This can be used more broadly for targets that aren't quite ready to be tested by default yet.
1 parent cc1a414 commit f234cbe

File tree

2 files changed

+11
-13
lines changed

2 files changed

+11
-13
lines changed

build.zig

+6-6
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ pub fn build(b: *std.Build) !void {
380380

381381
const test_filters = b.option([]const []const u8, "test-filter", "Skip tests that do not match any filter") orelse &[0][]const u8{};
382382
const test_target_filters = b.option([]const []const u8, "test-target-filter", "Skip tests whose target triple do not match any filter") orelse &[0][]const u8{};
383-
const test_slow_targets = b.option(bool, "test-slow-targets", "Enable running module tests for targets that have a slow compiler backend") orelse false;
383+
const test_extra_targets = b.option(bool, "test-extra-targets", "Enable running module tests for additional targets") orelse false;
384384

385385
var chosen_opt_modes_buf: [4]builtin.OptimizeMode = undefined;
386386
var chosen_mode_index: usize = 0;
@@ -437,7 +437,7 @@ pub fn build(b: *std.Build) !void {
437437
test_modules_step.dependOn(tests.addModuleTests(b, .{
438438
.test_filters = test_filters,
439439
.test_target_filters = test_target_filters,
440-
.test_slow_targets = test_slow_targets,
440+
.test_extra_targets = test_extra_targets,
441441
.root_src = "test/behavior.zig",
442442
.name = "behavior",
443443
.desc = "Run the behavior tests",
@@ -453,7 +453,7 @@ pub fn build(b: *std.Build) !void {
453453
test_modules_step.dependOn(tests.addModuleTests(b, .{
454454
.test_filters = test_filters,
455455
.test_target_filters = test_target_filters,
456-
.test_slow_targets = test_slow_targets,
456+
.test_extra_targets = test_extra_targets,
457457
.root_src = "test/c_import.zig",
458458
.name = "c-import",
459459
.desc = "Run the @cImport tests",
@@ -468,7 +468,7 @@ pub fn build(b: *std.Build) !void {
468468
test_modules_step.dependOn(tests.addModuleTests(b, .{
469469
.test_filters = test_filters,
470470
.test_target_filters = test_target_filters,
471-
.test_slow_targets = test_slow_targets,
471+
.test_extra_targets = test_extra_targets,
472472
.root_src = "lib/compiler_rt.zig",
473473
.name = "compiler-rt",
474474
.desc = "Run the compiler_rt tests",
@@ -484,7 +484,7 @@ pub fn build(b: *std.Build) !void {
484484
test_modules_step.dependOn(tests.addModuleTests(b, .{
485485
.test_filters = test_filters,
486486
.test_target_filters = test_target_filters,
487-
.test_slow_targets = test_slow_targets,
487+
.test_extra_targets = test_extra_targets,
488488
.root_src = "lib/c.zig",
489489
.name = "universal-libc",
490490
.desc = "Run the universal libc tests",
@@ -500,7 +500,7 @@ pub fn build(b: *std.Build) !void {
500500
test_modules_step.dependOn(tests.addModuleTests(b, .{
501501
.test_filters = test_filters,
502502
.test_target_filters = test_target_filters,
503-
.test_slow_targets = test_slow_targets,
503+
.test_extra_targets = test_extra_targets,
504504
.root_src = "lib/std/std.zig",
505505
.name = "std",
506506
.desc = "Run the standard library tests",

test/tests.zig

+5-7
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,9 @@ const TestTarget = struct {
3030
strip: ?bool = null,
3131
skip_modules: []const []const u8 = &.{},
3232

33-
// This is intended for targets that are known to be slow to compile. These are acceptable to
34-
// run in CI, but should not be run on developer machines by default. As an example, at the time
35-
// of writing, this included LLVM's MIPS backend which takes upwards of 20 minutes longer to
36-
// compile tests than other backends. (No longer the case.)
37-
slow_backend: bool = false,
33+
// This is intended for targets that are known to be slow to compile, or require a newer LLVM
34+
// version than is present on the CI machines, etc.
35+
extra_target: bool = false,
3836
};
3937

4038
const test_targets = blk: {
@@ -1363,7 +1361,7 @@ pub fn addRunTranslatedCTests(
13631361
const ModuleTestOptions = struct {
13641362
test_filters: []const []const u8,
13651363
test_target_filters: []const []const u8,
1366-
test_slow_targets: bool,
1364+
test_extra_targets: bool,
13671365
root_src: []const u8,
13681366
name: []const u8,
13691367
desc: []const u8,
@@ -1388,7 +1386,7 @@ pub fn addModuleTests(b: *std.Build, options: ModuleTestOptions) *Step {
13881386
}
13891387
}
13901388

1391-
if (!options.test_slow_targets and test_target.slow_backend) continue;
1389+
if (!options.test_extra_targets and test_target.extra_target) continue;
13921390

13931391
if (options.skip_non_native and !test_target.target.isNative())
13941392
continue;

0 commit comments

Comments
 (0)