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.
This commit is contained in:
Manlio Perillo 2023-05-05 16:13:57 +02:00
parent d8fab5153d
commit f14f4e95a4
2 changed files with 89 additions and 39 deletions

View file

@ -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.
//