adding option
All checks were successful
Build / build (push) Successful in 2m9s
Test / build (push) Successful in 5m32s

This commit is contained in:
2026-01-24 21:09:10 +01:00
parent dbf963a3c9
commit 5d296743ee
2 changed files with 23 additions and 18 deletions

View File

@@ -97,22 +97,27 @@ pub fn build(b: *std.Build) void {
// Zig unit tests setup
const nzsl = b.lazyDependency("NZSL", .{ .target = target, .optimize = optimize }) orelse return;
const lib_tests = b.addTest(.{
.root_module = b.createModule(.{
.root_source_file = b.path("test/root.zig"),
.target = target,
.optimize = optimize,
.imports = &.{
.{ .name = "spv", .module = mod },
.{ .name = "nzsl", .module = nzsl.module("nzigsl") },
},
}),
.test_runner = .{ .path = b.path("test/test_runner.zig"), .mode = .simple },
});
const run_tests = b.addRunArtifact(lib_tests);
const test_step = b.step("test", "Run Zig unit tests");
test_step.dependOn(&run_tests.step);
const no_test = b.option(bool, "no-test", "skips unit test dependencies fetch") orelse false;
if (!no_test) {
const nzsl = b.lazyDependency("NZSL", .{ .target = target, .optimize = optimize }) orelse return;
const lib_tests = b.addTest(.{
.root_module = b.createModule(.{
.root_source_file = b.path("test/root.zig"),
.target = target,
.optimize = optimize,
.imports = &.{
.{ .name = "spv", .module = mod },
.{ .name = "nzsl", .module = nzsl.module("nzigsl") },
.{ .name = "zmath", .module = zmath.module("root") },
},
}),
.test_runner = .{ .path = b.path("test/test_runner.zig"), .mode = .simple },
});
const run_tests = b.addRunArtifact(lib_tests);
const test_step = b.step("test", "Run Zig unit tests");
test_step.dependOn(&run_tests.step);
}
// Docs generation

View File

@@ -4,8 +4,8 @@ const spv = @import("spv");
const shader_source = @embedFile("shader.spv");
const screen_width = 480;
const screen_height = 240;
const screen_width = 300;
const screen_height = 300;
pub fn main() !void {
{