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:
torque 2023-08-27 18:05:33 -07:00
parent dc97e44c9e
commit 3ec8ab1b9c
Signed by: torque
SSH Key Fingerprint: SHA256:nCrXefBNo6EbjNSQhv0nXmEg/VuNq3sMF5b8zETw3Tk

View File

@ -19,6 +19,7 @@ pub fn build(b: *std.Build) void {
});
const tests = b.addTest(.{
.name = "nats-zig-unit-tests",
.root_source_file = .{ .path = "tests/main.zig" },
.target = target,
.optimize = optimize,
@ -29,6 +30,7 @@ pub fn build(b: *std.Build) void {
const run_main_tests = b.addRunArtifact(tests);
const test_step = b.step("test", "Run tests");
test_step.dependOn(&b.addInstallArtifact(tests, .{}).step);
test_step.dependOn(&run_main_tests.step);
add_examples(b, .{