| ... | @@ -22,4 +22,16 @@ pub fn build(b: *std.Build) void { | ... | @@ -22,4 +22,16 @@ pub fn build(b: *std.Build) void { |
| 22 | | 22 | |
| 23 | const run_step = b.step("run", "Run the app"); | 23 | const run_step = b.step("run", "Run the app"); |
| 24 | run_step.dependOn(&run_cmd.step); | 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 | } |