authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-07-23 00:23:31+02:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-08-02 09:34:55+02:00
logbcaae562d6f62b8cff829eab19417b8dfc4a8dcd
treedcfae251067e1a38f5f88e22af87603420b4c134
parent761857e3f9dae52b474b38bd2800b72e181745ee
signaturebadge-check Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM

build: add -Dskip-compile-errors option

Skips tests in test/cases/compile_errors.

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

build.zig+2
...@@ -90,6 +90,7 @@ pub fn build(b: *std.Build) !void {...@@ -90,6 +90,7 @@ pub fn build(b: *std.Build) !void {
90 const skip_non_native = b.option(bool, "skip-non-native", "Main test suite skips non-native builds") orelse false;90 const skip_non_native = b.option(bool, "skip-non-native", "Main test suite skips non-native builds") orelse false;
91 const skip_libc = b.option(bool, "skip-libc", "Main test suite skips tests that link libc") orelse false;91 const skip_libc = b.option(bool, "skip-libc", "Main test suite skips tests that link libc") orelse false;
92 const skip_single_threaded = b.option(bool, "skip-single-threaded", "Main test suite skips tests that are single-threaded") orelse false;92 const skip_single_threaded = b.option(bool, "skip-single-threaded", "Main test suite skips tests that are single-threaded") orelse false;
93 const skip_compile_errors = b.option(bool, "skip-compile-errors", "Main test suite skips compile error tests") orelse false;
93 const skip_translate_c = b.option(bool, "skip-translate-c", "Main test suite skips translate-c tests") orelse false;94 const skip_translate_c = b.option(bool, "skip-translate-c", "Main test suite skips translate-c tests") orelse false;
94 const skip_run_translated_c = b.option(bool, "skip-run-translated-c", "Main test suite skips run-translated-c tests") orelse false;95 const skip_run_translated_c = b.option(bool, "skip-run-translated-c", "Main test suite skips run-translated-c tests") orelse false;
95 const skip_freebsd = b.option(bool, "skip-freebsd", "Main test suite skips targets with freebsd OS") orelse false;96 const skip_freebsd = b.option(bool, "skip-freebsd", "Main test suite skips targets with freebsd OS") orelse false;
...@@ -418,6 +419,7 @@ pub fn build(b: *std.Build) !void {...@@ -418,6 +419,7 @@ pub fn build(b: *std.Build) !void {
418 try tests.addCases(b, test_cases_step, target, .{419 try tests.addCases(b, test_cases_step, target, .{
419 .test_filters = test_filters,420 .test_filters = test_filters,
420 .test_target_filters = test_target_filters,421 .test_target_filters = test_target_filters,
422 .skip_compile_errors = skip_compile_errors,
421 .skip_non_native = skip_non_native,423 .skip_non_native = skip_non_native,
422 .skip_freebsd = skip_freebsd,424 .skip_freebsd = skip_freebsd,
423 .skip_netbsd = skip_netbsd,425 .skip_netbsd = skip_netbsd,
test/src/Cases.zig+3
...@@ -593,6 +593,7 @@ pub fn lowerToTranslateCSteps(...@@ -593,6 +593,7 @@ pub fn lowerToTranslateCSteps(
593pub const CaseTestOptions = struct {593pub const CaseTestOptions = struct {
594 test_filters: []const []const u8,594 test_filters: []const []const u8,
595 test_target_filters: []const []const u8,595 test_target_filters: []const []const u8,
596 skip_compile_errors: bool,
596 skip_non_native: bool,597 skip_non_native: bool,
597 skip_freebsd: bool,598 skip_freebsd: bool,
598 skip_netbsd: bool,599 skip_netbsd: bool,
...@@ -618,6 +619,8 @@ pub fn lowerToBuildSteps(...@@ -618,6 +619,8 @@ pub fn lowerToBuildSteps(
618 if (std.mem.indexOf(u8, case.name, test_filter)) |_| break;619 if (std.mem.indexOf(u8, case.name, test_filter)) |_| break;
619 } else if (options.test_filters.len > 0) continue;620 } else if (options.test_filters.len > 0) continue;
620621
622 if (case.case.? == .Error and options.skip_compile_errors) continue;
623
621 if (options.skip_non_native and !case.target.query.isNative())624 if (options.skip_non_native and !case.target.query.isNative())
622 continue;625 continue;
623626