Skip to content

Commit 0b06eef

Browse files
McSinyxikskuh
authored andcommitted
Run the tests
1 parent e18d366 commit 0b06eef

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

build.zig

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,20 +50,19 @@ pub fn build(b: *std.Build) void {
5050

5151
b.installArtifact(example_zig);
5252

53-
var main_tests = b.addTest(.{
53+
const test_step = b.step("test", "Run library tests");
54+
const main_tests = b.addTest(.{
5455
.root_source_file = b.path("src/test.zig"),
5556
.optimize = optimize,
5657
});
58+
test_step.dependOn(&b.addRunArtifact(main_tests).step);
5759

58-
var binding_tests = b.addTest(.{
60+
const binding_tests = b.addTest(.{
5961
.root_source_file = b.path("src/lib-test.zig"),
6062
.optimize = optimize,
6163
});
6264
binding_tests.addIncludePath(b.path("src"));
6365
binding_tests.linkLibrary(lib);
6466
binding_tests.linkLibC();
65-
66-
const test_step = b.step("test", "Run library tests");
67-
test_step.dependOn(&main_tests.step);
68-
test_step.dependOn(&binding_tests.step);
67+
test_step.dependOn(&b.addRunArtifact(binding_tests).step);
6968
}

0 commit comments

Comments
 (0)