summaryrefslogtreecommitdiff
path: root/build.zig
diff options
context:
space:
mode:
Diffstat (limited to 'build.zig')
-rw-r--r--build.zig17
1 files changed, 9 insertions, 8 deletions
diff --git a/build.zig b/build.zig
index 30cb80d8..90a7aa9e 100644
--- a/build.zig
+++ b/build.zig
@@ -1533,7 +1533,7 @@ pub fn build(b: *std.Build) void {
// wrong, which the loader must refuse (test/behaviour/addons.zig).
for ([_]struct { []const u8, []const u8 }{
.{ "fake_addon", "-DFAKE_PLAIN" },
- .{ "fake_addon_abi", "-DFAKE_ABI=0x20000" },
+ .{ "fake_addon_abi", "-DFAKE_ABI=0x30000" },
.{ "fake_addon_no_export", "-DFAKE_NO_EXPORT" },
.{ "fake_addon_core_word", "-DFAKE_WORD=\"Save\"" },
.{ "fake_addon_no_dump", "-DFAKE_NO_DUMP" },
@@ -1560,18 +1560,19 @@ pub fn build(b: *std.Build) void {
const behaviour_tests = b.addTest(.{ .root_module = behaviour_module, .filters = test_filters });
const behaviour_test_step = b.step("behaviour-test", "run the behavioural tests, through the 9P tree alone (test/behaviour/)");
_ = units.add(b, behaviour_tests, behaviour_test_step);
- // An addon's own test, the template's: `--addon-test` over the fake
- // and its script, compared with what it printed when written.
- if (fake_addon_lib) |fake_lib| {
+ // An addon's own test: `--addon-test` over the fake (the template)
+ // with its script, compared with what it printed when written.
+ const addon_test_step = b.step("addon-test", "pardes --addon-test over the fake addon, against addons/fake/fake.out");
+ for ([_]struct { *std.Build.Step.Compile, []const u8 }{.{ fake_addon_lib.?, "addons/fake/fake" }}) |t| {
const run_addon_test = b.addRunArtifact(exe);
run_addon_test.addArg("--addon-test");
- run_addon_test.addArtifactArg(fake_lib);
- run_addon_test.addFileArg(b.path("addons/fake/fake.script"));
+ run_addon_test.addArtifactArg(t[0]);
+ run_addon_test.addFileArg(b.path(b.fmt("{s}.script", .{t[1]})));
const compare = b.addSystemCommand(&.{ "diff", "-u" });
- compare.addFileArg(b.path("addons/fake/fake.out"));
+ compare.addFileArg(b.path(b.fmt("{s}.out", .{t[1]})));
compare.addFileArg(run_addon_test.captureStdOut(.{}));
behaviour_test_step.dependOn(&compare.step);
- b.step("addon-test", "pardes --addon-test over the fake addon, against addons/fake/fake.out").dependOn(&compare.step);
+ addon_test_step.dependOn(&compare.step);
}
// The 9P monkey at T1 (test/monkey9p.zig): random requests against
// an in-process session, the documented rules checked after each.