Repository navigation
tests/imhex: run imhex-gui.exe, not the Windows launcher - #7298
darthelmo1 wants to merge 2 commits into
Conversation
The Windows installer's imhex.exe is a small console launcher that starts imhex-gui.exe beside it and passes on neither its output nor its exit code. Through it, a pattern that rejects its input looks like a silent success: no JSON, exit 0, empty log. test_rpf9_rejects_a_data_offset_past_the_end failed on Windows because the "data offset is outside the file" assertion text never reached the test. find_imhex() now swaps imhex.exe for an imhex-gui.exe in the same folder, for LEONIDA_IMHEX, PATH and the default install alike. Elsewhere, or with no imhex-gui.exe beside it, the binary is used as it is. Tested on Windows 11, Python 3.12.10, ImHex installed in Program Files: python -I tests/test_imhex_patterns.py, 13 OK (was 1 failure; 4 new tests for the lookup, which use empty stand-in files and start nothing). Run by hand, imhex-gui.exe exits 1 and prints the pattern's assertion where imhex.exe exits 0 and prints nothing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Tested d7cedc2, clean vs main 976b3ec: the FindImHex tests pass (Ran 13, 6 skips for non-Windows). They also pass on clean main — the legitimate vacuity exception: this is test-infra-only and the ImHex CLI is invoked from no other file (grepped tools/, scripts/, make_game.py), so swapping imhex.exe → imhex-gui.exe is contained to the harness. The Windows launcher's output/exit-code behavior itself can't be verified on this host. Nit: the diff loses a space, "ROOT =os.path...". Flag: NO CI checks on the branch. AI-assisted: yes. Tested on Linux (RTX 5080 host, CPU-only run). |
|
Tested d7cedc2 on Windows 11, Python 3.15.2, NVIDIA RTX 4060 Ti (driver 621.24; CPU-only checks, no game files, no GPU/llvm-mc/MSVC used): pass. Ran the test files this PR adds or changes, from a clean checkout of the PR head: AI-assisted (Claude Code). |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tests/test_imhex_patterns.py::test_rpf9_rejects_a_data_offset_past_the_endfails on Windows with ImHex installed in its default folder:'data offset is outside the file' not found in ''.The Windows installer's
imhex.exeis a small console launcher that startsimhex-gui.exebeside it and passes on neither its output nor its exit code. Run by hand on the test's input:imhex.exeimhex-gui.exePattern Error: ... assertion failed 'the data offset is outside the file'So through the launcher a rejected pattern looks like a silent success. The other ImHex tests only read the JSON file, which is why only this one noticed.
find_imhex()now swapsimhex.exefor animhex-gui.exein the same folder, forLEONIDA_IMHEX,PATHand the default install alike. Elsewhere, or with noimhex-gui.exebeside it, the binary is used as it is. Test-only change.Tested
Windows 11, Python 3.12.10, ImHex in
C:\Program Files\ImHex:python -I tests/test_imhex_patterns.py: 13 OK (was 1 failure). 4 newFindImHextests cover the lookup with empty stand-in files, so they run without ImHex and start nothing.No game files used.
🤖 Generated with Claude Code