diff --git a/build.zig b/build.zig index 62da26c53c..8cc70f2c7a 100644 --- a/build.zig +++ b/build.zig @@ -764,6 +764,7 @@ const MiniCiStep = struct { // Run the sequence of `zig build` commands that make up the // mini CI pipeline. try runSubBuild(step, "fmt", "zig build fmt"); + try checkTestWiring(step); try runSubBuild(step, null, "zig build"); try checkBuiltinRocFormatting(step); try runSubBuild(step, "snapshot", "zig build snapshot"); @@ -882,6 +883,39 @@ const MiniCiStep = struct { }, } } + + fn checkTestWiring(step: *Step) !void { + const b = step.owner; + std.debug.print("---- minici: checking test wiring ----\n", .{}); + + var child_argv = std.ArrayList([]const u8).empty; + defer child_argv.deinit(b.allocator); + + try child_argv.append(b.allocator, b.graph.zig_exe); + try child_argv.append(b.allocator, "run"); + try child_argv.append(b.allocator, "ci/check_test_wiring.zig"); + + var child = std.process.Child.init(child_argv.items, b.allocator); + child.stdin_behavior = .Inherit; + child.stdout_behavior = .Inherit; + child.stderr_behavior = .Inherit; + + const term = try child.spawnAndWait(); + + switch (term) { + .Exited => |code| { + if (code != 0) { + return step.fail( + "Test wiring check failed. Run 'zig run ci/check_test_wiring.zig' to see details.", + .{}, + ); + } + }, + else => { + return step.fail("zig run ci/check_test_wiring.zig terminated abnormally", .{}); + }, + } + } }; fn createAndRunBuiltinCompiler( diff --git a/src/check/mod.zig b/src/check/mod.zig index 100817cccc..186ebf0c34 100644 --- a/src/check/mod.zig +++ b/src/check/mod.zig @@ -41,4 +41,5 @@ test "check tests" { std.testing.refAllDecls(@import("test/builtin_scope_test.zig")); std.testing.refAllDecls(@import("test/num_type_inference_test.zig")); std.testing.refAllDecls(@import("test/unify_test.zig")); + std.testing.refAllDecls(@import("test/instantiate_tag_union_test.zig")); }