mirror of
https://github.com/ziglang/zig.git
synced 2025-12-06 06:13:07 +00:00
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.
This commit is contained in:
parent
15a05fc324
commit
7c5412c7a4
12
build.zig
12
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",
|
||||
|
||||
@ -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;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user