From bad7ce0d2511b1625e9f30f5d3a3308e8948d524 Mon Sep 17 00:00:00 2001 From: David Allemang Date: Thu, 21 Nov 2024 11:42:44 -0500 Subject: [PATCH] separate step for installing "dev" tools allows building and debugging test runner. --- build.zig | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/build.zig b/build.zig index 9ab99d6..ee624d3 100644 --- a/build.zig +++ b/build.zig @@ -73,7 +73,13 @@ pub fn build(b: *std.Build) void { }); 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(.{ // .root_source_file = b.path("src/main.zig"), @@ -88,7 +94,7 @@ pub fn build(b: *std.Build) void { // exe_unit_tests.linkLibC(); // 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_nu_unit_tests.step); + // test_step.dependOn(&run_nu_unit_tests.step); }