From 4b6f66fd512c254b5a82220dc77411fe391dd258 Mon Sep 17 00:00:00 2001 From: David Czihak Date: Sat, 9 May 2026 13:01:50 +0200 Subject: Chore: Rework examples for thorough extension testing --- examples/test-suite/build.zig | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 examples/test-suite/build.zig (limited to 'examples/test-suite/build.zig') diff --git a/examples/test-suite/build.zig b/examples/test-suite/build.zig new file mode 100644 index 0000000..3b723e1 --- /dev/null +++ b/examples/test-suite/build.zig @@ -0,0 +1,41 @@ +const std = @import("std"); + +pub fn build(b: *std.Build) void { + const target = b.standardTargetOptions(.{}); + const optimize = b.standardOptimizeOption(.{}); + + const math_mod = b.addModule("math", .{ + .root_source_file = b.path("src/math.zig"), + .target = target, + }); + + const strings_mod = b.addModule("strings", .{ + .root_source_file = b.path("src/strings.zig"), + .target = target, + }); + + const math_tests = b.addTest(.{ + .root_module = b.createModule(.{ + .root_source_file = b.path("src/math.zig"), + .target = target, + .optimize = optimize, + }), + }); + const strings_tests = b.addTest(.{ + .root_module = b.createModule(.{ + .root_source_file = b.path("src/strings.zig"), + .target = target, + .optimize = optimize, + }), + }); + + _ = math_mod; + _ = strings_mod; + + const run_math = b.addRunArtifact(math_tests); + const run_strings = b.addRunArtifact(strings_tests); + + const test_step = b.step("test", "Run all tests"); + test_step.dependOn(&run_math.step); + test_step.dependOn(&run_strings.step); +} -- cgit v1.3