add 'zig build test' command
This commit is contained in:
parent
96c6f8bc0c
commit
2a1b48fe86
1 changed files with 7 additions and 0 deletions
|
@ -18,6 +18,10 @@ pub fn build(b: *std.build.Builder) void {
|
|||
deps.addAllTo(exe);
|
||||
exe.install();
|
||||
|
||||
const exe_test = b.addTest("src/main.zig");
|
||||
exe_test.setTarget(target);
|
||||
deps.addAllTo(exe_test);
|
||||
|
||||
const run_cmd = exe.run();
|
||||
run_cmd.step.dependOn(b.getInstallStep());
|
||||
if (b.args) |args| {
|
||||
|
@ -26,4 +30,7 @@ pub fn build(b: *std.build.Builder) void {
|
|||
|
||||
const run_step = b.step("run", "Run the app");
|
||||
run_step.dependOn(&run_cmd.step);
|
||||
|
||||
const test_step = b.step("test", "Test stuff");
|
||||
test_step.dependOn(&exe_test.step);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue