summaryrefslogtreecommitdiff
path: root/build.zig
diff options
context:
space:
mode:
Diffstat (limited to 'build.zig')
-rw-r--r--build.zig26
1 files changed, 13 insertions, 13 deletions
diff --git a/build.zig b/build.zig
index b9ec73a..104e7e3 100644
--- a/build.zig
+++ b/build.zig
@@ -7,6 +7,19 @@ const Builder = std.build.Builder;
7pub fn build(b: *Builder) void { 7pub fn build(b: *Builder) void {
8 const mode = b.standardReleaseOptions(); 8 const mode = b.standardReleaseOptions();
9 9
10 const test_all_step = b.step("test", "Run all tests in all modes.");
11 inline for ([_]Mode{ Mode.Debug, Mode.ReleaseFast, Mode.ReleaseSafe, Mode.ReleaseSmall }) |test_mode| {
12 const mode_str = comptime modeToString(test_mode);
13
14 const tests = b.addTest("clap.zig");
15 tests.setBuildMode(test_mode);
16 tests.setNamePrefix(mode_str ++ " ");
17
18 const test_step = b.step("test-" ++ mode_str, "Run all tests in " ++ mode_str ++ ".");
19 test_step.dependOn(&tests.step);
20 test_all_step.dependOn(test_step);
21 }
22
10 const example_step = b.step("examples", "Build examples"); 23 const example_step = b.step("examples", "Build examples");
11 inline for ([_][]const u8{ 24 inline for ([_][]const u8{
12 "comptime-clap", 25 "comptime-clap",
@@ -21,19 +34,6 @@ pub fn build(b: *Builder) void {
21 example_step.dependOn(&example.step); 34 example_step.dependOn(&example.step);
22 } 35 }
23 36
24 const test_all_step = b.step("test", "Run all tests in all modes.");
25 inline for ([_]Mode{ Mode.Debug, Mode.ReleaseFast, Mode.ReleaseSafe, Mode.ReleaseSmall }) |test_mode| {
26 const mode_str = comptime modeToString(test_mode);
27
28 const tests = b.addTest("clap.zig");
29 tests.setBuildMode(test_mode);
30 tests.setNamePrefix(mode_str ++ " ");
31
32 const test_step = b.step("test-" ++ mode_str, "Run all tests in " ++ mode_str ++ ".");
33 test_step.dependOn(&tests.step);
34 test_all_step.dependOn(test_step);
35 }
36
37 const readme_step = b.step("test", "Remake README."); 37 const readme_step = b.step("test", "Remake README.");
38 const readme = readMeStep(b); 38 const readme = readMeStep(b);
39 readme.dependOn(example_step); 39 readme.dependOn(example_step);