commit 181a89e728a89495c00b09b767f579c9591cb08c (tree)
parent a0eec9ce9e2f4ae40729949957bef98a2513fef7
Author: Ali Cheraghi <alichraghi@proton.me>
Date: Fri, 21 Feb 2025 01:09:46 +0330
build: add spirv to test matrix
Signed-off-by: Ali Cheraghi <alichraghi@proton.me>
Diffstat:
2 files changed, 18 insertions(+), 0 deletions(-)
diff --git a/lib/compiler/test_runner.zig b/lib/compiler/test_runner.zig
@@ -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");
}
diff --git a/test/tests.zig b/test/tests.zig
@@ -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;