tools/client/test_portable_finite.py (1004B)
1 """Compare IEEE-754 classification with Windows MSVCRT without evaluating NaNs.""" 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-finite" 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", "tests/finite.c", "-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/finite"], check=True) 18 actual = subprocess.check_output(wsl + ["./build/linux/finite"], text=True, timeout=30) 19 assert actual == expected, (expected, actual) 20 print("Windows == Linux: " + actual.strip())