This guide covers the testing framework for YAZE, including test organization, execution, and the GUI automation system.
Tests are organized by purpose and dependencies:
| Category | Purpose | Dependencies | Speed |
|---|---|---|---|
| Unit | Test individual classes/functions | None | Fast |
| Integration | Test component interactions | May require ROM | Medium |
| E2E | Simulate user workflows | GUI + ROM | Slow |
| Benchmarks | Measure performance | None | Variable |
ROM policy: GitHub CI does not run ROM-dependent tests. Run them locally with YAZE_ENABLE_ROM_TESTS=ON and YAZE_TEST_ROM_* paths. Use YAZE_SKIP_ROM_TESTS=1 to force-skip ROM suites.
Fast, isolated tests with no external dependencies. Run in CI on every commit.
Test module interactions (e.g., asar wrapper with Rom class). Some require a ROM file.
GUI-driven tests using ImGui Test Engine. Validate complete user workflows.
Performance measurement for critical paths. Run manually or in specialized CI jobs.
See the Build and Test Quick Reference for full command reference.
ROM-dependent CTest suites are local-only and will be skipped when ROMs are not configured.
Place tests based on their purpose:
| Test Type | File Location |
|---|---|
Unit test for MyClass | test/unit/my_class_test.cc |
| Integration with ROM | test/integration/my_class_rom_test.cc |
| UI workflow test | test/e2e/my_class_workflow_test.cc |
The E2E framework uses ImGui Test Engine for UI automation.
| File | Purpose |
|---|---|
test/yaze_test.cc | Main test runner with GUI initialization |
test/e2e/framework_smoke_test.cc | Infrastructure verification |
test/e2e/canvas_selection_test.cc | Canvas interaction tests |
test/e2e/dungeon_editor_tests.cc | Dungeon editor UI tests |
test/test_utils.h | Helper functions (LoadRomInTest, OpenEditorInTest) |
UI elements are registered with stable IDs for programmatic access via z3ed:
z3ed gui discover - List available widgetsz3ed gui click - Interact with widgetsz3ed agent test replay - Replay recorded testsSee the z3ed CLI Guide for more details.