commit 7c5412c7a49ff1bd387dcfdea4e1cbf0985a40d4 (tree)
parent 15a05fc32474daa33b642f47d5a11a7b93e26c07
Author: Alex Rønne Petersen <alex@alexrp.com>
Date: Fri, 21 Mar 2025 23:00:14 +0100
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.
Diffstat:
2 files changed, 11 insertions(+), 13 deletions(-)
diff --git a/build.zig b/build.zig
@@ -376,7 +376,7 @@ pub fn build(b: *std.Build) !void {
const test_filters = b.option([]const []const u8, "test-filter", "Skip tests that do not match any filter") orelse &[0][]const u8{};
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{};
- const test_slow_targets = b.option(bool, "test-slow-targets", "Enable running module tests for targets that have a slow compiler backend") orelse false;
+ const test_extra_targets = b.option(bool, "test-extra-targets", "Enable running module tests for additional targets") orelse false;
var chosen_opt_modes_buf: [4]builtin.OptimizeMode = undefined;
var chosen_mode_index: usize = 0;
@@ -433,7 +433,7 @@ pub fn build(b: *std.Build) !void {
test_modules_step.dependOn(tests.addModuleTests(b, .{
.test_filters = test_filters,
.test_target_filters = test_target_filters,
- .test_slow_targets = test_slow_targets,
+ .test_extra_targets = test_extra_targets,
.root_src = "test/behavior.zig",
.name = "behavior",
.desc = "Run the behavior tests",
@@ -449,7 +449,7 @@ pub fn build(b: *std.Build) !void {
test_modules_step.dependOn(tests.addModuleTests(b, .{
.test_filters = test_filters,
.test_target_filters = test_target_filters,
- .test_slow_targets = test_slow_targets,
+ .test_extra_targets = test_extra_targets,
.root_src = "test/c_import.zig",
.name = "c-import",
.desc = "Run the @cImport tests",
@@ -464,7 +464,7 @@ pub fn build(b: *std.Build) !void {
test_modules_step.dependOn(tests.addModuleTests(b, .{
.test_filters = test_filters,
.test_target_filters = test_target_filters,
- .test_slow_targets = test_slow_targets,
+ .test_extra_targets = test_extra_targets,
.root_src = "lib/compiler_rt.zig",
.name = "compiler-rt",
.desc = "Run the compiler_rt tests",
@@ -480,7 +480,7 @@ pub fn build(b: *std.Build) !void {
test_modules_step.dependOn(tests.addModuleTests(b, .{
.test_filters = test_filters,
.test_target_filters = test_target_filters,
- .test_slow_targets = test_slow_targets,
+ .test_extra_targets = test_extra_targets,
.root_src = "lib/c.zig",
.name = "universal-libc",
.desc = "Run the universal libc tests",
@@ -496,7 +496,7 @@ pub fn build(b: *std.Build) !void {
test_modules_step.dependOn(tests.addModuleTests(b, .{
.test_filters = test_filters,
.test_target_filters = test_target_filters,
- .test_slow_targets = test_slow_targets,
+ .test_extra_targets = test_extra_targets,
.root_src = "lib/std/std.zig",
.name = "std",
.desc = "Run the standard library tests",
diff --git a/test/tests.zig b/test/tests.zig
@@ -30,11 +30,9 @@ const TestTarget = struct {
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
- // of writing, this included LLVM's MIPS backend which takes upwards of 20 minutes longer to
- // compile tests than other backends. (No longer the case.)
- slow_backend: bool = false,
+ // This is intended for targets that are known to be slow to compile, or require a newer LLVM
+ // version than is present on the CI machines, etc.
+ extra_target: bool = false,
};
const test_targets = blk: {
@@ -1363,7 +1361,7 @@ pub fn addRunTranslatedCTests(
const ModuleTestOptions = struct {
test_filters: []const []const u8,
test_target_filters: []const []const u8,
- test_slow_targets: bool,
+ test_extra_targets: bool,
root_src: []const u8,
name: []const u8,
desc: []const u8,
@@ -1388,7 +1386,7 @@ pub fn addModuleTests(b: *std.Build, options: ModuleTestOptions) *Step {
}
}
- if (!options.test_slow_targets and test_target.slow_backend) continue;
+ if (!options.test_extra_targets and test_target.extra_target) continue;
if (options.skip_non_native and !test_target.target.isNative())
continue;