Commit 8e1aa72c69
lib/std/special/init-exe/src/main.zig
@@ -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);
+}
lib/std/special/init-exe/build.zig
@@ -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);
}