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

Manually merged
github merged 1 commit from gh-pr/813/head into gh-pr/813/base 2026-11-26 22:20:33 +00:00
Owner

@⁠stan495 on GitHub · 2026-11-23 07:20 UTC · original
stan495:codex/ttpf-test-tools-path → main · +7 −4 · 1 files · 1 commits · merged 2026-11-23 08:08 UTC

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.

**@⁠stan495** on GitHub · 2026-11-23 07:20 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/813) `stan495:codex/ttpf-test-tools-path` → `main` · +7 −4 · 1 files · 1 commits · merged 2026-11-23 08:08 UTC ## 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.
Pass the detected local tools path to the real-exporter checks and skip an empty checkout when no explicit tools directory is configured.

Refs #798 and #458.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 22:20:32 +00:00
github manually merged commit d9a9f25bc4 into gh-pr/813/base 2026-11-26 22:20:33 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.