authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-03-21 23:00:14+01:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-04-04 06:08:10+02:00
log7c5412c7a49ff1bd387dcfdea4e1cbf0985a40d4
tree846ac2e24c25263c6cceb7bea397e711d4bdc989
parent15a05fc32474daa33b642f47d5a11a7b93e26c07
signaturebadge-check Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM

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.

2 files changed, 11 insertions(+), 13 deletions(-)

build.zig+6-6
...@@ -376,7 +376,7 @@ pub fn build(b: *std.Build) !void {...@@ -376,7 +376,7 @@ pub fn build(b: *std.Build) !void {
376376
377 const test_filters = b.option([]const []const u8, "test-filter", "Skip tests that do not match any filter") orelse &[0][]const u8{};377 const test_filters = b.option([]const []const u8, "test-filter", "Skip tests that do not match any filter") orelse &[0][]const u8{};
378 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{};378 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
381 var chosen_opt_modes_buf: [4]builtin.OptimizeMode = undefined;381 var chosen_opt_modes_buf: [4]builtin.OptimizeMode = undefined;
382 var chosen_mode_index: usize = 0;382 var chosen_mode_index: usize = 0;
...@@ -433,7 +433,7 @@ pub fn build(b: *std.Build) !void {...@@ -433,7 +433,7 @@ pub fn build(b: *std.Build) !void {
433 test_modules_step.dependOn(tests.addModuleTests(b, .{433 test_modules_step.dependOn(tests.addModuleTests(b, .{
434 .test_filters = test_filters,434 .test_filters = test_filters,
435 .test_target_filters = test_target_filters,435 .test_target_filters = test_target_filters,
436 .test_slow_targets = test_slow_targets,436 .test_extra_targets = test_extra_targets,
437 .root_src = "test/behavior.zig",437 .root_src = "test/behavior.zig",
438 .name = "behavior",438 .name = "behavior",
439 .desc = "Run the behavior tests",439 .desc = "Run the behavior tests",
...@@ -449,7 +449,7 @@ pub fn build(b: *std.Build) !void {...@@ -449,7 +449,7 @@ pub fn build(b: *std.Build) !void {
449 test_modules_step.dependOn(tests.addModuleTests(b, .{449 test_modules_step.dependOn(tests.addModuleTests(b, .{
450 .test_filters = test_filters,450 .test_filters = test_filters,
451 .test_target_filters = test_target_filters,451 .test_target_filters = test_target_filters,
452 .test_slow_targets = test_slow_targets,452 .test_extra_targets = test_extra_targets,
453 .root_src = "test/c_import.zig",453 .root_src = "test/c_import.zig",
454 .name = "c-import",454 .name = "c-import",
455 .desc = "Run the @cImport tests",455 .desc = "Run the @cImport tests",
...@@ -464,7 +464,7 @@ pub fn build(b: *std.Build) !void {...@@ -464,7 +464,7 @@ pub fn build(b: *std.Build) !void {
464 test_modules_step.dependOn(tests.addModuleTests(b, .{464 test_modules_step.dependOn(tests.addModuleTests(b, .{
465 .test_filters = test_filters,465 .test_filters = test_filters,
466 .test_target_filters = test_target_filters,466 .test_target_filters = test_target_filters,
467 .test_slow_targets = test_slow_targets,467 .test_extra_targets = test_extra_targets,
468 .root_src = "lib/compiler_rt.zig",468 .root_src = "lib/compiler_rt.zig",
469 .name = "compiler-rt",469 .name = "compiler-rt",
470 .desc = "Run the compiler_rt tests",470 .desc = "Run the compiler_rt tests",
...@@ -480,7 +480,7 @@ pub fn build(b: *std.Build) !void {...@@ -480,7 +480,7 @@ pub fn build(b: *std.Build) !void {
480 test_modules_step.dependOn(tests.addModuleTests(b, .{480 test_modules_step.dependOn(tests.addModuleTests(b, .{
481 .test_filters = test_filters,481 .test_filters = test_filters,
482 .test_target_filters = test_target_filters,482 .test_target_filters = test_target_filters,
483 .test_slow_targets = test_slow_targets,483 .test_extra_targets = test_extra_targets,
484 .root_src = "lib/c.zig",484 .root_src = "lib/c.zig",
485 .name = "universal-libc",485 .name = "universal-libc",
486 .desc = "Run the universal libc tests",486 .desc = "Run the universal libc tests",
...@@ -496,7 +496,7 @@ pub fn build(b: *std.Build) !void {...@@ -496,7 +496,7 @@ pub fn build(b: *std.Build) !void {
496 test_modules_step.dependOn(tests.addModuleTests(b, .{496 test_modules_step.dependOn(tests.addModuleTests(b, .{
497 .test_filters = test_filters,497 .test_filters = test_filters,
498 .test_target_filters = test_target_filters,498 .test_target_filters = test_target_filters,
499 .test_slow_targets = test_slow_targets,499 .test_extra_targets = test_extra_targets,
500 .root_src = "lib/std/std.zig",500 .root_src = "lib/std/std.zig",
501 .name = "std",501 .name = "std",
502 .desc = "Run the standard library tests",502 .desc = "Run the standard library tests",
test/tests.zig+5-7
...@@ -30,11 +30,9 @@ const TestTarget = struct {...@@ -30,11 +30,9 @@ const TestTarget = struct {
30 strip: ?bool = null,30 strip: ?bool = null,
31 skip_modules: []const []const u8 = &.{},31 skip_modules: []const []const u8 = &.{},
3232
33 // 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, or require a newer LLVM
34 // run in CI, but should not be run on developer machines by default. As an example, at the time34 // version than is present on the CI machines, etc.
35 // of writing, this included LLVM's MIPS backend which takes upwards of 20 minutes longer to35 extra_target: bool = false,
36 // compile tests than other backends. (No longer the case.)
37 slow_backend: bool = false,
38};36};
3937
40const test_targets = blk: {38const test_targets = blk: {
...@@ -1363,7 +1361,7 @@ pub fn addRunTranslatedCTests(...@@ -1363,7 +1361,7 @@ pub fn addRunTranslatedCTests(
1363const ModuleTestOptions = struct {1361const ModuleTestOptions = struct {
1364 test_filters: []const []const u8,1362 test_filters: []const []const u8,
1365 test_target_filters: []const []const u8,1363 test_target_filters: []const []const u8,
1366 test_slow_targets: bool,1364 test_extra_targets: bool,
1367 root_src: []const u8,1365 root_src: []const u8,
1368 name: []const u8,1366 name: []const u8,
1369 desc: []const u8,1367 desc: []const u8,
...@@ -1388,7 +1386,7 @@ pub fn addModuleTests(b: *std.Build, options: ModuleTestOptions) *Step {...@@ -1388,7 +1386,7 @@ pub fn addModuleTests(b: *std.Build, options: ModuleTestOptions) *Step {
1388 }1386 }
1389 }1387 }
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
1393 if (options.skip_non_native and !test_target.target.isNative())1391 if (options.skip_non_native and !test_target.target.isNative())
1394 continue;1392 continue;