tooling: discover the local Leonida backend in TTPF tests #807

Merged
stan495 merged 1 commit from upstream-pr/813 into main 2026-11-23 08:08:52 +00:00
stan495 commented 2026-11-23 07:20:28 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by stan495 on 2026-11-23T07:20:28Z.


Change

Use out/Leonida/tools for the real TTPF exporter check when neither TTPF_TOOLS_DIR nor BCPACK_REFERENCE_TOOLS is set. The test passes the discovered path to both load_tools() and batch_export(). In the absence of explicit configuration, a missing ttpf_mips.py skips the optional check.

Refs #798 and #458.

Verification

Tested the patch in d9a9f25 on Windows with Python 3.12. From the repository root, run:

.\out\pe-env\Scripts\python.exe -B tests/ttpf_batch_export_check.py -v
ctest --preset dev --no-tests=error -R '^ttpf_batch_export$' -V

The Python check produced these results in isolated copies of the test and its dependencies:

Setup Result
Backend at out/Leonida/tools, both environment variables unset 66669bb failed with tools module could not be loaded. The patched test passed all 9 cases.
Backend supplied via TTPF_TOOLS_DIR or BCPACK_REFERENCE_TOOLS 9 passed in each run. The explicit path took precedence over a local sentinel module.
No backend or an empty out/Leonida/tools directory, both environment variables unset 8 passed and the real-backend case skipped in each run.

CTest passed its registered test with 8 Python cases passing and the optional backend case skipped. git diff --check passed.

Evidence and follow-up

The optional check uses the existing generated RDS5 fixture and Leonida revision b0befb4b88d6640354940117448ea19d52507584. The real-backend runs verify DDS output against the independent BC1 and BC7 pixel references. An empty default directory is the control for the skip condition.

Checklist

  • This pull request covers one reviewable behavior.
  • I included the exact command and result for every check I ran.
  • I considered a negative control or failure case for a new fixture.
  • I updated README/docs when a capability or build requirement changed. (This patch corrects an existing test's optional backend lookup.)
  • I did not include game files, dumps, distribution links or secrets.

AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6554342616 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/813). Originally posted by [stan495](https://github.com/stan495) on 2026-11-23T07:20:28Z. --- ## Change Use `out/Leonida/tools` for the real TTPF exporter check when neither `TTPF_TOOLS_DIR` nor `BCPACK_REFERENCE_TOOLS` is set. The test passes the discovered path to both `load_tools()` and `batch_export()`. In the absence of explicit configuration, a missing `ttpf_mips.py` skips the optional check. Refs #798 and #458. ## Verification Tested the patch in `d9a9f25` on Windows with Python 3.12. From the repository root, run: ```powershell .\out\pe-env\Scripts\python.exe -B tests/ttpf_batch_export_check.py -v ctest --preset dev --no-tests=error -R '^ttpf_batch_export$' -V ``` The Python check produced these results in isolated copies of the test and its dependencies: | Setup | Result | | --- | --- | | Backend at `out/Leonida/tools`, both environment variables unset | `66669bb` failed with `tools module could not be loaded`. The patched test passed all 9 cases. | | Backend supplied via `TTPF_TOOLS_DIR` or `BCPACK_REFERENCE_TOOLS` | 9 passed in each run. The explicit path took precedence over a local sentinel module. | | No backend or an empty `out/Leonida/tools` directory, both environment variables unset | 8 passed and the real-backend case skipped in each run. | CTest passed its registered test with 8 Python cases passing and the optional backend case skipped. `git diff --check` passed. ## Evidence and follow-up The optional check uses the existing generated RDS5 fixture and Leonida revision `b0befb4b88d6640354940117448ea19d52507584`. The real-backend runs verify DDS output against the independent BC1 and BC7 pixel references. An empty default directory is the control for the skip condition. ## Checklist - [x] This pull request covers one reviewable behavior. - [x] I included the exact command and result for every check I ran. - [x] I considered a negative control or failure case for a new fixture. - [x] I updated README/docs when a capability or build requirement changed. (This patch corrects an existing test's optional backend lookup.) - [x] I did not include game files, dumps, distribution links or secrets. AI-assisted.
upstream-sync closed this pull request 2026-11-24 06:44:54 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
R0Y00/Xbox2Windows!807
No description provided.