Skip to content

instead of embedding the compiler in the check-cases process, spawn the compiler as a sub-process and communicate the updates using the compiler protocol #14966

@andrewrk

Description

@andrewrk

Extracted from #14647.

zig/test/src/Cases.zig

Lines 989 to 991 in b4d58e9

// TODO: instead of embedding the compiler in this process, spawn the compiler
// as a sub-process and communicate the updates using the compiler protocol.
pub fn main() !void {

zig/test/src/Cases.zig

Lines 455 to 472 in b4d58e9

incremental_exe: *std.Build.CompileStep,
) void {
for (self.incremental_cases.items) |incr_case| {
if (opt_test_filter) |test_filter| {
if (std.mem.indexOf(u8, incr_case.base_path, test_filter) == null) continue;
}
const case_base_path_with_dir = std.fs.path.join(b.allocator, &.{
cases_dir_path, incr_case.base_path,
}) catch @panic("OOM");
const run = b.addRunArtifact(incremental_exe);
run.setName(incr_case.base_path);
run.addArgs(&.{
case_base_path_with_dir,
b.zig_exe,
});
run.expectStdOutEqual("");
parent_step.dependOn(&run.step);
}

zig/build.zig

Lines 69 to 73 in b4d58e9

const check_case_exe = b.addExecutable(.{
.name = "check-case",
.root_source_file = .{ .path = "test/src/Cases.zig" },
.optimize = optimize,
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions