tools/client/test_portable_window.py (1081B)
1 """Compare window creation callbacks against 32-bit Windows USER32.""" 2 import pathlib 3 import subprocess 4 5 root = pathlib.Path(__file__).resolve().parents[2] 6 decompiled = root / "client" 7 work = root / "local/client/portable-window" 8 work.mkdir(parents=True, exist_ok=True) 9 reference = work / "reference.exe" 10 subprocess.run([ 11 str(root / "toolchains/llvm-mingw-20261006-ucrt-x86_64/bin/i686-w64-mingw32-clang.exe"), 12 "-O2", "-Iruntime", "tests/window.c", "data/Clientr_exe.c", "-luser32", "-lgdi32", "-o", str(reference), 13 ], cwd=decompiled, check=True) 14 expected = subprocess.check_output([str(reference)], text=True, timeout=30) 15 linux_path = "/mnt/" + decompiled.drive[0].lower() + decompiled.as_posix()[2:] 16 wsl = ["wsl", "-d", "Ubuntu-26.04", "--cd", linux_path, "--exec"] 17 subprocess.run(wsl + ["make", "-s", "-f", "Makefile.linux", "build/linux/window"], check=True) 18 actual = subprocess.check_output(wsl + ["env", "GALLIUM_DRIVER=d3d12", "./build/linux/window"], text=True, timeout=30) 19 assert actual == expected, (expected, actual) 20 print("Windows == Linux: " + actual.strip())