From 48977e9411219c358cd6f5bce6f2689587fc56aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Romero?= Date: Fri, 16 Oct 2026 17:37:26 +0200 Subject: [PATCH] test: fix regression checks --- scripts/test-benchmark-startup.py | 9 ++++++--- scripts/test-release.py | 20 +++++++++++++++++++- src/renderer/regression.rs | 10 ++++++++++ 3 files changed, 35 insertions(+), 4 deletions(-) diff --git a/scripts/test-benchmark-startup.py b/scripts/test-benchmark-startup.py index b027d527..1edd8ee1 100644 --- a/scripts/test-benchmark-startup.py +++ b/scripts/test-benchmark-startup.py @@ -32,11 +32,14 @@ class SmapsParsingTests(unittest.TestCase): while True: executable = benchmark.runtime_executable(process.pid) if executable == Path(sleep).resolve(): - break + # /proc/pid/exe changes at exec before the dynamic + # loader necessarily faults in the executable's pages. + report = benchmark.read_proc_mappings(process.pid, executable) + if report["by_kind"].get("executable", {}).get("rss_kib", 0) > 0: + break if time.monotonic() >= deadline: - self.fail("launcher did not exec the target ELF") + self.fail("target ELF did not become resident after exec") time.sleep(0.01) - report = benchmark.read_proc_mappings(process.pid, executable) self.assertGreater(report["by_kind"]["executable"]["rss_kib"], 0) self.assertNotIn(directory, json.dumps(report)) finally: diff --git a/scripts/test-release.py b/scripts/test-release.py index 40e14bc5..9ab35c4b 100644 --- a/scripts/test-release.py +++ b/scripts/test-release.py @@ -261,10 +261,28 @@ class ReleaseTests(unittest.TestCase): # Exercise the AppImage shell packager up to its tool boundary, # without downloading deployment tools or compiling the application. + # Model the explicitly bundled X11 libraries without depending on + # the host's development packages or invoking real deployment tools. + libraries = root / "fixture-libs" + libraries.mkdir() + for name in ("libxkbcommon-x11.so.0", "libxkbcommon.so.0"): + shutil.copyfile("/bin/true", libraries / name) + pkg_config = root / "bin/pkg-config" + pkg_config.write_text( + "#!/usr/bin/env python3\n" + "import sys\n" + "assert sys.argv[1:] == ['--variable=libdir', 'xkbcommon-x11']\n" + f"print({str(libraries)!r})\n" + ) + pkg_config.chmod(0o755) deploy = root / "bin/linuxdeploy" deploy.write_text('''#!/usr/bin/env python3 -import pathlib, sys +import pathlib, shutil, sys appdir = pathlib.Path(sys.argv[sys.argv.index("--appdir") + 1]) +library = pathlib.Path(sys.argv[sys.argv.index("--library") + 1]) +assert library.name == "libxkbcommon-x11.so.0" +for name in ("libxkbcommon-x11.so.0", "libxkbcommon.so.0"): + shutil.copyfile(library.parent / name, appdir / "usr/lib" / name) (appdir / "com.flectar.mail.desktop").symlink_to("usr/share/applications/com.flectar.mail.desktop") ''') pack = root / "bin/appimagetool" diff --git a/src/renderer/regression.rs b/src/renderer/regression.rs index b5626b56..cd284030 100644 --- a/src/renderer/regression.rs +++ b/src/renderer/regression.rs @@ -1103,6 +1103,16 @@ fn float_text_wrap_and_clear() { if let PositionedLayoutItem::GlyphRun(run) = item { let left = origin.x + run.offset() / inline.layout.scale(); let right = left + run.advance() / inline.layout.scale(); + // Parley 0.12 includes trailing whitespace in a run's + // advance. That whitespace may hang beyond the line's + // edge, but must not count as text overlapping a float. + let content_end = origin.x + + (line.metrics().inline_min_coord + + line.metrics().offset + + line.metrics().advance + - line.metrics().hanging_advance) + / inline.layout.scale(); + let right = right.min(content_end); assert!( if direction == "left" { left >= pos.x + 80.0 + 7.0