build: add spirv to test matrix

Signed-off-by: Ali Cheraghi <alichraghi@proton.me>
This commit is contained in:
Ali Cheraghi 2025-02-21 01:09:46 +03:30 committed by Robin Voetter
parent a0eec9ce9e
commit 181a89e728
No known key found for this signature in database
2 changed files with 18 additions and 0 deletions

View File

@ -22,6 +22,11 @@ const crippled = switch (builtin.zig_backend) {
pub fn main() void {
@disableInstrumentation();
if (builtin.cpu.arch.isSpirV()) {
// SPIR-V needs an special test-runner
return;
}
if (crippled) {
return mainSimple() catch @panic("test failure\n");
}

View File

@ -140,6 +140,15 @@ const test_targets = blk: {
.use_llvm = false,
.use_lld = false,
},
.{
.target = std.Target.Query.parse(.{
.arch_os_abi = "spirv64-vulkan",
.cpu_features = "vulkan_v1_2+int8+int16+int64+float16+float64",
}) catch unreachable,
.use_llvm = false,
.use_lld = false,
.skip_modules = &.{ "c-import", "universal-libc", "std" },
},
// https://github.com/ziglang/zig/issues/13623
//.{
// .target = .{
@ -1583,6 +1592,10 @@ pub fn addModuleTests(b: *std.Build, options: ModuleTestOptions) *Step {
run.setName(b.fmt("run test {s}", .{qualified_name}));
step.dependOn(&run.step);
} else if (target.cpu.arch.isSpirV()) {
// Don't run spirv binaries
_ = these_tests.getEmittedBin();
step.dependOn(&these_tests.step);
} else {
const run = b.addRunArtifact(these_tests);
run.skip_foreign_checks = true;