docs: update ROM test paths and envs

This commit is contained in:
scawful
2025-12-22 14:50:57 -05:00
parent 42ae359abc
commit 319e903f24
22 changed files with 102 additions and 73 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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);

View File

@@ -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