zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit 00dc4d000f03d763e0e49b05ff29534c82d21b69 (tree)
parent 25e348973a5f9df9218d25502e31ecec9341241e
Author: Alex Rønne Petersen <alex@alexrp.com>
Date:   Mon,  1 Dec 2025 07:43:31 +0100

test: add openbsd targets to module test matrix

Diffstat:
Mbuild.zig | 7+++++++
Mtest/src/Cases.zig | 2++
Mtest/tests.zig | 87+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 96 insertions(+), 0 deletions(-)

diff --git a/build.zig b/build.zig @@ -97,6 +97,7 @@ pub fn build(b: *std.Build) !void { const skip_wasm = b.option(bool, "skip-wasm", "Main test suite skips targets with wasm32/wasm64 architecture") orelse false; const skip_freebsd = b.option(bool, "skip-freebsd", "Main test suite skips targets with freebsd OS") orelse false; const skip_netbsd = b.option(bool, "skip-netbsd", "Main test suite skips targets with netbsd OS") orelse false; + const skip_openbsd = b.option(bool, "skip-openbsd", "Main test suite skips targets with openbsd OS") orelse false; const skip_windows = b.option(bool, "skip-windows", "Main test suite skips targets with windows OS") orelse false; const skip_darwin = b.option(bool, "skip-darwin", "Main test suite skips targets with darwin OSs") orelse false; const skip_linux = b.option(bool, "skip-linux", "Main test suite skips targets with linux OS") orelse false; @@ -431,6 +432,7 @@ pub fn build(b: *std.Build) !void { .skip_wasm = skip_wasm, .skip_freebsd = skip_freebsd, .skip_netbsd = skip_netbsd, + .skip_openbsd = skip_openbsd, .skip_windows = skip_windows, .skip_darwin = skip_darwin, .skip_linux = skip_linux, @@ -464,6 +466,7 @@ pub fn build(b: *std.Build) !void { .skip_wasm = skip_wasm, .skip_freebsd = skip_freebsd, .skip_netbsd = skip_netbsd, + .skip_openbsd = skip_openbsd, .skip_windows = skip_windows, .skip_darwin = skip_darwin, .skip_linux = skip_linux, @@ -508,6 +511,7 @@ pub fn build(b: *std.Build) !void { .skip_wasm = skip_wasm, .skip_freebsd = skip_freebsd, .skip_netbsd = skip_netbsd, + .skip_openbsd = skip_openbsd, .skip_windows = skip_windows, .skip_darwin = skip_darwin, .skip_linux = skip_linux, @@ -552,6 +556,7 @@ pub fn build(b: *std.Build) !void { .skip_wasm = skip_wasm, .skip_freebsd = skip_freebsd, .skip_netbsd = skip_netbsd, + .skip_openbsd = skip_openbsd, .skip_windows = skip_windows, .skip_darwin = skip_darwin, .skip_linux = skip_linux, @@ -577,6 +582,7 @@ pub fn build(b: *std.Build) !void { .skip_wasm = skip_wasm, .skip_freebsd = skip_freebsd, .skip_netbsd = skip_netbsd, + .skip_openbsd = skip_openbsd, .skip_windows = skip_windows, .skip_darwin = skip_darwin, .skip_linux = skip_linux, @@ -642,6 +648,7 @@ pub fn build(b: *std.Build) !void { .skip_wasm = skip_wasm, .skip_freebsd = skip_freebsd, .skip_netbsd = skip_netbsd, + .skip_openbsd = skip_openbsd, .skip_windows = skip_windows, .skip_darwin = skip_darwin, .skip_linux = skip_linux, diff --git a/test/src/Cases.zig b/test/src/Cases.zig @@ -455,6 +455,7 @@ pub const CaseTestOptions = struct { skip_wasm: bool, skip_freebsd: bool, skip_netbsd: bool, + skip_openbsd: bool, skip_windows: bool, skip_darwin: bool, skip_linux: bool, @@ -487,6 +488,7 @@ pub fn lowerToBuildSteps( if (options.skip_freebsd and case.target.query.os_tag == .freebsd) continue; if (options.skip_netbsd and case.target.query.os_tag == .netbsd) continue; + if (options.skip_openbsd and case.target.query.os_tag == .openbsd) continue; if (options.skip_windows and case.target.query.os_tag == .windows) continue; if (options.skip_darwin and case.target.query.os_tag != null and case.target.query.os_tag.?.isDarwin()) continue; if (options.skip_linux and case.target.query.os_tag == .linux) continue; diff --git a/test/tests.zig b/test/tests.zig @@ -1366,6 +1366,89 @@ const test_targets = blk: { .link_libc = true, }, + // OpenBSD Targets + + .{ + .target = .{ + .cpu_arch = .aarch64, + .os_tag = .openbsd, + .abi = .none, + }, + .link_libc = true, + }, + + .{ + .target = .{ + .cpu_arch = .arm, + .os_tag = .openbsd, + .abi = .eabi, + }, + .link_libc = true, + }, + + .{ + .target = .{ + .cpu_arch = .mips64, + .os_tag = .openbsd, + .abi = .none, + }, + .link_libc = true, + }, + + .{ + .target = .{ + .cpu_arch = .mips64el, + .os_tag = .openbsd, + .abi = .none, + }, + .link_libc = true, + }, + + .{ + .target = .{ + .cpu_arch = .powerpc, + .os_tag = .openbsd, + .abi = .eabihf, + }, + .link_libc = true, + }, + + .{ + .target = .{ + .cpu_arch = .powerpc64, + .os_tag = .openbsd, + .abi = .none, + }, + .link_libc = true, + }, + + .{ + .target = .{ + .cpu_arch = .riscv64, + .os_tag = .openbsd, + .abi = .none, + }, + .link_libc = true, + }, + + .{ + .target = .{ + .cpu_arch = .x86, + .os_tag = .openbsd, + .abi = .none, + }, + .link_libc = true, + }, + + .{ + .target = .{ + .cpu_arch = .x86_64, + .os_tag = .openbsd, + .abi = .none, + }, + .link_libc = true, + }, + // SPIR-V Targets // Disabled due to no active maintainer (feel free to fix the failures @@ -2233,6 +2316,7 @@ const ModuleTestOptions = struct { skip_wasm: bool, skip_freebsd: bool, skip_netbsd: bool, + skip_openbsd: bool, skip_windows: bool, skip_darwin: bool, skip_linux: bool, @@ -2271,6 +2355,7 @@ pub fn addModuleTests(b: *std.Build, options: ModuleTestOptions) *Step { if (options.skip_freebsd and test_target.target.os_tag == .freebsd) continue; if (options.skip_netbsd and test_target.target.os_tag == .netbsd) continue; + if (options.skip_openbsd and test_target.target.os_tag == .openbsd) continue; if (options.skip_windows and test_target.target.os_tag == .windows) continue; if (options.skip_darwin and test_target.target.os_tag != null and test_target.target.os_tag.?.isDarwin()) continue; if (options.skip_linux and test_target.target.os_tag == .linux) continue; @@ -2513,6 +2598,7 @@ const CAbiTestOptions = struct { skip_wasm: bool, skip_freebsd: bool, skip_netbsd: bool, + skip_openbsd: bool, skip_windows: bool, skip_darwin: bool, skip_linux: bool, @@ -2536,6 +2622,7 @@ pub fn addCAbiTests(b: *std.Build, options: CAbiTestOptions) *Step { if (options.skip_freebsd and c_abi_target.target.os_tag == .freebsd) continue; if (options.skip_netbsd and c_abi_target.target.os_tag == .netbsd) continue; + if (options.skip_openbsd and c_abi_target.target.os_tag == .openbsd) continue; if (options.skip_windows and c_abi_target.target.os_tag == .windows) continue; if (options.skip_darwin and c_abi_target.target.os_tag != null and c_abi_target.target.os_tag.?.isDarwin()) continue; if (options.skip_linux and c_abi_target.target.os_tag == .linux) continue;