| author | |
| committer | |
| log | 11176d22f82861b4b6967b77f753414f214bc632 |
| tree | 9057a36dc881cb5d8b87ca00119b5bee3b9605fd |
| parent | 05c7968920c6a74debe407c2ea8c23cd60d89611 |
| parent | 55cc9dda66a24ed2a86a358533ecf5840d47b3d7 |
| signature |
`test`: QoL for port work, more mips re-enablement14 files changed, 140 insertions(+), 69 deletions(-)
build.zig+44-28| ... | ... | @@ -379,6 +379,8 @@ pub fn build(b: *std.Build) !void { |
| 379 | 379 | } |
| 380 | 380 | |
| 381 | 381 | const test_filters = b.option([]const []const u8, "test-filter", "Skip tests that do not match any filter") orelse &[0][]const u8{}; |
| 382 | 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; | |
| 382 | 384 | |
| 383 | 385 | const test_cases_options = b.addOptions(); |
| 384 | 386 | |
| ... | ... | @@ -455,8 +457,12 @@ pub fn build(b: *std.Build) !void { |
| 455 | 457 | }); |
| 456 | 458 | test_step.dependOn(test_cases_step); |
| 457 | 459 | |
| 458 | test_step.dependOn(tests.addModuleTests(b, .{ | |
| 460 | const test_modules_step = b.step("test-modules", "Run the per-target module tests"); | |
| 461 | ||
| 462 | test_modules_step.dependOn(tests.addModuleTests(b, .{ | |
| 459 | 463 | .test_filters = test_filters, |
| 464 | .test_target_filters = test_target_filters, | |
| 465 | .test_slow_targets = test_slow_targets, | |
| 460 | 466 | .root_src = "test/behavior.zig", |
| 461 | 467 | .name = "behavior", |
| 462 | 468 | .desc = "Run the behavior tests", |
| ... | ... | @@ -468,8 +474,10 @@ pub fn build(b: *std.Build) !void { |
| 468 | 474 | .max_rss = 1 * 1024 * 1024 * 1024, |
| 469 | 475 | })); |
| 470 | 476 | |
| 471 | test_step.dependOn(tests.addModuleTests(b, .{ | |
| 477 | test_modules_step.dependOn(tests.addModuleTests(b, .{ | |
| 472 | 478 | .test_filters = test_filters, |
| 479 | .test_target_filters = test_target_filters, | |
| 480 | .test_slow_targets = test_slow_targets, | |
| 473 | 481 | .root_src = "test/c_import.zig", |
| 474 | 482 | .name = "c-import", |
| 475 | 483 | .desc = "Run the @cImport tests", |
| ... | ... | @@ -480,8 +488,10 @@ pub fn build(b: *std.Build) !void { |
| 480 | 488 | .skip_libc = skip_libc, |
| 481 | 489 | })); |
| 482 | 490 | |
| 483 | test_step.dependOn(tests.addModuleTests(b, .{ | |
| 491 | test_modules_step.dependOn(tests.addModuleTests(b, .{ | |
| 484 | 492 | .test_filters = test_filters, |
| 493 | .test_target_filters = test_target_filters, | |
| 494 | .test_slow_targets = test_slow_targets, | |
| 485 | 495 | .root_src = "lib/compiler_rt.zig", |
| 486 | 496 | .name = "compiler-rt", |
| 487 | 497 | .desc = "Run the compiler_rt tests", |
| ... | ... | @@ -493,8 +503,10 @@ pub fn build(b: *std.Build) !void { |
| 493 | 503 | .no_builtin = true, |
| 494 | 504 | })); |
| 495 | 505 | |
| 496 | test_step.dependOn(tests.addModuleTests(b, .{ | |
| 506 | test_modules_step.dependOn(tests.addModuleTests(b, .{ | |
| 497 | 507 | .test_filters = test_filters, |
| 508 | .test_target_filters = test_target_filters, | |
| 509 | .test_slow_targets = test_slow_targets, | |
| 498 | 510 | .root_src = "lib/c.zig", |
| 499 | 511 | .name = "universal-libc", |
| 500 | 512 | .desc = "Run the universal libc tests", |
| ... | ... | @@ -506,6 +518,24 @@ pub fn build(b: *std.Build) !void { |
| 506 | 518 | .no_builtin = true, |
| 507 | 519 | })); |
| 508 | 520 | |
| 521 | test_modules_step.dependOn(tests.addModuleTests(b, .{ | |
| 522 | .test_filters = test_filters, | |
| 523 | .test_target_filters = test_target_filters, | |
| 524 | .test_slow_targets = test_slow_targets, | |
| 525 | .root_src = "lib/std/std.zig", | |
| 526 | .name = "std", | |
| 527 | .desc = "Run the standard library tests", | |
| 528 | .optimize_modes = optimization_modes, | |
| 529 | .include_paths = &.{}, | |
| 530 | .skip_single_threaded = skip_single_threaded, | |
| 531 | .skip_non_native = skip_non_native, | |
| 532 | .skip_libc = skip_libc, | |
| 533 | // I observed a value of 4572626944 on the M2 CI. | |
| 534 | .max_rss = 5029889638, | |
| 535 | })); | |
| 536 | ||
| 537 | test_step.dependOn(test_modules_step); | |
| 538 | ||
| 509 | 539 | test_step.dependOn(tests.addCompareOutputTests(b, test_filters, optimization_modes)); |
| 510 | 540 | test_step.dependOn(tests.addStandaloneTests( |
| 511 | 541 | b, |
| ... | ... | @@ -519,39 +549,25 @@ pub fn build(b: *std.Build) !void { |
| 519 | 549 | test_step.dependOn(tests.addStackTraceTests(b, test_filters, optimization_modes)); |
| 520 | 550 | test_step.dependOn(tests.addCliTests(b)); |
| 521 | 551 | test_step.dependOn(tests.addAssembleAndLinkTests(b, test_filters, optimization_modes)); |
| 522 | test_step.dependOn(tests.addModuleTests(b, .{ | |
| 523 | .test_filters = test_filters, | |
| 524 | .root_src = "lib/std/std.zig", | |
| 525 | .name = "std", | |
| 526 | .desc = "Run the standard library tests", | |
| 527 | .optimize_modes = optimization_modes, | |
| 528 | .include_paths = &.{}, | |
| 529 | .skip_single_threaded = skip_single_threaded, | |
| 530 | .skip_non_native = skip_non_native, | |
| 531 | .skip_libc = skip_libc, | |
| 532 | // I observed a value of 4572626944 on the M2 CI. | |
| 533 | .max_rss = 5029889638, | |
| 534 | })); | |
| 535 | 552 | |
| 536 | 553 | try addWasiUpdateStep(b, version); |
| 537 | 554 | |
| 538 | 555 | const update_mingw_step = b.step("update-mingw", "Update zig's bundled mingw"); |
| 539 | 556 | const opt_mingw_src_path = b.option([]const u8, "mingw-src", "path to mingw-w64 source directory"); |
| 540 | const update_mingw_exe = b.addExecutable(.{ | |
| 541 | .name = "update_mingw", | |
| 542 | .target = b.graph.host, | |
| 543 | .root_source_file = b.path("tools/update_mingw.zig"), | |
| 544 | }); | |
| 545 | const update_mingw_run = b.addRunArtifact(update_mingw_exe); | |
| 546 | update_mingw_run.addDirectoryArg(b.path("lib")); | |
| 547 | 557 | if (opt_mingw_src_path) |mingw_src_path| { |
| 558 | const update_mingw_exe = b.addExecutable(.{ | |
| 559 | .name = "update_mingw", | |
| 560 | .target = b.graph.host, | |
| 561 | .root_source_file = b.path("tools/update_mingw.zig"), | |
| 562 | }); | |
| 563 | const update_mingw_run = b.addRunArtifact(update_mingw_exe); | |
| 564 | update_mingw_run.addDirectoryArg(b.path("lib")); | |
| 548 | 565 | update_mingw_run.addDirectoryArg(.{ .cwd_relative = mingw_src_path }); |
| 566 | ||
| 567 | update_mingw_step.dependOn(&update_mingw_run.step); | |
| 549 | 568 | } else { |
| 550 | // Intentionally cause an error if this build step is requested. | |
| 551 | update_mingw_run.addArg("--missing-mingw-source-directory"); | |
| 569 | update_mingw_step.dependOn(&b.addFail("The -Dmingw-src=... option is required for this step").step); | |
| 552 | 570 | } |
| 553 | ||
| 554 | update_mingw_step.dependOn(&update_mingw_run.step); | |
| 555 | 571 | } |
| 556 | 572 | |
| 557 | 573 | fn addWasiUpdateStep(b: *std.Build, version: [:0]const u8) !void { |
ci/aarch64-linux-debug.sh+2-1| ... | ... | @@ -62,7 +62,8 @@ stage3-debug/bin/zig build test docs \ |
| 62 | 62 | -Dtarget=native-native-musl \ |
| 63 | 63 | --search-prefix "$PREFIX" \ |
| 64 | 64 | --zig-lib-dir "$PWD/../lib" \ |
| 65 | -Denable-tidy | |
| 65 | -Denable-tidy \ | |
| 66 | -Dtest-slow-targets | |
| 66 | 67 | |
| 67 | 68 | # Ensure that updating the wasm binary from this commit will result in a viable build. |
| 68 | 69 | stage3-debug/bin/zig build update-zig1 |
ci/aarch64-linux-release.sh+2-1| ... | ... | @@ -62,7 +62,8 @@ stage3-release/bin/zig build test docs \ |
| 62 | 62 | -Dtarget=native-native-musl \ |
| 63 | 63 | --search-prefix "$PREFIX" \ |
| 64 | 64 | --zig-lib-dir "$PWD/../lib" \ |
| 65 | -Denable-tidy | |
| 65 | -Denable-tidy \ | |
| 66 | -Dtest-slow-targets | |
| 66 | 67 | |
| 67 | 68 | # Ensure that stage3 and stage4 are byte-for-byte identical. |
| 68 | 69 | stage3-release/bin/zig build \ |
ci/aarch64-macos-debug.sh+2-1| ... | ... | @@ -55,4 +55,5 @@ stage3-debug/bin/zig build test docs \ |
| 55 | 55 | -Denable-macos-sdk \ |
| 56 | 56 | -Dstatic-llvm \ |
| 57 | 57 | -Dskip-non-native \ |
| 58 | --search-prefix "$PREFIX" | |
| 58 | --search-prefix "$PREFIX" \ | |
| 59 | -Dtest-slow-targets |
ci/aarch64-macos-release.sh+2-1| ... | ... | @@ -55,7 +55,8 @@ stage3-release/bin/zig build test docs \ |
| 55 | 55 | -Denable-macos-sdk \ |
| 56 | 56 | -Dstatic-llvm \ |
| 57 | 57 | -Dskip-non-native \ |
| 58 | --search-prefix "$PREFIX" | |
| 58 | --search-prefix "$PREFIX" \ | |
| 59 | -Dtest-slow-targets | |
| 59 | 60 | |
| 60 | 61 | # Ensure that stage3 and stage4 are byte-for-byte identical. |
| 61 | 62 | stage3-release/bin/zig build \ |
ci/aarch64-windows.ps1+2-1| ... | ... | @@ -67,7 +67,8 @@ Write-Output "Main test suite..." |
| 67 | 67 | --search-prefix "$PREFIX_PATH" ` |
| 68 | 68 | -Dstatic-llvm ` |
| 69 | 69 | -Dskip-non-native ` |
| 70 | -Denable-symlinks-windows | |
| 70 | -Denable-symlinks-windows ` | |
| 71 | -Dtest-slow-targets | |
| 71 | 72 | CheckLastExitCode |
| 72 | 73 | |
| 73 | 74 | # Ensure that stage3 and stage4 are byte-for-byte identical. |
ci/x86_64-linux-debug.sh+2-1| ... | ... | @@ -70,7 +70,8 @@ stage3-debug/bin/zig build test docs \ |
| 70 | 70 | -Dtarget=native-native-musl \ |
| 71 | 71 | --search-prefix "$PREFIX" \ |
| 72 | 72 | --zig-lib-dir "$PWD/../lib" \ |
| 73 | -Denable-tidy | |
| 73 | -Denable-tidy \ | |
| 74 | -Dtest-slow-targets | |
| 74 | 75 | |
| 75 | 76 | # Ensure that updating the wasm binary from this commit will result in a viable build. |
| 76 | 77 | stage3-debug/bin/zig build update-zig1 |
ci/x86_64-linux-release.sh+2-1| ... | ... | @@ -70,7 +70,8 @@ stage3-release/bin/zig build test docs \ |
| 70 | 70 | -Dtarget=native-native-musl \ |
| 71 | 71 | --search-prefix "$PREFIX" \ |
| 72 | 72 | --zig-lib-dir "$PWD/../lib" \ |
| 73 | -Denable-tidy | |
| 73 | -Denable-tidy \ | |
| 74 | -Dtest-slow-targets | |
| 74 | 75 | |
| 75 | 76 | # Ensure that stage3 and stage4 are byte-for-byte identical. |
| 76 | 77 | stage3-release/bin/zig build \ |
ci/x86_64-macos-release.sh+2-1| ... | ... | @@ -59,7 +59,8 @@ stage3/bin/zig build test docs \ |
| 59 | 59 | -Denable-macos-sdk \ |
| 60 | 60 | -Dstatic-llvm \ |
| 61 | 61 | -Dskip-non-native \ |
| 62 | --search-prefix "$PREFIX" | |
| 62 | --search-prefix "$PREFIX" \ | |
| 63 | -Dtest-slow-targets | |
| 63 | 64 | |
| 64 | 65 | # Ensure that stage3 and stage4 are byte-for-byte identical. |
| 65 | 66 | stage3/bin/zig build \ |
ci/x86_64-windows-debug.ps1+2-1| ... | ... | @@ -68,7 +68,8 @@ Write-Output "Main test suite..." |
| 68 | 68 | -Dstatic-llvm ` |
| 69 | 69 | -Dskip-non-native ` |
| 70 | 70 | -Dskip-release ` |
| 71 | -Denable-symlinks-windows | |
| 71 | -Denable-symlinks-windows ` | |
| 72 | -Dtest-slow-targets | |
| 72 | 73 | CheckLastExitCode |
| 73 | 74 | |
| 74 | 75 | Write-Output "Build x86_64-windows-msvc behavior tests using the C backend..." |
ci/x86_64-windows-release.ps1+2-1| ... | ... | @@ -67,7 +67,8 @@ Write-Output "Main test suite..." |
| 67 | 67 | --search-prefix "$PREFIX_PATH" ` |
| 68 | 68 | -Dstatic-llvm ` |
| 69 | 69 | -Dskip-non-native ` |
| 70 | -Denable-symlinks-windows | |
| 70 | -Denable-symlinks-windows ` | |
| 71 | -Dtest-slow-targets | |
| 71 | 72 | CheckLastExitCode |
| 72 | 73 | |
| 73 | 74 | # Ensure that stage3 and stage4 are byte-for-byte identical. |
lib/std/zig/system.zig+20-4| ... | ... | @@ -86,21 +86,37 @@ pub fn getExternalExecutor( |
| 86 | 86 | .arm => Executor{ .qemu = "qemu-arm" }, |
| 87 | 87 | .armeb => Executor{ .qemu = "qemu-armeb" }, |
| 88 | 88 | .hexagon => Executor{ .qemu = "qemu-hexagon" }, |
| 89 | .x86 => Executor{ .qemu = "qemu-i386" }, | |
| 90 | 89 | .m68k => Executor{ .qemu = "qemu-m68k" }, |
| 91 | 90 | .mips => Executor{ .qemu = "qemu-mips" }, |
| 92 | 91 | .mipsel => Executor{ .qemu = "qemu-mipsel" }, |
| 93 | .mips64 => Executor{ .qemu = "qemu-mips64" }, | |
| 94 | .mips64el => Executor{ .qemu = "qemu-mips64el" }, | |
| 92 | .mips64 => Executor{ | |
| 93 | .qemu = if (candidate.abi == .gnuabin32) | |
| 94 | "qemu-mipsn32" | |
| 95 | else | |
| 96 | "qemu-mips64", | |
| 97 | }, | |
| 98 | .mips64el => Executor{ | |
| 99 | .qemu = if (candidate.abi == .gnuabin32) | |
| 100 | "qemu-mipsn32el" | |
| 101 | else | |
| 102 | "qemu-mips64el", | |
| 103 | }, | |
| 95 | 104 | .powerpc => Executor{ .qemu = "qemu-ppc" }, |
| 96 | 105 | .powerpc64 => Executor{ .qemu = "qemu-ppc64" }, |
| 97 | 106 | .powerpc64le => Executor{ .qemu = "qemu-ppc64le" }, |
| 98 | 107 | .riscv32 => Executor{ .qemu = "qemu-riscv32" }, |
| 99 | 108 | .riscv64 => Executor{ .qemu = "qemu-riscv64" }, |
| 100 | 109 | .s390x => Executor{ .qemu = "qemu-s390x" }, |
| 101 | .sparc => Executor{ .qemu = "qemu-sparc" }, | |
| 110 | .sparc => Executor{ | |
| 111 | .qemu = if (std.Target.sparc.featureSetHas(candidate.cpu.features, .v9)) | |
| 112 | "qemu-sparc32plus" | |
| 113 | else | |
| 114 | "qemu-sparc", | |
| 115 | }, | |
| 102 | 116 | .sparc64 => Executor{ .qemu = "qemu-sparc64" }, |
| 117 | .x86 => Executor{ .qemu = "qemu-i386" }, | |
| 103 | 118 | .x86_64 => Executor{ .qemu = "qemu-x86_64" }, |
| 119 | .xtensa => Executor{ .qemu = "qemu-xtensa" }, | |
| 104 | 120 | else => return bad_result, |
| 105 | 121 | }; |
| 106 | 122 | } |
src/codegen/llvm.zig+13-2| ... | ... | @@ -11787,7 +11787,9 @@ fn backendSupportsF16(target: std.Target) bool { |
| 11787 | 11787 | .mips64el, |
| 11788 | 11788 | .s390x, |
| 11789 | 11789 | => false, |
| 11790 | .aarch64 => std.Target.aarch64.featureSetHas(target.cpu.features, .fp_armv8), | |
| 11790 | .aarch64, | |
| 11791 | .aarch64_be, | |
| 11792 | => std.Target.aarch64.featureSetHas(target.cpu.features, .fp_armv8), | |
| 11791 | 11793 | else => true, |
| 11792 | 11794 | }; |
| 11793 | 11795 | } |
| ... | ... | @@ -11798,9 +11800,18 @@ fn backendSupportsF16(target: std.Target) bool { |
| 11798 | 11800 | fn backendSupportsF128(target: std.Target) bool { |
| 11799 | 11801 | return switch (target.cpu.arch) { |
| 11800 | 11802 | .amdgcn, |
| 11803 | .mips64, | |
| 11804 | .mips64el, | |
| 11801 | 11805 | .sparc, |
| 11802 | 11806 | => false, |
| 11803 | .aarch64 => std.Target.aarch64.featureSetHas(target.cpu.features, .fp_armv8), | |
| 11807 | .powerpc, | |
| 11808 | .powerpcle, | |
| 11809 | .powerpc64, | |
| 11810 | .powerpc64le, | |
| 11811 | => target.os.tag != .aix, | |
| 11812 | .aarch64, | |
| 11813 | .aarch64_be, | |
| 11814 | => std.Target.aarch64.featureSetHas(target.cpu.features, .fp_armv8), | |
| 11804 | 11815 | else => true, |
| 11805 | 11816 | }; |
| 11806 | 11817 | } |
test/tests.zig+43-25| ... | ... | @@ -27,6 +27,12 @@ const TestTarget = struct { |
| 27 | 27 | use_lld: ?bool = null, |
| 28 | 28 | pic: ?bool = null, |
| 29 | 29 | strip: ?bool = null, |
| 30 | ||
| 31 | // This is intended for targets that are known to be slow to compile. These are acceptable to | |
| 32 | // run in CI, but should not be run on developer machines by default. As an example, at the time | |
| 33 | // of writing, this includes LLVM's MIPS backend which takes upwards of 20 minutes longer to | |
| 34 | // compile tests than other backends. | |
| 35 | slow_backend: bool = false, | |
| 30 | 36 | }; |
| 31 | 37 | |
| 32 | 38 | const test_targets = blk: { |
| ... | ... | @@ -310,8 +316,8 @@ const test_targets = blk: { |
| 310 | 316 | .os_tag = .linux, |
| 311 | 317 | .abi = .none, |
| 312 | 318 | }, |
| 319 | .slow_backend = true, | |
| 313 | 320 | }, |
| 314 | ||
| 315 | 321 | .{ |
| 316 | 322 | .target = .{ |
| 317 | 323 | .cpu_arch = .mips, |
| ... | ... | @@ -319,17 +325,17 @@ const test_targets = blk: { |
| 319 | 325 | .abi = .musl, |
| 320 | 326 | }, |
| 321 | 327 | .link_libc = true, |
| 328 | .slow_backend = true, | |
| 329 | }, | |
| 330 | .{ | |
| 331 | .target = .{ | |
| 332 | .cpu_arch = .mips, | |
| 333 | .os_tag = .linux, | |
| 334 | .abi = .gnueabihf, | |
| 335 | }, | |
| 336 | .link_libc = true, | |
| 337 | .slow_backend = true, | |
| 322 | 338 | }, |
| 323 | ||
| 324 | // https://github.com/ziglang/zig/issues/4927 | |
| 325 | //.{ | |
| 326 | // .target = .{ | |
| 327 | // .cpu_arch = .mips, | |
| 328 | // .os_tag = .linux, | |
| 329 | // .abi = .gnueabihf, | |
| 330 | // }, | |
| 331 | // .link_libc = true, | |
| 332 | //}, | |
| 333 | 339 | |
| 334 | 340 | .{ |
| 335 | 341 | .target = .{ |
| ... | ... | @@ -337,8 +343,8 @@ const test_targets = blk: { |
| 337 | 343 | .os_tag = .linux, |
| 338 | 344 | .abi = .none, |
| 339 | 345 | }, |
| 346 | .slow_backend = true, | |
| 340 | 347 | }, |
| 341 | ||
| 342 | 348 | .{ |
| 343 | 349 | .target = .{ |
| 344 | 350 | .cpu_arch = .mipsel, |
| ... | ... | @@ -346,17 +352,17 @@ const test_targets = blk: { |
| 346 | 352 | .abi = .musl, |
| 347 | 353 | }, |
| 348 | 354 | .link_libc = true, |
| 355 | .slow_backend = true, | |
| 356 | }, | |
| 357 | .{ | |
| 358 | .target = .{ | |
| 359 | .cpu_arch = .mipsel, | |
| 360 | .os_tag = .linux, | |
| 361 | .abi = .gnueabihf, | |
| 362 | }, | |
| 363 | .link_libc = true, | |
| 364 | .slow_backend = true, | |
| 349 | 365 | }, |
| 350 | ||
| 351 | // https://github.com/ziglang/zig/issues/4927 | |
| 352 | //.{ | |
| 353 | // .target = .{ | |
| 354 | // .cpu_arch = .mipsel, | |
| 355 | // .os_tag = .linux, | |
| 356 | // .abi = .gnueabihf, | |
| 357 | // }, | |
| 358 | // .link_libc = true, | |
| 359 | //}, | |
| 360 | 366 | |
| 361 | 367 | .{ |
| 362 | 368 | .target = .{ |
| ... | ... | @@ -407,7 +413,8 @@ const test_targets = blk: { |
| 407 | 413 | .link_libc = true, |
| 408 | 414 | }, |
| 409 | 415 | |
| 410 | // Disabled until LLVM fixes their O(N^2) codegen. | |
| 416 | // Disabled until LLVM fixes their O(N^2) codegen. Note that this is so bad that we don't | |
| 417 | // even want to include this in CI with `slow_backend`. | |
| 411 | 418 | // https://github.com/ziglang/zig/issues/18872 |
| 412 | 419 | //.{ |
| 413 | 420 | // .target = .{ |
| ... | ... | @@ -418,7 +425,8 @@ const test_targets = blk: { |
| 418 | 425 | // .use_llvm = true, |
| 419 | 426 | //}, |
| 420 | 427 | |
| 421 | // Disabled until LLVM fixes their O(N^2) codegen. | |
| 428 | // Disabled until LLVM fixes their O(N^2) codegen. Note that this is so bad that we don't | |
| 429 | // even want to include this in CI with `slow_backend`. | |
| 422 | 430 | // https://github.com/ziglang/zig/issues/18872 |
| 423 | 431 | //.{ |
| 424 | 432 | // .target = .{ |
| ... | ... | @@ -971,6 +979,8 @@ pub fn addRunTranslatedCTests( |
| 971 | 979 | |
| 972 | 980 | const ModuleTestOptions = struct { |
| 973 | 981 | test_filters: []const []const u8, |
| 982 | test_target_filters: []const []const u8, | |
| 983 | test_slow_targets: bool, | |
| 974 | 984 | root_src: []const u8, |
| 975 | 985 | name: []const u8, |
| 976 | 986 | desc: []const u8, |
| ... | ... | @@ -987,11 +997,20 @@ pub fn addModuleTests(b: *std.Build, options: ModuleTestOptions) *Step { |
| 987 | 997 | const step = b.step(b.fmt("test-{s}", .{options.name}), options.desc); |
| 988 | 998 | |
| 989 | 999 | for (test_targets) |test_target| { |
| 1000 | if (!options.test_slow_targets and test_target.slow_backend) continue; | |
| 1001 | ||
| 990 | 1002 | if (options.skip_non_native and !test_target.target.isNative()) |
| 991 | 1003 | continue; |
| 992 | 1004 | |
| 993 | 1005 | const resolved_target = b.resolveTargetQuery(test_target.target); |
| 994 | 1006 | const target = resolved_target.result; |
| 1007 | const triple_txt = target.zigTriple(b.allocator) catch @panic("OOM"); | |
| 1008 | ||
| 1009 | if (options.test_target_filters.len > 0) { | |
| 1010 | for (options.test_target_filters) |filter| { | |
| 1011 | if (std.mem.indexOf(u8, triple_txt, filter) != null) break; | |
| 1012 | } else continue; | |
| 1013 | } | |
| 995 | 1014 | |
| 996 | 1015 | if (options.skip_libc and test_target.link_libc == true) |
| 997 | 1016 | continue; |
| ... | ... | @@ -1040,7 +1059,6 @@ pub fn addModuleTests(b: *std.Build, options: ModuleTestOptions) *Step { |
| 1040 | 1059 | if (!want_this_mode) continue; |
| 1041 | 1060 | |
| 1042 | 1061 | const libc_suffix = if (test_target.link_libc == true) "-libc" else ""; |
| 1043 | const triple_txt = target.zigTriple(b.allocator) catch @panic("OOM"); | |
| 1044 | 1062 | const model_txt = target.cpu.model.name; |
| 1045 | 1063 | |
| 1046 | 1064 | // wasm32-wasi builds need more RAM, idk why |