diff options
Diffstat (limited to 'build.zig')
| -rw-r--r-- | build.zig | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -1561,9 +1561,13 @@ pub fn build(b: *std.Build) void { 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: `--addon-test` over the fake (the template) + // and the snake (a shipped example, built but not installed), each // 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 addon_test_step = b.step("addon-test", "pardes --addon-test over the fake and snake addons, against addons/*/*.out"); + const snake_lib = b.addLibrary(.{ .name = "snake", .linkage = .dynamic, .root_module = b.createModule(.{ .target = target, .optimize = optimize, .link_libc = true }) }); + snake_lib.root_module.addIncludePath(b.path("src/kinds")); + snake_lib.root_module.addCSourceFile(.{ .file = b.path("addons/snake/snake.c"), .flags = &.{ "-std=c11", "-Wall", "-Wextra", "-Werror" } }); + for ([_]struct { *std.Build.Step.Compile, []const u8 }{ .{ fake_addon_lib.?, "addons/fake/fake" }, .{ snake_lib, "addons/snake/snake" } }) |t| { const run_addon_test = b.addRunArtifact(exe); run_addon_test.addArg("--addon-test"); run_addon_test.addArtifactArg(t[0]); |
