build test: install unit tests binary
I've gotten tired of trying to find this in the cache dir, since the build system does not rerun it once it is cached. Also sometimes the build runner does weird things to the output.
This commit is contained in:
parent
dc97e44c9e
commit
3ec8ab1b9c
@ -19,6 +19,7 @@ pub fn build(b: *std.Build) void {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const tests = b.addTest(.{
|
const tests = b.addTest(.{
|
||||||
|
.name = "nats-zig-unit-tests",
|
||||||
.root_source_file = .{ .path = "tests/main.zig" },
|
.root_source_file = .{ .path = "tests/main.zig" },
|
||||||
.target = target,
|
.target = target,
|
||||||
.optimize = optimize,
|
.optimize = optimize,
|
||||||
@ -29,6 +30,7 @@ pub fn build(b: *std.Build) void {
|
|||||||
|
|
||||||
const run_main_tests = b.addRunArtifact(tests);
|
const run_main_tests = b.addRunArtifact(tests);
|
||||||
const test_step = b.step("test", "Run tests");
|
const test_step = b.step("test", "Run tests");
|
||||||
|
test_step.dependOn(&b.addInstallArtifact(tests, .{}).step);
|
||||||
test_step.dependOn(&run_main_tests.step);
|
test_step.dependOn(&run_main_tests.step);
|
||||||
|
|
||||||
add_examples(b, .{
|
add_examples(b, .{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user