VNOX-Client/patches/test-upstream.py
loki5512344 8e5ab56611
feat(client): redesign native UI, themes, settings and avatars
Separate conversation drafts and voice view state, add native settings and restricted CSS themes, implement validated avatar cropping, and refresh dependencies with documented desktop compatibility backports.
2026-10-24 14:23:48 +02:00

30 lines
1.1 KiB
Python

#!/usr/bin/env python3
"""Run preserved AT-SPI upstream unit tests in a temporary standalone workspace.
Cargo cannot directly test dev-dependencies of an excluded patched dependency.
This copies the exact patched sources (including XML fixtures), enables no test
exclusions, and uses this repository's maintained dependency backports.
"""
from pathlib import Path
import shutil
import subprocess
import tempfile
patches = Path(__file__).resolve().parent
project = patches.parent
with tempfile.TemporaryDirectory(prefix="vnox-upstream-tests-") as temporary:
package = Path(temporary) / "atspi-common"
shutil.copytree(
patches / "atspi-common",
package,
ignore=shutil.ignore_patterns("target", "Cargo.lock"),
)
command = [
"cargo", "test", "--manifest-path", str(package / "Cargo.toml"),
"--lib", "--target-dir", str(project / "target"),
]
for dependency in ("zbus-lockstep", "zbus-lockstep-macros"):
command.extend([
"--config", f'patch.crates-io.{dependency}.path="{patches / dependency}"',
])
raise SystemExit(subprocess.run(command, cwd=project).returncode)