build: install test executables

This makes cross compiled testing a little easier for now.
This commit is contained in:
CJ van den Berg 2026-02-26 14:47:07 +01:00
parent 8af70c05b6
commit 20c167b37d
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9

View file

@ -56,11 +56,13 @@ pub fn build(b: *std.Build) void {
run_cmd.addArgs(args);
const mod_tests = b.addTest(.{
.name = "mod_tests",
.root_module = mod,
});
const run_mod_tests = b.addRunArtifact(mod_tests);
const exe_tests = b.addTest(.{
.name = "exe_tests",
.root_module = b.createModule(.{
.root_source_file = b.path("src/main.zig"),
.target = target,
@ -76,6 +78,7 @@ pub fn build(b: *std.Build) void {
// Integration test suite: exercises the public API by performing real
// filesystem operations and verifying Handler callbacks via TestHandler.
const integration_tests = b.addTest(.{
.name = "integration_tests",
.root_module = b.createModule(.{
.root_source_file = b.path("src/nightwatch_test.zig"),
.target = target,
@ -91,4 +94,8 @@ pub fn build(b: *std.Build) void {
test_step.dependOn(&run_mod_tests.step);
test_step.dependOn(&run_exe_tests.step);
test_step.dependOn(&run_integration_tests.step);
b.installArtifact(mod_tests);
b.installArtifact(exe_tests);
b.installArtifact(integration_tests);
}