diff options
Diffstat (limited to 'test')
| -rw-r--r-- | test/cross_replay.py | 4 | ||||
| -rw-r--r-- | test/tty.zig | 8 |
2 files changed, 6 insertions, 6 deletions
diff --git a/test/cross_replay.py b/test/cross_replay.py index 21367ca1..fe9638f7 100644 --- a/test/cross_replay.py +++ b/test/cross_replay.py @@ -114,7 +114,7 @@ def record(binary, out): def replay(binary, tape): """`binary`'s replay of `tape`: its replicas' digests agree. A replica client never draws its session's frames, and only the replica that - draws none (`headless`) must agree with another frontend's tape: the + draws none (`skips-render`) must agree with another frontend's tape: the two that draw meet the other build's drawing (a window's, a terminal's).""" env = {k: v for k, v in os.environ.items() if not k.startswith('PARDES_')} env['PARDES_REPLAY'] = str(tape) @@ -122,7 +122,7 @@ def replay(binary, tape): said = got.stderr.decode(errors='replace') alike = ('gui' in Path(tape).name) == ('gui' in Path(binary).name) agreed = [line for line in said.splitlines() if line.endswith('digests agree')] - assert ('headless replica' in ''.join(agreed)) and (not alike or (got.returncode == 0 and len(agreed) == 3)), \ + assert ('skips-render replica' in ''.join(agreed)) and (not alike or (got.returncode == 0 and len(agreed) == 3)), \ f'{binary} replaying {tape}:\n{said[-3000:]}' print(f'cross_replay: {Path(binary).name} replayed {Path(tape).name}: ' + '; '.join(line.split(': ', 1)[1] for line in said.splitlines() if 'replica' in line)) diff --git a/test/tty.zig b/test/tty.zig index 2fdf5952..d41159a0 100644 --- a/test/tty.zig +++ b/test/tty.zig @@ -162,7 +162,7 @@ pub const Tty = struct { } /// Each tape the case's sessions wrote, replayed by `exe`. - fn replayTapes(t: *Tty, exe: []const u8, headless: bool) !void { + fn replayTapes(t: *Tty, exe: []const u8, other_build: bool) !void { const tapes_dir = try std.fmt.allocPrint(t.arena, "{s}/tapes", .{t.base}); const io = std.Io.Threaded.global_single_threaded.io(); var d = try std.Io.Dir.cwd().openDir(io, tapes_dir, .{ .iterate = true }); @@ -172,12 +172,12 @@ pub const Tty = struct { while (try it.next(io)) |entry| { if (!std.mem.endsWith(u8, entry.name, ".tape")) continue; tapes += 1; - const cmd = try std.fmt.allocPrintSentinel(t.arena, "PARDES_RECORD= PARDES_REPLAY='{s}/{s}' {s}timeout 300 '{s}' > '{s}/{s}.replay' 2>&1", .{ tapes_dir, entry.name, if (headless) "" else "PARDES_REPLAY_DUMP=1 ", exe, tapes_dir, entry.name }, 0); + const cmd = try std.fmt.allocPrintSentinel(t.arena, "PARDES_RECORD= PARDES_REPLAY='{s}/{s}' {s}timeout 300 '{s}' > '{s}/{s}.replay' 2>&1", .{ tapes_dir, entry.name, if (other_build) "" else "PARDES_REPLAY_DUMP=1 ", exe, tapes_dir, entry.name }, 0); if (system(cmd) == 0) continue; const said = readFileAlloc(t.arena, try std.fmt.allocPrint(t.arena, "{s}/{s}.replay", .{ tapes_dir, entry.name })) catch ""; // Another build's replay need agree only in the replica that draws nothing. - if (headless) if (std.mem.indexOf(u8, said, ": headless replica: ")) |at| { - if (std.mem.startsWith(u8, std.mem.trimStart(u8, said[at + ": headless replica: ".len ..], "0123456789"), " digests agree")) continue; + if (other_build) if (std.mem.indexOf(u8, said, ": skips-render replica: ")) |at| { + if (std.mem.startsWith(u8, std.mem.trimStart(u8, said[at + ": skips-render replica: ".len ..], "0123456789"), " digests agree")) continue; }; std.debug.print(" {s}: its tape {s} did not replay:\n{s}", .{ t.name, entry.name, said }); return error.Diverged; |
