summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-10-31 06:28:48 -0300
committerGabriel Schneider <[email protected]>2026-10-31 06:28:48 -0300
commita479792a1ab2b593642d7f648194bfa23ce01dba (patch)
tree96ddee7d879a9084daa07db43b0b7910b072a785 /tools
parente179cc44fe5060c76a5b00c41e53f11209f5acd9 (diff)
parent4c761893e5b3fdae422622cfa02104ab36633045 (diff)
downloadpardes-a479792a1ab2b593642d7f648194bfa23ce01dba.tar.gz
pardes-a479792a1ab2b593642d7f648194bfa23ce01dba.zip
Merge the upstream daemon and replicated client/server refactor
Diffstat (limited to 'tools')
-rw-r--r--tools/shared_libs_check.zig2
-rw-r--r--tools/web_fixture.py34
2 files changed, 36 insertions, 0 deletions
diff --git a/tools/shared_libs_check.zig b/tools/shared_libs_check.zig
index d18c6850..7b3174e4 100644
--- a/tools/shared_libs_check.zig
+++ b/tools/shared_libs_check.zig
@@ -45,6 +45,8 @@ const always = [_]Family{
.{ .what = "a second zlib", .symbols = &.{ "inflate_table", "inflate_fast", "deflate_slow" }, .most = 1 },
// One FreeType: the build's, which MuPDF is compiled against.
.{ .what = "a second FreeType", .symbols = &.{ "FT_Init_FreeType", "FT_New_Library" }, .most = 1 },
+ // One zstd: the build's, a far replica's stream (src/replica.zig).
+ .{ .what = "a second zstd", .symbols = &.{ "ZSTD_compressStream2", "ZSTD_decompressStream", "ZSTD_createCCtx_advanced" }, .most = 1 },
};
pub fn main(init: std.process.Init) !void {
diff --git a/tools/web_fixture.py b/tools/web_fixture.py
new file mode 100644
index 00000000..06fc54cd
--- /dev/null
+++ b/tools/web_fixture.py
@@ -0,0 +1,34 @@
+"""web_fixture.py PARDES OUT: the web shell's touch fixture as a dump of this
+build: one pane on touch-fixture.zig at 100x30, theme helix.
+
+ python3 -B tools/web_fixture.py <pardes> test/web-snapshots/touch.dump
+"""
+import os, sys, time, shutil, struct, fcntl, termios
+from pathlib import Path
+sys.path.insert(0, str(Path(__file__).resolve().parent.parent / 'test'))
+import fs # noqa: E402
+
+binary, out = sys.argv[1], sys.argv[2]
+root = Path('/tmp/pardes-web-fixture') # fixed: the dump names it
+shutil.rmtree(root, ignore_errors=True)
+root.mkdir(parents=True, mode=0o700)
+shutil.copy(Path(__file__).resolve().parent.parent / 'test' / 'web-snapshots' / 'touch-fixture.zig', root / 'touch-fixture.zig')
+# Set at startup, which announces nothing: a fixture with no message on
+# its pane.
+(root / 'config' / 'pardes').mkdir(parents=True)
+(root / 'config' / 'pardes' / 'init').write_text('Theme helix\nVerbose off\n')
+handles = {}
+with fs.session(binary, root, 'web', tty=True, file=root / 'touch-fixture.zig', inherited={'PARDES_DAEMON': 'off'}, terminal=handles) as (client, address):
+ fcntl.ioctl(handles['input_fd'], termios.TIOCSWINSZ, struct.pack('HHHH', 30, 100, 0, 0))
+ deadline = time.monotonic() + 10
+ while client.screen()['cols'] != 100:
+ assert time.monotonic() < deadline
+ time.sleep(.01)
+ client.write('/ctl', b'Dump\n')
+ while b'\ndump ' not in client.read('/log'):
+ assert time.monotonic() < deadline
+ time.sleep(.01)
+ print(client.read('/index').decode())
+ shutil.copy(root / 'web.dump.zon', out)
+shutil.rmtree(root, ignore_errors=True)
+print(os.path.getsize(out), 'bytes')