diff options
author | Manlio Perillo <manlio.perillo@gmail.com> | 2023-05-05 16:13:57 +0200 |
---|---|---|
committer | Manlio Perillo <manlio.perillo@gmail.com> | 2023-05-05 16:22:50 +0200 |
commit | 0cd86d2f9b8a372c7c8ab2a253e3643cc2ab6212 (patch) | |
tree | 720d080b64fa2398b53a79a787d181c33c7fe1ed /build.zig | |
parent | eda73b2fa8dcb5ca4fc96903f8d1f46ac464acab (diff) |
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.
Diffstat (limited to 'build.zig')
-rw-r--r-- | build.zig | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -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. // |