ReviewOS

also looking at this

zig-utils/zig-test-framework

Unify discovery and programmatic test execution

#23
Merged glennmichael123 wants to merge codex/issue-5-unified-test-pipeline into main
12 files +656 -169
build.zigmodified+7-0
Changes to build.zig
@@ -286,6 +286,13 @@ pub fn build(b: *std.Build) void {
286286 run_shard_two.addArgs(&.{ "--test-dir", "tests", "--pattern", "sample.test.zig", "--shard-index", "2", "--shard-count", "2", "--no-color" });
287287 test_step.dependOn(&run_shard_two.step);
288288
289 const run_discovery_tap = b.addRunArtifact(exe);
290 run_discovery_tap.addArgs(&.{ "--test-dir", "tests", "--pattern", "sample.test.zig", "--reporter", "tap", "--no-color" });
291 run_discovery_tap.expectStdOutEqual(
292 "TAP version 14\n1..1\n# Subtest: sample.test.zig\nok 1 - sample.test.zig\n",
293 );
294 test_step.dependOn(&run_discovery_tap.step);
295
289296 const run_version = b.addRunArtifact(exe);
290297 run_version.addArg("--version");
291298 run_version.expectStdErrEqual(b.fmt("Zig Test Framework v{s}\n", .{package_version}));