separate step for installing "dev" tools

allows building and debugging test runner.
This commit is contained in:
2024-11-21 11:42:44 -05:00
parent 03662d8063
commit bad7ce0d25

View File

@@ -73,7 +73,13 @@ pub fn build(b: *std.Build) void {
}); });
nu_unit_tests.linkLibC(); nu_unit_tests.linkLibC();
const run_nu_unit_tests = b.addRunArtifact(nu_unit_tests); const nu_test_runner = b.addInstallArtifact(nu_unit_tests, .{
.dest_dir = .{ .override = .{ .custom = "dev" } },
.dest_sub_path = "nu_test_runner",
});
const devel_step = b.step("dev", "Build development tools and test runners");
devel_step.dependOn(&nu_test_runner.step);
// const exe_unit_tests = b.addTest(.{ // const exe_unit_tests = b.addTest(.{
// .root_source_file = b.path("src/main.zig"), // .root_source_file = b.path("src/main.zig"),
@@ -88,7 +94,7 @@ pub fn build(b: *std.Build) void {
// exe_unit_tests.linkLibC(); // exe_unit_tests.linkLibC();
// const run_exe_unit_tests = b.addRunArtifact(exe_unit_tests); // const run_exe_unit_tests = b.addRunArtifact(exe_unit_tests);
const test_step = b.step("test", "Run unit tests"); // const test_step = b.step("test", "Run unit tests");
// test_step.dependOn(&run_exe_unit_tests.step); // test_step.dependOn(&run_exe_unit_tests.step);
test_step.dependOn(&run_nu_unit_tests.step); // test_step.dependOn(&run_nu_unit_tests.step);
} }