authorgravatar for alichraghi@proton.meAli Chraghi <alichraghi@proton.me> 2025-02-21 01:09:46+03:30
committergravatar for robin@voetter.nlRobin Voetter <robin@voetter.nl> 2025-02-24 19:12:38+01:00
log181a89e728a89495c00b09b767f579c9591cb08c
tree08f7ecc2c8917aab2dc221e3589dfd5a1da11a91
parenta0eec9ce9e2f4ae40729949957bef98a2513fef7
signaturebadge-check Signed by SSH key SHA256:ZS52FNyUv2WUXvO4njmVaFVO46RHojFuOrxRc4LuKzg

build: add spirv to test matrix

Signed-off-by: Ali Cheraghi <alichraghi@proton.me>

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

lib/compiler/test_runner.zig+5
...@@ -22,6 +22,11 @@ const crippled = switch (builtin.zig_backend) {...@@ -22,6 +22,11 @@ const crippled = switch (builtin.zig_backend) {
22pub fn main() void {22pub fn main() void {
23 @disableInstrumentation();23 @disableInstrumentation();
2424
25 if (builtin.cpu.arch.isSpirV()) {
26 // SPIR-V needs an special test-runner
27 return;
28 }
29
25 if (crippled) {30 if (crippled) {
26 return mainSimple() catch @panic("test failure\n");31 return mainSimple() catch @panic("test failure\n");
27 }32 }
test/tests.zig+13
...@@ -140,6 +140,15 @@ const test_targets = blk: {...@@ -140,6 +140,15 @@ const test_targets = blk: {
140 .use_llvm = false,140 .use_llvm = false,
141 .use_lld = false,141 .use_lld = false,
142 },142 },
143 .{
144 .target = std.Target.Query.parse(.{
145 .arch_os_abi = "spirv64-vulkan",
146 .cpu_features = "vulkan_v1_2+int8+int16+int64+float16+float64",
147 }) catch unreachable,
148 .use_llvm = false,
149 .use_lld = false,
150 .skip_modules = &.{ "c-import", "universal-libc", "std" },
151 },
143 // https://github.com/ziglang/zig/issues/13623152 // https://github.com/ziglang/zig/issues/13623
144 //.{153 //.{
145 // .target = .{154 // .target = .{
...@@ -1583,6 +1592,10 @@ pub fn addModuleTests(b: *std.Build, options: ModuleTestOptions) *Step {...@@ -1583,6 +1592,10 @@ pub fn addModuleTests(b: *std.Build, options: ModuleTestOptions) *Step {
1583 run.setName(b.fmt("run test {s}", .{qualified_name}));1592 run.setName(b.fmt("run test {s}", .{qualified_name}));
15841593
1585 step.dependOn(&run.step);1594 step.dependOn(&run.step);
1595 } else if (target.cpu.arch.isSpirV()) {
1596 // Don't run spirv binaries
1597 _ = these_tests.getEmittedBin();
1598 step.dependOn(&these_tests.step);
1586 } else {1599 } else {
1587 const run = b.addRunArtifact(these_tests);1600 const run = b.addRunArtifact(these_tests);
1588 run.skip_foreign_checks = true;1601 run.skip_foreign_checks = true;