Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,16 @@ pub fn build(b: *std.Build) void {
b.step("unit", "Run the unit tests").dependOn(&b.addRunArtifact(unit).step);

// The shell suite of the old implementation, run against this binary.
// It and the differential run below run in the build root: their script
// paths are relative, and zig build may be started in a subdirectory.
const suite = b.addSystemCommand(&.{ "bash", "-c", "TOOL_BIN=\"$0\" exec bash tests/test_eb_keep_logs.sh" });
suite.addArtifactArg(exe);
suite.setCwd(b.path("."));
suite.expectExitCode(0);
// The same invocations through the shell implementation and this one.
const diff = b.addSystemCommand(&.{ "bash", "-c", "TOOL_BIN=\"$0\" exec bash tests/differential.sh" });
diff.addArtifactArg(exe);
diff.setCwd(b.path("."));
diff.expectExitCode(0);

const test_step = b.step("test", "Run the unit tests, the command-line suite and the differential run");
Expand Down
1 change: 1 addition & 0 deletions changelog.d/+suite-cwd.misc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
`zig build test` passes when started in a subdirectory such as `src/`: the command-line suite and the differential run start their scripts from the build root instead of from where `zig build` was started, where bash stopped with `tests/test_eb_keep_logs.sh: No such file or directory`.
Loading