| author | |
| committer | |
| log | 1f19d4d7063527c03de16ca32e314c71df2cf1e8 |
| tree | 032e04023ae730664fb1d7df7b93fd20d49aff8d |
| parent | c16f7a7edabad11b623416805126af8ffeda0c06 |
2 files changed, 23 insertions(+), 0 deletions(-)
build.zig+12| ... | ... | @@ -22,4 +22,16 @@ pub fn build(b: *std.Build) void { |
| 22 | 22 | |
| 23 | 23 | const run_step = b.step("run", "Run the app"); |
| 24 | 24 | run_step.dependOn(&run_cmd.step); |
| 25 | ||
| 26 | const tests = b.addTest(.{ | |
| 27 | .root_source_file = b.path("test.zig"), | |
| 28 | .target = target, | |
| 29 | .optimize = mode, | |
| 30 | }); | |
| 31 | deps.addAllTo(tests); | |
| 32 | ||
| 33 | const test_step = b.step("test", "Run all library tests"); | |
| 34 | const tests_run = b.addRunArtifact(tests); | |
| 35 | tests_run.has_side_effects = true; | |
| 36 | test_step.dependOn(&tests_run.step); | |
| 25 | 37 | } |
test.zig created+11| ... | ... | @@ -0,0 +1,11 @@ |
| 1 | const std = @import("std"); | |
| 2 | const inquirer = @import("inquirer"); | |
| 3 | ||
| 4 | test { | |
| 5 | // ensure these have no compile errors | |
| 6 | // but don't write anything to stdout/stderr | |
| 7 | _ = &inquirer.answer; | |
| 8 | _ = &inquirer.forEnum; | |
| 9 | _ = &inquirer.forString; | |
| 10 | _ = &inquirer.forConfirm; | |
| 11 | } |