diff options
| author | 2019-08-17 18:48:06 +0200 | |
|---|---|---|
| committer | 2019-08-17 18:48:06 +0200 | |
| commit | 3990ea204ce06c470ff9401eb5af8752dce800f0 (patch) | |
| tree | 57d8185833d12730666b350506149d00472ee092 /build.zig | |
| parent | add missing word (diff) | |
| download | zig-clap-3990ea204ce06c470ff9401eb5af8752dce800f0.tar.gz zig-clap-3990ea204ce06c470ff9401eb5af8752dce800f0.tar.xz zig-clap-3990ea204ce06c470ff9401eb5af8752dce800f0.zip | |
make help message look more like other tools
Diffstat (limited to 'build.zig')
| -rw-r--r-- | build.zig | 26 |
1 files changed, 13 insertions, 13 deletions
| @@ -7,6 +7,19 @@ const Builder = std.build.Builder; | |||
| 7 | pub fn build(b: *Builder) void { | 7 | pub 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); |