docs: update ROM test paths and envs
This commit is contained in:
@@ -72,7 +72,7 @@ Board: docs/internal/agents/coordination-board.md (2025-12-01 ai-infra-architect
|
||||
- Agent-side test commands (`agent test run/list/status/...`) print ad-hoc logs and lack `OutputFormatter`/metadata, making automation fragile; no JSON status, exit codes, or artifacts paths surfaced.
|
||||
- Test helper tools (`tools-*/` commands, `tools/test_helpers/*`) mix stdout banners with file emission and manual path requirements; they are not discoverable via TUI or CommandRegistry-driven palettes and do not expose dry-run/plan outputs.
|
||||
- TUI/editor have no test surface: no panel to run `stable/gui/rom_dependent/experimental` suites, inspect failing cases, or attach ROM paths/presets; quick actions and history are missing.
|
||||
- Build/preset coupling is implicit—no guided flow to pick `mac-test/mac-ai/mac-dev`, enable ROM/AI flags, or attach `YAZE_TEST_ROM_PATH`; agents/humans can misconfigure and get empty test sets.
|
||||
- Build/preset coupling is implicit—no guided flow to pick `mac-test/mac-ai/mac-dev`, enable ROM/AI flags, or attach `YAZE_TEST_ROM_VANILLA`; agents/humans can misconfigure and get empty test sets.
|
||||
|
||||
### Proposed Improvements
|
||||
- **Unified test CLI/TUI API**
|
||||
|
||||
@@ -22,7 +22,7 @@ Board: docs/internal/agents/coordination-board.md (2025-12-01 ai-infra-architect
|
||||
## Improvement Proposals
|
||||
- **Manifest & discovery**: Generate a JSON manifest (per build) listing tests, labels, requirements (ROM path, AI runtime), and expected artifacts. Expose via `yaze_test --export-manifest <path>` and `ctest -T mem`-style option. Agents can load it instead of scraping.
|
||||
- **Structured output**: Add `--output-format {text,json,junit}` to `yaze_test` to emit summaries (pass/fail, duration, seed, artifacts) in one file; default to text for humans, JSON for automation. Wire ctest to collect the JSON and place it in a predictable directory.
|
||||
- **Requirements gating**: On startup, detect missing ROM/AI/headless support and fail fast with actionable messages and suggested CMake flags/env (e.g., `YAZE_ENABLE_ROM_TESTS`, `YAZE_TEST_ROM_PATH`). Offer a `--mock-rom-ok` mode to downgrade ROM tests when a mock is acceptable.
|
||||
- **Requirements gating**: On startup, detect missing ROM/AI/headless support and fail fast with actionable messages and suggested CMake flags/env (e.g., `YAZE_ENABLE_ROM_TESTS`, `YAZE_TEST_ROM_VANILLA`). Offer a `--mock-rom-ok` mode to downgrade ROM tests when a mock is acceptable.
|
||||
- **Filters & subsets**: Provide a unified front-end flag set (`--label stable|gui|rom_dependent|experimental`, `--gtest_filter`, `--list`) that internally routes to gtest/labels so humans/agents don’t guess. Add `--shard <N/M>` for parallel runs.
|
||||
- **Artifacts & logs**: Standardize artifact output location (`build/artifacts/tests/<run-id>/`) and name failing-test logs/screenshots accordingly. Emit paths in JSON output. Ensure GUI/agent recordings are captured when labels include `gui` or `experimental`.
|
||||
- **Preset hints**: Print which CMake preset was used to build the binary and whether ROM/AI options are compiled in. Add `--recommend-preset` helper to suggest `mac-test/mac-ai/mac-dev` based on requested labels.
|
||||
|
||||
@@ -44,7 +44,7 @@ This document defines all CMake configuration flags, their interactions, and the
|
||||
|
||||
| Flag | Default | Purpose | Notes |
|
||||
|------|---------|---------|-------|
|
||||
| `YAZE_ENABLE_ROM_TESTS` | OFF | Enable ROM-dependent tests | Requires `zelda3.sfc` file |
|
||||
| `YAZE_ENABLE_ROM_TESTS` | OFF | Enable ROM-dependent tests | Requires vanilla ROM (`alttp_vanilla.sfc`) via `YAZE_TEST_ROM_VANILLA` |
|
||||
| `YAZE_MINIMAL_BUILD` | OFF | Minimal CI build (skip optional features) | Used in resource-constrained CI |
|
||||
| `YAZE_SUPPRESS_WARNINGS` | ON | Suppress compiler warnings | Use OFF for verbose builds |
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ Before investigating audio issues, verify these values are correct:
|
||||
# Build with ROM tests enabled
|
||||
cmake --preset mac-dbg \
|
||||
-DYAZE_ENABLE_ROM_TESTS=ON \
|
||||
-DYAZE_TEST_ROM_PATH=~/zelda3.sfc
|
||||
-DYAZE_TEST_ROM_VANILLA_PATH=~/roms/alttp_vanilla.sfc
|
||||
|
||||
cmake --build --preset mac-dbg
|
||||
|
||||
@@ -29,7 +29,7 @@ cmake --build --preset mac-dbg
|
||||
ctest --test-dir build -L audio -V
|
||||
|
||||
# Run specific test with verbose output
|
||||
YAZE_TEST_ROM_PATH=~/zelda3.sfc ./build/bin/Debug/yaze_test_rom_dependent \
|
||||
YAZE_TEST_ROM_VANILLA=~/roms/alttp_vanilla.sfc ./build/bin/Debug/yaze_test_rom_dependent \
|
||||
--gtest_filter="*AudioTiming*" 2>&1 | tee audio_debug.log
|
||||
|
||||
# Generate timing report
|
||||
@@ -101,7 +101,7 @@ Start yaze with debug flags for audio investigation:
|
||||
|
||||
```bash
|
||||
./yaze --debug --log_file=audio_debug.log \
|
||||
--rom_file=zelda3.sfc --editor=Music
|
||||
--rom_file=roms/alttp_vanilla.sfc --editor=Music
|
||||
```
|
||||
|
||||
## Test Output Files
|
||||
|
||||
@@ -65,7 +65,7 @@ cmake --build build --target yaze_test
|
||||
./build/bin/yaze_test --integration
|
||||
|
||||
# Run with ROM-dependent tests
|
||||
./build/bin/yaze_test --integration --rom-dependent --rom-path zelda3.sfc
|
||||
./build/bin/yaze_test --integration --rom-dependent --rom-vanilla roms/alttp_vanilla.sfc
|
||||
```
|
||||
|
||||
**Coverage Areas**:
|
||||
@@ -159,7 +159,7 @@ scripts/agents/run-tests.sh mac-dbg --output-on-failure
|
||||
./build/bin/yaze_test
|
||||
|
||||
# Run all tests including ROM-dependent
|
||||
./build/bin/yaze_test --rom-dependent --rom-path zelda3.sfc
|
||||
./build/bin/yaze_test --rom-dependent --rom-vanilla roms/alttp_vanilla.sfc
|
||||
|
||||
# Alternative: use ctest with preset
|
||||
ctest --preset dev
|
||||
@@ -300,10 +300,10 @@ Common helpers in `test/test_utils.h`:
|
||||
**Solution**:
|
||||
```bash
|
||||
# Set ROM path environment variable
|
||||
export YAZE_TEST_ROM_PATH=/path/to/zelda3.sfc
|
||||
export YAZE_TEST_ROM_VANILLA=/path/to/alttp_vanilla.sfc
|
||||
|
||||
# Or pass directly
|
||||
./build/bin/yaze_test --rom-path /path/to/zelda3.sfc
|
||||
./build/bin/yaze_test --rom-vanilla /path/to/alttp_vanilla.sfc
|
||||
```
|
||||
|
||||
#### 2. GUI Test Failures in CI
|
||||
|
||||
@@ -12,7 +12,9 @@ The yaze test suite has been reorganized to improve CI performance and developer
|
||||
| `YAZE_ENABLE_ROM_TESTS` | **OFF** | Enable tests requiring ROM files | ROM-dependent tests |
|
||||
| `YAZE_ENABLE_AI_RUNTIME` | **OFF** | Enable AI runtime integration tests | Experimental AI tests |
|
||||
| `YAZE_ENABLE_BENCHMARK_TESTS` | **OFF** | Enable performance benchmarks | Benchmark suite |
|
||||
| `YAZE_TEST_ROM_PATH` | `build/bin/zelda3.sfc` | Path to test ROM file | ROM-dependent tests |
|
||||
| `YAZE_TEST_ROM_VANILLA_PATH` | *(empty)* | Path to vanilla test ROM file | ROM-dependent tests |
|
||||
| `YAZE_TEST_ROM_EXPANDED_PATH` | *(empty)* | Path to expanded test ROM file | Expanded ROM tests |
|
||||
| `YAZE_TEST_ROM_PATH` | *(legacy)* | Legacy vanilla ROM path | ROM-dependent tests |
|
||||
|
||||
## Test Categories and Labels
|
||||
|
||||
@@ -65,7 +67,7 @@ ctest --test-dir build -L stable
|
||||
### With ROM-Dependent Tests
|
||||
```bash
|
||||
# Configure with ROM tests enabled
|
||||
cmake --preset mac-dbg -DYAZE_ENABLE_ROM_TESTS=ON -DYAZE_TEST_ROM_PATH=~/zelda3.sfc
|
||||
cmake --preset mac-dbg -DYAZE_ENABLE_ROM_TESTS=ON -DYAZE_TEST_ROM_VANILLA_PATH=~/roms/alttp_vanilla.sfc
|
||||
cmake --build build
|
||||
ctest --test-dir build -L rom_dependent
|
||||
```
|
||||
@@ -97,7 +99,8 @@ cmake --preset mac-dbg \
|
||||
-DYAZE_ENABLE_ROM_TESTS=ON \
|
||||
-DYAZE_ENABLE_AI_RUNTIME=ON \
|
||||
-DYAZE_ENABLE_BENCHMARK_TESTS=ON \
|
||||
-DYAZE_TEST_ROM_PATH=~/zelda3.sfc
|
||||
-DYAZE_TEST_ROM_VANILLA_PATH=~/roms/alttp_vanilla.sfc \
|
||||
-DYAZE_TEST_ROM_EXPANDED_PATH=~/roms/oos168.sfc
|
||||
cmake --build build
|
||||
ctest --test-dir build
|
||||
```
|
||||
@@ -194,6 +197,6 @@ Ensure:
|
||||
|
||||
### ROM Tests Failing
|
||||
Verify:
|
||||
- ROM file exists at `YAZE_TEST_ROM_PATH`
|
||||
- ROM file exists at `YAZE_TEST_ROM_VANILLA` (or `YAZE_TEST_ROM_EXPANDED` for v3 tests)
|
||||
- ROM is valid Zelda3 US version
|
||||
- Path is absolute, not relative
|
||||
- Path is absolute, not relative
|
||||
|
||||
@@ -82,7 +82,7 @@ void E2ETest_DungeonEditor_PlaceSingleObject(ImGuiTestContext* ctx) {
|
||||
ctx->LogInfo("=== Test: Place Single Object on Canvas ===");
|
||||
|
||||
// Setup
|
||||
gui::LoadRomInTest(ctx, "zelda3.sfc");
|
||||
gui::LoadRomInTest(ctx, yaze::test::TestRomManager::GetTestRomPath());
|
||||
gui::OpenEditorInTest(ctx, "Dungeon");
|
||||
ctx->Yield(20);
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@ These tests are disabled in PR/Push CI but run in nightly builds for comprehensi
|
||||
|
||||
**Requirements to Run Locally:**
|
||||
- CMake flag: `-DYAZE_ENABLE_ROM_TESTS=ON`
|
||||
- ROM path: `-DYAZE_TEST_ROM_PATH=/path/to/zelda3.sfc`
|
||||
- ROM path: `-DYAZE_TEST_ROM_VANILLA_PATH=/path/to/alttp_vanilla.sfc`
|
||||
- Use `mac-dev`, `lin-dev`, `win-dev` presets or configure manually
|
||||
|
||||
**Contents:**
|
||||
@@ -79,7 +79,7 @@ These tests are disabled in PR/Push CI but run in nightly builds for comprehensi
|
||||
|
||||
**Run with:**
|
||||
```bash
|
||||
cmake --preset mac-dev -DYAZE_TEST_ROM_PATH=~/zelda3.sfc
|
||||
cmake --preset mac-dev -DYAZE_TEST_ROM_VANILLA_PATH=~/roms/alttp_vanilla.sfc
|
||||
ctest --test-dir build -L rom_dependent
|
||||
```
|
||||
|
||||
@@ -246,7 +246,7 @@ ctest --test-dir build -L "stable|gui" -j4
|
||||
# Configure with ROM
|
||||
cmake --preset mac-dbg \
|
||||
-DYAZE_ENABLE_ROM_TESTS=ON \
|
||||
-DYAZE_TEST_ROM_PATH=~/zelda3.sfc
|
||||
-DYAZE_TEST_ROM_VANILLA_PATH=~/roms/alttp_vanilla.sfc
|
||||
|
||||
# Build ROM test suite
|
||||
cmake --build --preset mac-dbg --target yaze_test_rom_dependent
|
||||
@@ -332,7 +332,7 @@ TEST(NewFeatureTest, BasicFunctionality) {
|
||||
|
||||
1. Create file: `test/integration/new_feature_test.cc`
|
||||
2. Same pattern as unit tests
|
||||
3. May access ROM files via `YAZE_TEST_ROM_PATH`
|
||||
3. May access ROM files via `YAZE_TEST_ROM_VANILLA` or `TestRomManager`
|
||||
4. Automatically labeled as `stable` (unless in special subdirectory)
|
||||
|
||||
### Adding ROM-Dependent Test
|
||||
@@ -345,7 +345,8 @@ TEST(NewFeatureTest, BasicFunctionality) {
|
||||
```cpp
|
||||
#ifdef YAZE_ENABLE_ROM_TESTS
|
||||
TEST(MyRomTest, EditAndSave) {
|
||||
const char* rom_path = YAZE_TEST_ROM_PATH;
|
||||
const std::string rom_path =
|
||||
yaze::test::TestRomManager::GetRomPath(yaze::test::RomRole::kVanilla);
|
||||
// ... ROM testing code
|
||||
}
|
||||
#endif
|
||||
@@ -370,7 +371,9 @@ TEST(MyRomTest, EditAndSave) {
|
||||
#include "imgui_te_engine.h"
|
||||
|
||||
void E2ETest_MyGuiWorkflow(ImGuiTestContext* ctx) {
|
||||
yaze::test::gui::LoadRomInTest(ctx, "zelda3.sfc");
|
||||
const std::string rom_path =
|
||||
yaze::test::TestRomManager::GetRomPath(yaze::test::RomRole::kVanilla);
|
||||
yaze::test::gui::LoadRomInTest(ctx, rom_path);
|
||||
// ... GUI test code
|
||||
}
|
||||
|
||||
@@ -430,8 +433,8 @@ If ROM tests fail:
|
||||
|
||||
```bash
|
||||
# Verify ROM path is correct
|
||||
echo $YAZE_TEST_ROM_PATH
|
||||
file ~/zelda3.sfc
|
||||
echo $YAZE_TEST_ROM_VANILLA
|
||||
file ~/roms/alttp_vanilla.sfc
|
||||
|
||||
# Check ROM-dependent tests are enabled
|
||||
cmake . | grep YAZE_ENABLE_ROM_TESTS
|
||||
|
||||
@@ -152,6 +152,8 @@ z3ed test-status --format json
|
||||
### Sample Output (JSON)
|
||||
```json
|
||||
{
|
||||
"rom_vanilla": "not set",
|
||||
"rom_expanded": "not set",
|
||||
"rom_path": "not set",
|
||||
"skip_rom_tests": false,
|
||||
"ui_tests_enabled": false,
|
||||
@@ -167,7 +169,9 @@ The test commands respect these environment variables:
|
||||
|
||||
| Variable | Description |
|
||||
|----------|-------------|
|
||||
| `YAZE_TEST_ROM_PATH` | Path to Zelda3 ROM for ROM-dependent tests |
|
||||
| `YAZE_TEST_ROM_VANILLA` | Path to vanilla Zelda3 ROM for ROM-dependent tests |
|
||||
| `YAZE_TEST_ROM_EXPANDED` | Path to expanded Zelda3 ROM (ZSCustom/OOS) |
|
||||
| `YAZE_TEST_ROM_PATH` | Legacy ROM path (vanilla fallback) |
|
||||
| `YAZE_SKIP_ROM_TESTS` | Set to `1` to skip ROM tests |
|
||||
| `YAZE_ENABLE_UI_TESTS` | Set to `1` to enable UI tests |
|
||||
|
||||
@@ -200,7 +204,7 @@ if [ $? -eq 0 ]; then echo "All tests passed"; fi
|
||||
### With ROM Tests
|
||||
```bash
|
||||
# Set ROM path
|
||||
export YAZE_TEST_ROM_PATH=/path/to/zelda3.sfc
|
||||
export YAZE_TEST_ROM_VANILLA=/path/to/alttp_vanilla.sfc
|
||||
|
||||
# Configure with ROM tests enabled
|
||||
cmake --preset mac-dev -DYAZE_ENABLE_ROM_TESTS=ON
|
||||
|
||||
@@ -108,7 +108,7 @@ The `yaze_test` executable is used to run the project's suite of unit, integrati
|
||||
./build/bin/yaze_test --unit
|
||||
|
||||
# Run tests that require a ROM file
|
||||
./build/bin/yaze_test --rom-dependent --rom-path /path/to/zelda3.sfc
|
||||
./build/bin/yaze_test --rom-dependent --rom-vanilla /path/to/alttp_vanilla.sfc
|
||||
```
|
||||
|
||||
- **Run GUI-based E2E Tests**:
|
||||
|
||||
@@ -78,7 +78,7 @@ cmake --build build --target yaze_test
|
||||
./build/bin/yaze_test --e2e --show-gui
|
||||
|
||||
# Run ROM-dependent tests
|
||||
./build/bin/yaze_test --rom-dependent --rom-path /path/to/zelda3.sfc
|
||||
./build/bin/yaze_test --rom-dependent --rom-vanilla /path/to/alttp_vanilla.sfc
|
||||
|
||||
# Run by pattern
|
||||
./build/bin/yaze_test "*Asar*"
|
||||
@@ -91,7 +91,7 @@ cmake --build build --target yaze_test
|
||||
|
||||
```bash
|
||||
# Configure with ROM tests
|
||||
cmake --preset mac-dev -DYAZE_TEST_ROM_PATH=/path/to/zelda3.sfc
|
||||
cmake --preset mac-dev -DYAZE_TEST_ROM_VANILLA_PATH=/path/to/alttp_vanilla.sfc
|
||||
|
||||
# Build
|
||||
cmake --build --preset mac-dev --target yaze_test
|
||||
|
||||
@@ -66,8 +66,8 @@ Run the **complete test suite** before pushing if:
|
||||
# Run all tests (may take 5+ minutes)
|
||||
./build/bin/yaze_test
|
||||
|
||||
# Include ROM-dependent tests (requires zelda3.sfc)
|
||||
./build/bin/yaze_test --rom-dependent --rom-path /path/to/zelda3.sfc
|
||||
# Include ROM-dependent tests (requires alttp_vanilla.sfc)
|
||||
./build/bin/yaze_test --rom-dependent --rom-vanilla /path/to/alttp_vanilla.sfc
|
||||
|
||||
# Run E2E GUI tests (headless)
|
||||
./build/bin/yaze_test --e2e
|
||||
@@ -107,10 +107,10 @@ cmake --build build --target yaze_test
|
||||
**Fix**:
|
||||
```bash
|
||||
# Set environment variable
|
||||
export YAZE_TEST_ROM_PATH=/path/to/zelda3.sfc
|
||||
export YAZE_TEST_ROM_VANILLA=/path/to/alttp_vanilla.sfc
|
||||
|
||||
# Or pass directly to test runner
|
||||
./build/bin/yaze_test --rom-path /path/to/zelda3.sfc
|
||||
./build/bin/yaze_test --rom-vanilla /path/to/alttp_vanilla.sfc
|
||||
```
|
||||
|
||||
### 4. E2E/GUI Test Failures
|
||||
@@ -177,7 +177,7 @@ git push
|
||||
|
||||
```bash
|
||||
# Run everything including ROM tests and E2E
|
||||
./build/bin/yaze_test --rom-dependent --rom-path zelda3.sfc
|
||||
./build/bin/yaze_test --rom-dependent --rom-vanilla roms/alttp_vanilla.sfc
|
||||
./build/bin/yaze_test --e2e
|
||||
|
||||
# Check code formatting
|
||||
@@ -238,7 +238,8 @@ Customize test behavior with these environment variables:
|
||||
|
||||
```bash
|
||||
# Path to test ROM file
|
||||
export YAZE_TEST_ROM_PATH=/path/to/zelda3.sfc
|
||||
export YAZE_TEST_ROM_VANILLA=/path/to/alttp_vanilla.sfc
|
||||
export YAZE_TEST_ROM_EXPANDED=/path/to/oos168.sfc
|
||||
|
||||
# Skip ROM-dependent tests entirely
|
||||
export YAZE_SKIP_ROM_TESTS=1
|
||||
|
||||
@@ -20,8 +20,8 @@
|
||||
|
||||
**ROM Auto-Discovery**:
|
||||
- Tests now automatically discover ROMs in common locations (roms/, ../roms/, etc.)
|
||||
- Searches for common filenames: zelda3.sfc, alttp_vanilla.sfc, vanilla.sfc
|
||||
- Environment variable `YAZE_TEST_ROM_PATH` still takes precedence if set
|
||||
- Searches for common vanilla filenames: alttp_vanilla.sfc, Legend of Zelda, The - A Link to the Past (USA).sfc
|
||||
- Legacy environment variable `YAZE_TEST_ROM_PATH` is still supported as a fallback
|
||||
|
||||
**Overworld Regression Tests**:
|
||||
- Added 9 new regression tests for save function version checks
|
||||
|
||||
Reference in New Issue
Block a user