Skip to content

Commit 700c3c0

Browse files
committed
Update test step
The `.test` `CompileStep` kind now compiles the test runner rather than executing it. To run it instead, it first needs to be added as a run artifact through `b.addRunArtifact`, the result of which is used as a dependency for the top level `test` step.
1 parent 9b5de4d commit 700c3c0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

build.zig

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@ pub fn build(b: *std.Build) void {
55
.root_source_file = .{ .path = "src/main.zig" },
66
.optimize = b.standardOptimizeOption(.{}),
77
});
8+
const run_tests = b.addRunArtifact(lib_tests);
89

910
const tests = b.step("test", "Run all library tests");
10-
tests.dependOn(&lib_tests.step);
11+
tests.dependOn(&run_tests.step);
1112

1213
const docs = b.option(bool, "emit_docs", "Build library documentation") orelse false;
1314

0 commit comments

Comments
 (0)