diff options
Diffstat (limited to 'examples/test-suite/build.zig')
| -rw-r--r-- | examples/test-suite/build.zig | 41 |
1 files changed, 41 insertions, 0 deletions
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); +} |
