mirror of
https://github.com/ziglang/zig.git
synced 2026-01-05 04:53:17 +00:00
It's simpler and it takes advantage of `std.Build.addAnonymousDependency`, which has a number of benefits, including concurrenc and preventing extra zig-cache and zig-out directories being created. 4 tests are ported over as an example.
18 lines
396 B
Zig
18 lines
396 B
Zig
const std = @import("std");
|
|
|
|
pub fn build(b: *std.Build) void {
|
|
const test_step = b.step("test", "Test");
|
|
b.default_step = test_step;
|
|
|
|
const exe = b.addExecutable(.{
|
|
.name = "bss",
|
|
.root_source_file = .{ .path = "main.zig" },
|
|
.optimize = .Debug,
|
|
});
|
|
|
|
const run = exe.run();
|
|
run.expectStdOutEqual("0, 1, 0\n");
|
|
|
|
test_step.dependOn(&run.step);
|
|
}
|