- Added `UnifiedGRPCServer` class to host both ImGuiTestHarness and ROM service, allowing simultaneous access to GUI automation and ROM manipulation. - Implemented necessary header and source files for the unified server, including initialization, start, and shutdown functionalities. - Updated CMake configurations to include new source files and link required gRPC libraries for the unified server. - Enhanced existing services with gRPC support, improving overall system capabilities and enabling real-time collaboration. - Added integration tests for AI-controlled tile placement, validating command parsing and execution via gRPC.
yaze Test Suite
This directory contains the comprehensive test suite for YAZE, organized for optimal AI agent testing and development workflow.
Directory Structure
test/
├── unit/ # Unit tests for individual components
│ ├── core/ # Core functionality tests
│ ├── rom/ # ROM handling tests
│ ├── gfx/ # Graphics system tests
│ └── zelda3/ # Zelda 3 specific tests
├── integration/ # Integration tests
│ ├── editor/ # Editor integration tests
│ ├── asar_integration_test.cc
│ ├── asar_rom_test.cc
│ └── dungeon_editor_test.cc
├── e2e/ # End-to-end tests
│ ├── rom_dependent/ # ROM-dependent E2E tests
│ └── zscustomoverworld/ # ZSCustomOverworld upgrade tests
├── deprecated/ # Outdated tests (for cleanup)
│ └── emu/ # Deprecated emulator tests
├── mocks/ # Mock objects for testing
├── assets/ # Test assets and patches
└── yaze_test.cc # Enhanced test runner
Test Categories
Unit Tests (unit/)
- Core: ASAR wrapper, hex utilities, core functionality
- ROM: ROM loading, saving, validation
- Graphics: SNES tiles, palettes, compression
- Zelda3: Message system, overworld, objects, sprites
Integration Tests (integration/)
- Editor: Tile editor, dungeon editor integration
- ASAR: ASAR integration and ROM patching
- Dungeon: Dungeon editor system integration
End-to-End Tests (e2e/)
- ROM Dependent: Complete ROM editing workflow validation
- ZSCustomOverworld: Version upgrade testing (vanilla → v2 → v3)
Enhanced Test Runner
The yaze_test executable now supports comprehensive argument handling for AI agents:
Usage Examples
# Run all tests
./yaze_test
# Run specific test categories
./yaze_test --unit --verbose
./yaze_test --integration
./yaze_test --e2e --rom-path my_rom.sfc
./yaze_test --zscustomoverworld --verbose
# Run specific test patterns
./yaze_test RomTest.*
./yaze_test *ZSCustomOverworld*
# Skip ROM-dependent tests
./yaze_test --skip-rom-tests
# Enable UI tests
./yaze_test --enable-ui-tests
Test Modes
--unit: Unit tests only--integration: Integration tests only--e2e: End-to-end tests only--rom-dependent: ROM-dependent tests only--zscustomoverworld: ZSCustomOverworld tests only--core: Core functionality tests--graphics: Graphics tests--editor: Editor tests--deprecated: Deprecated tests (for cleanup)
Options
--rom-path PATH: Specify ROM path for testing--skip-rom-tests: Skip tests requiring ROM files--enable-ui-tests: Enable UI tests (requires display)--verbose: Enable verbose output--help: Show help message
E2E ROM Testing
The E2E ROM test suite (e2e/rom_dependent/e2e_rom_test.cc) provides comprehensive validation of the complete ROM editing workflow:
- Load vanilla ROM
- Apply various edits (overworld, dungeon, graphics, etc.)
- Save changes
- Reload ROM and verify edits persist
- Verify no data corruption occurred
Test Cases
BasicROMLoadSave: Basic ROM loading and savingOverworldEditWorkflow: Complete overworld editing workflowDungeonEditWorkflow: Complete dungeon editing workflowTransactionSystem: Multi-edit transaction validationCorruptionDetection: ROM corruption detectionLargeScaleEditing: Large-scale editing without corruption
ZSCustomOverworld Upgrade Testing
The ZSCustomOverworld test suite (e2e/zscustomoverworld/zscustomoverworld_upgrade_test.cc) validates version upgrades:
Supported Upgrades
- Vanilla → v2: Basic upgrade with main palettes
- v2 → v3: Advanced upgrade with expanded features
- Vanilla → v3: Direct upgrade to latest version
Test Cases
VanillaBaseline: Validate vanilla ROM baselineVanillaToV2Upgrade: Test vanilla to v2 upgradeV2ToV3Upgrade: Test v2 to v3 upgradeVanillaToV3Upgrade: Test direct vanilla to v3 upgradeAddressValidation: Validate version-specific addressesSaveCompatibility: Test save compatibility between versionsFeatureToggle: Test feature enablement/disablementDataIntegrity: Test data integrity during upgrades
Version-Specific Features
Vanilla
- Basic overworld functionality
- Standard message IDs, area graphics, palettes
v2
- Main palettes support
- Expanded message ID table
v3
- Area-specific background colors
- Subscreen overlays
- Animated GFX
- Custom tile GFX groups
- Mosaic effects
Environment Variables
YAZE_TEST_ROM_PATH: Path to test ROM fileYAZE_SKIP_ROM_TESTS: Skip ROM-dependent testsYAZE_ENABLE_UI_TESTS: Enable UI testsYAZE_VERBOSE_TESTS: Enable verbose test output
CI/CD Integration
Tests are automatically labeled for CI/CD:
unit: Fast unit testsintegration: Medium-speed integration testse2e: Slow end-to-end testsrom: ROM-dependent testszscustomoverworld: ZSCustomOverworld specific testscore: Core functionality testsgraphics: Graphics testseditor: Editor testsdeprecated: Deprecated tests
Deprecated Tests
The deprecated/ directory contains outdated tests that no longer pass after the large refactor:
- EMU tests: CPU, PPU, SPC700, APU tests that are no longer compatible
- These tests are kept for reference but should not be run in CI/CD
Best Practices
- Use appropriate test categories for new tests
- Add comprehensive E2E tests for new features
- Test upgrade paths for ZSCustomOverworld features
- Validate data integrity in all ROM operations
- Use descriptive test names for AI agent clarity
- Include verbose output for debugging
AI Agent Testing
The enhanced test runner is specifically designed for AI agent testing:
- Clear argument structure for easy automation
- Comprehensive help system for understanding capabilities
- Verbose output for debugging and validation
- Flexible test filtering for targeted testing
- Environment variable support for configuration