diff options
Diffstat (limited to 'test/process.zig')
| -rw-r--r-- | test/process.zig | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/process.zig b/test/process.zig index 674996d0..0a443a21 100644 --- a/test/process.zig +++ b/test/process.zig @@ -512,6 +512,9 @@ pub fn of(gpa: std.mem.Allocator, h: *const eh.Harness) Files { /// host it was built with. pub const Backend = enum { tui, gui }; pub var backend: Backend = .tui; +/// The image addon the build made (the runner's --image-addon=), linked +/// into each session's data directory, where its start scan finds it. +pub var image_addon: ?[:0]const u8 = null; /// A case about one frontend's own behaviour (`--tty`, a killed terminal /// editor) skips on the other. @@ -583,6 +586,10 @@ pub const Detached = struct { errdefer if (d.cap_len > 0) removeDir(d.captures()); const dir = d.root(); var bufs: [6][4096]u8 = undefined; + if (image_addon) |lib| { + for ([_][]const u8{ "/.local", "/.local/share", "/.local/share/pardes", "/.local/share/pardes/addons" }) |sub| _ = libc.mkdir(try std.fmt.bufPrintSentinel(&bufs[5], "{s}{s}", .{ dir, sub }, 0), 0o755); + _ = libc.symlink(lib, try std.fmt.bufPrintSentinel(&bufs[5], "{s}/.local/share/pardes/addons/image.so", .{dir}, 0)); + } if (opts.init) |text| { const cfg = try std.fmt.bufPrintSentinel(&bufs[5], "{s}/config", .{dir}, 0); _ = libc.mkdir(cfg, 0o755); |
