add test step to build.zig generated by init-exe (#9919)
* added simple test * Update lib/std/special/init-exe/build.zig Co-authored-by: Andrew Kelley <andrew@ziglang.org>
This commit is contained in:
@@ -24,4 +24,10 @@ pub fn build(b: *std.build.Builder) void {
|
||||
|
||||
const run_step = b.step("run", "Run the app");
|
||||
run_step.dependOn(&run_cmd.step);
|
||||
|
||||
var exe_tests = b.addTest("src/main.zig");
|
||||
exe_tests.setBuildMode(mode);
|
||||
|
||||
const test_step = b.step("test", "Run unit tests");
|
||||
test_step.dependOn(&exe_tests.step);
|
||||
}
|
||||
|
||||
@@ -3,3 +3,7 @@ const std = @import("std");
|
||||
pub fn main() anyerror!void {
|
||||
std.log.info("All your codebase are belong to us.", .{});
|
||||
}
|
||||
|
||||
test "basic test" {
|
||||
try std.testing.expectEqual(10, 3 + 7);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user