Files
gig-line/Tools/tests
zwitschi bd1f8a9c2e feat(qa): reference-vs-render iteration loop; screenshots are demo-only
Tools/visual_loop.py:
- --verify gates every capture against its expectation in Tools/visual_targets.json
  (missing, blank, tone-less or wrong-size shots fail), so 'each screenshot shows
  what was expected' is checked rather than assumed.
- --compare measures luminance, RMS contrast, edge density, palette distance and a
  3x3 luma grid against the reference photograph, with a 0-1 similarity score.
- --iteration N writes Art/reference/iterations/N/{metrics.json,feedback.md}; the
  feedback names the skill to consult (blender-modeler, archviz, materials, lookdev,
  camera-cinematography), so the next modelling pass starts from a measurement.
- Iterations are gitignored until the owner confirms a shot; only confirmed shots
  are promoted into Screenshots/.

Screenshots/ holds demo-map captures only now: render_screenshots.sh renders just
DemoMap, collects the shots and runs the verification gate (--verify); the review
staging map is no longer rendered for review and its PNGs are removed. The README
is rewritten around the four demo shots with per-shot expected content and a
verified column, and no longer claims the review staging set.

Tests: 67 pass (13 new) covering metrics on synthetic images, comparison scoring,
the feedback rules and the target spec (including that every target is a demo shot
and that iterations are gitignored).
2026-11-08 19:52:25 +01:00
..

Tooling tests

Standard-library unittest tests for the host-side tools in Tools/. They never start Blender, Unreal, or the game; anything that needs those processes is verified by the tool itself and recorded in Docs/release-checks.md instead.

Run from the repository root:

python3 -m pip install -r requirements-tools.txt
python3 -m unittest discover -s Tools/tests -t Tools -p 'test_*.py'

The -t Tools top-level directory is required: the tests import the tool modules by their plain names (import input_emulation), which is why Tools/tests/ carries an __init__.py.

Individual test:

python3 -m unittest Tools.tests.test_input_emulation -v

What belongs here

Test the pure parts — argument parsing, key/coordinate encoding, geometry maths, licence gating, report formatting, decision classification. Network, Blender and Unreal calls stay out: a test that needs a paid API, a display, or an engine process is a manual check, not a unit test.

When a tool's logic is buried in main(), extract it into a function so it can be tested directly. That is a tooling improvement, not test scaffolding.

Geo (Geo/tools/) and Blender (Art/blender/*/) builders are tested the same way once their pure parts are extracted; note the module path in the test.