McRogueFace/tests/demo
John McCardle bd0b913d7d fix(demos): unrot tests/demo and gate it in CI
tests/demo/demo_main.py died immediately on `mcrfpy.sceneUI`, removed with the
pre-Scene-object API. Four bugs, not the one filed:

  1. screens/base.py called mcrfpy.sceneUI(name). The Scene object it had already
     constructed owns the UI collection: scene.children.
  2. demo_main.py called the removed mcrfpy.setScene().
  3. run_interactive() referenced `menu`, a local of create_menu() -- NameError on
     every interactive launch, independent of the sceneUI bug.
  4. run_headless() assigned a DemoScreen (not a Scene) to mcrfpy.current_scene ->
     TypeError, so the headless screenshot path was broken too.

The screens themselves had rotted the same way as the unit suite: add_layer() no
longer takes keyword arguments or a name (it takes a layer object), layer.set()
takes a position tuple, and mcrfpy.Animation is no longer exported (targets animate
themselves). Fixed in grid_demo and animation_demo, including the code samples the
demos display -- the demos are documentation, so a stale sample is a stale doc.

The headless path also no longer needs a Timer at all. Rendering costs zero
simulation time (#341/#350), so it just activates each scene and screenshots it,
rather than waiting for frames that headless never runs.

Six showcase scripts wrote to a hardcoded /opt/goblincorps/... absolute path outside
the repo, so they raised PermissionError for anyone else. Replaced with
tests/demo/docs_output.py: $MCRF_DOCS_REPO, else a side-by-side mcrogueface.github.io
checkout, else tests/demo/screenshots/.

The point of the issue was the gate, so: run_tests.py now runs demo_main.py as a
smoke test. Verified it catches the original bug -- reintroducing the sceneUI call
turns the demo suite red. CLAUDE.md tells newcomers to read tests/demo/screens/ for
correct API usage; nothing was checking that it ran.

The 19 standalone showcase scripts under screens/ are not on the demo_main path and
are not adopted here; follow-up issue to come.

closes #372
2026-07-14 06:46:03 -04:00
..
ldtk LDtk import support 2026-02-07 11:34:38 -05:00
screens fix(demos): unrot tests/demo and gate it in CI 2026-07-14 06:46:03 -04:00
screenshots fix(demos): unrot tests/demo and gate it in CI 2026-07-14 06:46:03 -04:00
__init__.py refactor: comprehensive test suite overhaul and demo system 2025-11-25 23:37:05 -05:00
audio_synth_demo.py Fix callback/timer GC: prevent premature destruction of Python callbacks 2026-02-19 20:53:50 -05:00
cookbook_showcase.py fix(demos): unrot tests/demo and gate it in CI 2026-07-14 06:46:03 -04:00
demo_main.py fix(demos): unrot tests/demo and gate it in CI 2026-07-14 06:46:03 -04:00
docs_output.py fix(demos): unrot tests/demo and gate it in CI 2026-07-14 06:46:03 -04:00
new_features_showcase.py fix(demos): unrot tests/demo and gate it in CI 2026-07-14 06:46:03 -04:00
perspective_patrol_demo.py Remove legacy string enum comparisons from InputState/Key/MouseButton, closes #306 2026-04-09 22:19:02 -04:00
procgen_showcase.py fix(demos): unrot tests/demo and gate it in CI 2026-07-14 06:46:03 -04:00
simple_showcase.py fix(demos): unrot tests/demo and gate it in CI 2026-07-14 06:46:03 -04:00
tutorial_screenshots.py fix(demos): unrot tests/demo and gate it in CI 2026-07-14 06:46:03 -04:00
tutorial_showcase.py fix(demos): unrot tests/demo and gate it in CI 2026-07-14 06:46:03 -04:00
viewport3d_demo.py Viewport scene explorer + object cache integration 2026-02-04 13:44:20 -05:00
viewport3d_screenshot.py Test suite modernization 2026-02-09 08:15:18 -05:00