authorgravatar for leecannon@leecannon.xyzLee Cannon <leecannon@leecannon.xyz> 2021-10-09 08:17:49+01:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2021-10-09 00:17:49-07:00
log8e1aa72c69cddc9fcd0bd8a3f9f4e9d3a8d002af
tree0461446d143ff1b67c7431f8d4d66965ca13e07c
parent526191bfafe722700323df30647eed0c03fc2403
signaturebadge-question-mark Signed by PGP key 4AEE18F83AFDEB23

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>

2 files changed, 10 insertions(+), 0 deletions(-)

lib/std/special/init-exe/build.zig+6
...@@ -24,4 +24,10 @@ pub fn build(b: *std.build.Builder) void {...@@ -24,4 +24,10 @@ pub fn build(b: *std.build.Builder) void {
2424
25 const run_step = b.step("run", "Run the app");25 const run_step = b.step("run", "Run the app");
26 run_step.dependOn(&run_cmd.step);26 run_step.dependOn(&run_cmd.step);
27
28 var exe_tests = b.addTest("src/main.zig");
29 exe_tests.setBuildMode(mode);
30
31 const test_step = b.step("test", "Run unit tests");
32 test_step.dependOn(&exe_tests.step);
27}33}
lib/std/special/init-exe/src/main.zig+4
...@@ -3,3 +3,7 @@ const std = @import("std");...@@ -3,3 +3,7 @@ const std = @import("std");
3pub fn main() anyerror!void {3pub fn main() anyerror!void {
4 std.log.info("All your codebase are belong to us.", .{});4 std.log.info("All your codebase are belong to us.", .{});
5}5}
6
7test "basic test" {
8 try std.testing.expectEqual(10, 3 + 7);
9}