From 333cdea69956adda91f462980a18f5bac6548dda Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Fri, 6 Nov 2026 14:27:06 -0300 Subject: kinds #27, life: addons/life/life.zig is a second shipped Zig addon, Conway's Life in a pane written clean-room against src/kinds/addon.zig and the header alone (steps ten generations a second while focused, space pauses, r reseeds, hjkl and x edit, the prefix the generation and alive count, the body the board, dump and load the board), with its script and golden under addon-test and its own zig tests; the module's timing test and the dogfood that found Kind.step's stale tick clock Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge --- build.zig | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'build.zig') diff --git a/build.zig b/build.zig index 86297c62..4808d8e8 100644 --- a/build.zig +++ b/build.zig @@ -1621,10 +1621,12 @@ pub fn build(b: *std.Build) void { const addon_test_step = b.step("addon-test", "pardes --addon-test over the fake, snake and pdf addons, against addons/*/*.out, and the Zig addons' own tests"); const snake_mod = b.createModule(.{ .root_source_file = b.path("addons/snake/snake.zig"), .target = target, .optimize = optimize, .imports = &.{.{ .name = "addon", .module = addon_mod }} }); const snake_lib = b.addLibrary(.{ .name = "snake", .linkage = .dynamic, .root_module = snake_mod }); - for ([_]*std.Build.Module{ snake_mod, image_mod }) |m| addon_test_step.dependOn(&b.addRunArtifact(b.addTest(.{ .root_module = m })).step); + const life_mod = b.createModule(.{ .root_source_file = b.path("addons/life/life.zig"), .target = target, .optimize = optimize, .imports = &.{.{ .name = "addon", .module = addon_mod }} }); + const life_lib = b.addLibrary(.{ .name = "life", .linkage = .dynamic, .root_module = life_mod }); + for ([_]*std.Build.Module{ snake_mod, life_mod, image_mod }) |m| addon_test_step.dependOn(&b.addRunArtifact(b.addTest(.{ .root_module = m })).step); // ...and the pdf addon's, which mupdf-check runs too (its script // opens docs/design.pdf, from the build root). - const libs = [_]struct { ?*std.Build.Step.Compile, []const u8 }{ .{ fake_addon_lib.?, "addons/fake/fake" }, .{ snake_lib, "addons/snake/snake" }, .{ pdf_addon, "addons/pdf/pdf" } }; + const libs = [_]struct { ?*std.Build.Step.Compile, []const u8 }{ .{ fake_addon_lib.?, "addons/fake/fake" }, .{ snake_lib, "addons/snake/snake" }, .{ life_lib, "addons/life/life" }, .{ pdf_addon, "addons/pdf/pdf" } }; for (libs) |t| if (t[0]) |lib| { const run_addon_test = b.addRunArtifact(exe); run_addon_test.setCwd(b.path(".")); -- cgit v1.3