Skip to content

Commit 7c5412c

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 15a05fc commit 7c5412c

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
@@ -376,7 +376,7 @@ pub fn build(b: *std.Build) !void {
376376

377377
const test_filters = b.option([]const []const u8, "test-filter", "Skip tests that do not match any filter") orelse &[0][]const u8{};
378378
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{};
379-
const test_slow_targets = b.option(bool, "test-slow-targets", "Enable running module tests for targets that have a slow compiler backend") orelse false;
379+
const test_extra_targets = b.option(bool, "test-extra-targets", "Enable running module tests for additional targets") orelse false;
380380

381381
var chosen_opt_modes_buf: [4]builtin.OptimizeMode = undefined;
382382
var chosen_mode_index: usize = 0;
@@ -433,7 +433,7 @@ pub fn build(b: *std.Build) !void {
433433
test_modules_step.dependOn(tests.addModuleTests(b, .{
434434
.test_filters = test_filters,
435435
.test_target_filters = test_target_filters,
436-
.test_slow_targets = test_slow_targets,
436+
.test_extra_targets = test_extra_targets,
437437
.root_src = "test/behavior.zig",
438438
.name = "behavior",
439439
.desc = "Run the behavior tests",
@@ -449,7 +449,7 @@ pub fn build(b: *std.Build) !void {
449449
test_modules_step.dependOn(tests.addModuleTests(b, .{
450450
.test_filters = test_filters,
451451
.test_target_filters = test_target_filters,
452-
.test_slow_targets = test_slow_targets,
452+
.test_extra_targets = test_extra_targets,
453453
.root_src = "test/c_import.zig",
454454
.name = "c-import",
455455
.desc = "Run the @cImport tests",
@@ -464,7 +464,7 @@ pub fn build(b: *std.Build) !void {
464464
test_modules_step.dependOn(tests.addModuleTests(b, .{
465465
.test_filters = test_filters,
466466
.test_target_filters = test_target_filters,
467-
.test_slow_targets = test_slow_targets,
467+
.test_extra_targets = test_extra_targets,
468468
.root_src = "lib/compiler_rt.zig",
469469
.name = "compiler-rt",
470470
.desc = "Run the compiler_rt tests",
@@ -480,7 +480,7 @@ pub fn build(b: *std.Build) !void {
480480
test_modules_step.dependOn(tests.addModuleTests(b, .{
481481
.test_filters = test_filters,
482482
.test_target_filters = test_target_filters,
483-
.test_slow_targets = test_slow_targets,
483+
.test_extra_targets = test_extra_targets,
484484
.root_src = "lib/c.zig",
485485
.name = "universal-libc",
486486
.desc = "Run the universal libc tests",
@@ -496,7 +496,7 @@ pub fn build(b: *std.Build) !void {
496496
test_modules_step.dependOn(tests.addModuleTests(b, .{
497497
.test_filters = test_filters,
498498
.test_target_filters = test_target_filters,
499-
.test_slow_targets = test_slow_targets,
499+
.test_extra_targets = test_extra_targets,
500500
.root_src = "lib/std/std.zig",
501501
.name = "std",
502502
.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)