From 82235aeb6c798971cfd3643f941ecbba60e69966 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20R=C3=B8nne=20Petersen?= Date: Mon, 1 Dec 2025 07:43:31 +0100 Subject: [PATCH] test: add openbsd targets to module test matrix --- build.zig | 7 ++++ test/src/Cases.zig | 2 ++ test/tests.zig | 87 ++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 96 insertions(+) diff --git a/build.zig b/build.zig index 114428bcba..db96ac4c06 100644 --- a/build.zig +++ b/build.zig @@ -95,6 +95,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; @@ -427,6 +428,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, @@ -460,6 +462,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, @@ -506,6 +509,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, @@ -553,6 +557,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, @@ -600,6 +605,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, @@ -686,6 +692,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 index f39820c7b6..d75c81b596 100644 --- a/test/src/Cases.zig +++ b/test/src/Cases.zig @@ -448,6 +448,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, @@ -479,6 +480,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 index 306602d587..5195d34afe 100644 --- a/test/tests.zig +++ b/test/tests.zig @@ -1364,6 +1364,89 @@ const test_targets = blk: { .link_libc = true, }, + // NetBSD 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 @@ -2250,6 +2333,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, @@ -2288,6 +2372,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; @@ -2530,6 +2615,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, @@ -2553,6 +2639,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;