diff options
Diffstat (limited to 'build')
| -rw-r--r-- | build/snap.zig | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/build/snap.zig b/build/snap.zig index 841f4fcd..766be2b4 100644 --- a/build/snap.zig +++ b/build/snap.zig @@ -30,6 +30,21 @@ pub fn addTty(b: *std.Build, opts: struct { .freebsd, .netbsd, .openbsd => snap.root_module.linkSystemLibrary("util", .{}), else => {}, } + // The deterministic mock language server (test/lspmock.zig): the runner + // points PARDES_LSP_RS at it, so the lsp-client scripts drive the REAL + // protocol client — spawn, handshake, reader thread, progress narration — + // against answers a golden can quote byte for byte. No pardes import; it + // is a foreign binary on purpose. + const lspmock = b.addExecutable(.{ + .name = "pardes-lspmock", + .root_module = b.createModule(.{ + .target = opts.target, + .optimize = opts.optimize, + .root_source_file = b.path("test/lspmock.zig"), + .link_libc = true, + }), + }); + const install_lspmock = &b.addInstallArtifact(lspmock, .{ .dest_dir = .{ .override = .{ .custom = "dev" } } }).step; // Installed by `snap` and not by the default install step, and into // `<prefix>/dev` rather than `<prefix>/bin`: a bare `zig build` installs // the two shells into the user's own bin directory, and this harness is @@ -37,11 +52,13 @@ pub fn addTty(b: *std.Build, opts: struct { const install_snap = &b.addInstallArtifact(snap, .{ .dest_dir = .{ .override = .{ .custom = "dev" } } }).step; const run_snap = b.addRunArtifact(snap); run_snap.addArtifactArg(opts.exe); + run_snap.addPrefixedFileArg("--lspmock=", lspmock.getEmittedBin()); if (b.args) |args| run_snap.addArgs(args); // scripts fork children and drive real ptys: never cached, never "up to date" run_snap.has_side_effects = true; const snap_step = b.step("snap", "run the snapshot parity suite (-- --update regenerates goldens)"); snap_step.dependOn(install_snap); + snap_step.dependOn(install_lspmock); snap_step.dependOn(&run_snap.step); } |
