adding proper unit testing
Some checks failed
Build / build (push) Successful in 1m26s
Test / build (push) Failing after 5m16s

This commit is contained in:
2026-01-13 00:06:49 +01:00
parent 14e802709c
commit dacd67b858
6 changed files with 198 additions and 32 deletions

View File

@@ -46,7 +46,17 @@ pub fn build(b: *std.Build) void {
// Zig unit tests setup
const lib_tests = b.addTest(.{ .root_module = mod });
const nzsl = b.lazyDependency("NZSL", .{}) orelse return;
const test_mod = 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") },
},
});
const lib_tests = b.addTest(.{ .root_module = test_mod });
const run_tests = b.addRunArtifact(lib_tests);
const test_step = b.step("test", "Run Zig unit tests");
test_step.dependOn(&run_tests.step);