authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2026-10-23 11:03:41+02:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2026-10-23 11:04:37+02:00
log457e906bb36f416627ae142c5add5e95ec803582
treedb256b951dfd60b5f5cdcfded9ee65d2cf7f1769
parentfb255db0adc7fb39f4d33738fcf3c5831a1a7649
signature Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM

build: add -Dskip-cbe option for skipping CBE tests


2 files changed, 15 insertions(+), 0 deletions(-)

build.zig+7
...@@ -129,6 +129,7 @@ pub fn build(b: *std.Build) !void {...@@ -129,6 +129,7 @@ pub fn build(b: *std.Build) !void {
129 const skip_darwin = b.option(bool, "skip-darwin", "Main test suite skips targets with darwin OSs") orelse false;129 const skip_darwin = b.option(bool, "skip-darwin", "Main test suite skips targets with darwin OSs") orelse false;
130 const skip_linux = b.option(bool, "skip-linux", "Main test suite skips targets with linux OS") orelse false;130 const skip_linux = b.option(bool, "skip-linux", "Main test suite skips targets with linux OS") orelse false;
131 const skip_llvm = b.option(bool, "skip-llvm", "Main test suite skips targets that use LLVM backend") orelse false;131 const skip_llvm = b.option(bool, "skip-llvm", "Main test suite skips targets that use LLVM backend") orelse false;
132 const skip_cbe = b.option(bool, "skip-cbe", "Main test suite skips targets that use C backend") orelse false;
132133
133 const only_install_lib_files = b.option(bool, "lib-files-only", "Only install library files") orelse false;134 const only_install_lib_files = b.option(bool, "lib-files-only", "Only install library files") orelse false;
134135
...@@ -532,6 +533,7 @@ pub fn build(b: *std.Build) !void {...@@ -532,6 +533,7 @@ pub fn build(b: *std.Build) !void {
532 .skip_darwin = skip_darwin,533 .skip_darwin = skip_darwin,
533 .skip_linux = skip_linux,534 .skip_linux = skip_linux,
534 .skip_llvm = skip_llvm,535 .skip_llvm = skip_llvm,
536 .skip_cbe = skip_cbe,
535 .skip_libc = skip_libc,537 .skip_libc = skip_libc,
536 .max_rss = 4_000_000_000,538 .max_rss = 4_000_000_000,
537 }));539 }));
...@@ -558,6 +560,7 @@ pub fn build(b: *std.Build) !void {...@@ -558,6 +560,7 @@ pub fn build(b: *std.Build) !void {
558 .skip_darwin = skip_darwin,560 .skip_darwin = skip_darwin,
559 .skip_linux = skip_linux,561 .skip_linux = skip_linux,
560 .skip_llvm = skip_llvm,562 .skip_llvm = skip_llvm,
563 .skip_cbe = skip_cbe,
561 .skip_libc = true,564 .skip_libc = true,
562 .no_builtin = true,565 .no_builtin = true,
563 .max_rss = 4_000_000_000,566 .max_rss = 4_000_000_000,
...@@ -585,6 +588,7 @@ pub fn build(b: *std.Build) !void {...@@ -585,6 +588,7 @@ pub fn build(b: *std.Build) !void {
585 .skip_darwin = skip_darwin,588 .skip_darwin = skip_darwin,
586 .skip_linux = skip_linux,589 .skip_linux = skip_linux,
587 .skip_llvm = skip_llvm,590 .skip_llvm = skip_llvm,
591 .skip_cbe = skip_cbe,
588 .skip_libc = skip_libc,592 .skip_libc = skip_libc,
589 .max_rss = 9_600_000_000,593 .max_rss = 9_600_000_000,
590 }));594 }));
...@@ -611,6 +615,7 @@ pub fn build(b: *std.Build) !void {...@@ -611,6 +615,7 @@ pub fn build(b: *std.Build) !void {
611 .skip_darwin = skip_darwin,615 .skip_darwin = skip_darwin,
612 .skip_linux = skip_linux,616 .skip_linux = skip_linux,
613 .skip_llvm = skip_llvm,617 .skip_llvm = skip_llvm,
618 .skip_cbe = skip_cbe,
614 .skip_libc = skip_libc,619 .skip_libc = skip_libc,
615 .no_builtin = true,620 .no_builtin = true,
616 .max_rss = 4_000_000_000,621 .max_rss = 4_000_000_000,
...@@ -658,6 +663,7 @@ pub fn build(b: *std.Build) !void {...@@ -658,6 +663,7 @@ pub fn build(b: *std.Build) !void {
658 .skip_darwin = skip_darwin,663 .skip_darwin = skip_darwin,
659 .skip_linux = skip_linux,664 .skip_linux = skip_linux,
660 .skip_llvm = skip_llvm,665 .skip_llvm = skip_llvm,
666 .skip_cbe = skip_cbe,
661 .max_rss = 4_300_000_000,667 .max_rss = 4_300_000_000,
662 }));668 }));
663 test_step.dependOn(tests.addLinkTests(b, .{669 test_step.dependOn(tests.addLinkTests(b, .{
...@@ -798,6 +804,7 @@ pub fn build(b: *std.Build) !void {...@@ -798,6 +804,7 @@ pub fn build(b: *std.Build) !void {
798 .skip_darwin = skip_darwin,804 .skip_darwin = skip_darwin,
799 .skip_linux = skip_linux,805 .skip_linux = skip_linux,
800 .skip_llvm = skip_llvm,806 .skip_llvm = skip_llvm,
807 .skip_cbe = skip_cbe,
801 .llvm_has_m68k = llvm_has_m68k,808 .llvm_has_m68k = llvm_has_m68k,
802 .llvm_has_csky = llvm_has_csky,809 .llvm_has_csky = llvm_has_csky,
803 .llvm_has_arc = llvm_has_arc,810 .llvm_has_arc = llvm_has_arc,
test/tests.zig+8
...@@ -2508,6 +2508,7 @@ pub const ModuleTestOptions = struct {...@@ -2508,6 +2508,7 @@ pub const ModuleTestOptions = struct {
2508 skip_darwin: bool,2508 skip_darwin: bool,
2509 skip_linux: bool,2509 skip_linux: bool,
2510 skip_llvm: bool,2510 skip_llvm: bool,
2511 skip_cbe: bool,
2511 skip_libc: bool,2512 skip_libc: bool,
2512 max_rss: u64 = 0,2513 max_rss: u64 = 0,
2513 no_builtin: bool = false,2514 no_builtin: bool = false,
...@@ -2579,6 +2580,7 @@ pub fn addModuleTests(b: *std.Build, options: ModuleTestOptions) *Step {...@@ -2579,6 +2580,7 @@ pub fn addModuleTests(b: *std.Build, options: ModuleTestOptions) *Step {
25792580
2580 const would_use_llvm = wouldUseLlvm(test_target.use_llvm, test_target.target, test_target.optimize_mode);2581 const would_use_llvm = wouldUseLlvm(test_target.use_llvm, test_target.target, test_target.optimize_mode);
2581 if (options.skip_llvm and would_use_llvm) continue;2582 if (options.skip_llvm and would_use_llvm) continue;
2583 if (options.skip_cbe and target.ofmt == .c) continue;
25822584
2583 const triple_txt = resolved_target.query.zigTriple(b.allocator) catch @panic("OOM");2585 const triple_txt = resolved_target.query.zigTriple(b.allocator) catch @panic("OOM");
25842586
...@@ -2854,6 +2856,7 @@ const CAbiTestOptions = struct {...@@ -2854,6 +2856,7 @@ const CAbiTestOptions = struct {
2854 skip_darwin: bool,2856 skip_darwin: bool,
2855 skip_linux: bool,2857 skip_linux: bool,
2856 skip_llvm: bool,2858 skip_llvm: bool,
2859 skip_cbe: bool,
2857 max_rss: u64 = 0,2860 max_rss: u64 = 0,
2858};2861};
28592862
...@@ -2886,6 +2889,7 @@ pub fn addCAbiTests(b: *std.Build, options: CAbiTestOptions) *Step {...@@ -2886,6 +2889,7 @@ pub fn addCAbiTests(b: *std.Build, options: CAbiTestOptions) *Step {
2886 for (options.optimize_modes) |optimize_mode| {2889 for (options.optimize_modes) |optimize_mode| {
2887 const would_use_llvm = wouldUseLlvm(c_abi_target.use_llvm, c_abi_target.target, optimize_mode);2890 const would_use_llvm = wouldUseLlvm(c_abi_target.use_llvm, c_abi_target.target, optimize_mode);
2888 if (options.skip_llvm and would_use_llvm) continue;2891 if (options.skip_llvm and would_use_llvm) continue;
2892 if (options.skip_cbe and target.ofmt == .c) continue;
28892893
2890 const test_mod = b.createModule(.{2894 const test_mod = b.createModule(.{
2891 .root_source_file = b.path("test/c_abi/main.zig"),2895 .root_source_file = b.path("test/c_abi/main.zig"),
...@@ -3071,6 +3075,7 @@ pub const RunnerOptions = struct {...@@ -3071,6 +3075,7 @@ pub const RunnerOptions = struct {
3071 skip_darwin: bool,3075 skip_darwin: bool,
3072 skip_linux: bool,3076 skip_linux: bool,
3073 skip_llvm: bool,3077 skip_llvm: bool,
3078 skip_cbe: bool,
3074 llvm_has_m68k: bool,3079 llvm_has_m68k: bool,
3075 llvm_has_csky: bool,3080 llvm_has_csky: bool,
3076 llvm_has_arc: bool,3081 llvm_has_arc: bool,
...@@ -3147,6 +3152,9 @@ pub fn addRunnerTests(...@@ -3147,6 +3152,9 @@ pub fn addRunnerTests(
3147 .xtensa => if (!options.llvm_has_xtensa) continue,3152 .xtensa => if (!options.llvm_has_xtensa) continue,
3148 }3153 }
3149 }3154 }
3155 if (test_target.backend == .cbe) {
3156 if (options.skip_cbe) continue;
3157 }
31503158
3151 const target_str = b.fmt("{f}", .{test_target});3159 const target_str = b.fmt("{f}", .{test_target});
31523160