Add tests
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user