From 0cd86d2f9b8a372c7c8ab2a253e3643cc2ab6212 Mon Sep 17 00:00:00 2001 From: Manlio Perillo Date: Fri, 5 May 2023 16:13:57 +0200 Subject: build: add the healed-path option This is necessary in the unit tests, to ensure each test case use a different exercises directory. Update test/tests.zig to use the new healed-path option, ensuring that each temp directory is removed. In test case 3, 4 and 5, move case_step as the first step in the dependency chain. This will improve the build summary tree. In test case 5, remove the dependency to heal_step, since it is not necessary. --- build.zig | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'build.zig') diff --git a/build.zig b/build.zig index 64968b9..a880450 100644 --- a/build.zig +++ b/build.zig @@ -118,11 +118,12 @@ pub fn build(b: *Build) !void { \\ ; - const use_healed = b.option(bool, "healed", "Run exercises from patches/healed") orelse false; + const healed = b.option(bool, "healed", "Run exercises from patches/healed") orelse false; + const override_healed_path = b.option([]const u8, "healed-path", "Override healed path"); const exno: ?usize = b.option(usize, "n", "Select exercise"); - const healed_path = "patches/healed"; - const work_path = if (use_healed) healed_path else "exercises"; + const healed_path = if (override_healed_path) |path| path else "patches/healed"; + const work_path = if (healed) healed_path else "exercises"; const header_step = PrintStep.create(b, logo); @@ -168,7 +169,7 @@ pub fn build(b: *Build) !void { start_step.dependOn(&prev_step.step); return; - } else if (use_healed and false) { + } else if (healed and false) { // Special case when healed by the eowyn script, where we can make the // code more efficient. // -- cgit v1.2.3