Add tests

This commit is contained in:
vlo
2026-11-22 20:13:40 +01:00
parent 7ef531e720
commit 3f17c820e8
2 changed files with 40 additions and 2 deletions
+15 -2
View File
@@ -14,7 +14,7 @@ pub fn build(b: *std.Build) void {
translate_c.linkSystemLibrary("XFixes", .{});
translate_c.linkSystemLibrary("Xext", .{});
const window = b.addModule("root", .{
const zwindow = b.addModule("root", .{
.root_source_file = b.path("src/Window.zig"),
.target = target,
.optimize = optimize,
@@ -27,5 +27,18 @@ pub fn build(b: *std.Build) void {
.link_libc = false,
});
_ = window;
const test_step = b.step("test", "Run tests");
const tests = b.addTest(.{
.name = "ZWindow-tests",
.root_module = b.createModule(.{
.root_source_file = b.path("src/tests.zig"),
.target = target,
.optimize = optimize,
}),
});
tests.root_module.addImport("ZWindow", zwindow);
test_step.dependOn(&b.addRunArtifact(tests).step);
b.installArtifact(tests);
}