$ cat docs/core/testing.md
# running the test suite
OpenEngine includes comprehensive integration tests that exercise the asset system, C# scripting, hot-reloading, and C++/C# interop.
Running Tests
bash
cd build
.\bin\Debug\OpenEngine.exeThe main executable runs all integration tests on startup, then enters a 60 FPS main loop for 15 seconds before exiting.
Test Suite Breakdown
1. Asset System Test
- Discovers assets in
Assets/directory - Tests GUID assignment and metadata generation
- Loads texture assets
- Verifies asset registry functionality
2. Script System Test
- Initializes CoreCLR host
- Tests C# script compilation framework
- Verifies .NET integration
3. Hot-Reloading Test
- Creates a test C# script dynamically
- Monitors file changes with platform-native file watchers
- Modifies the script after 5 seconds
- Demonstrates real-time change detection
4. C++ to C# Interop Test
- Tests registered engine functions via P/Invoke
- Verifies bidirectional communication
Expected Output
[INFO] === Running Engine Integration Tests ===
[INFO] === Testing Asset System ===
[INFO] Discovered 3 assets:
[INFO] - README (Unknown): Assets\README.md
[INFO] - test_texture (Texture): Assets\test_texture.png
[INFO] - test_texture (Unknown): Assets\test_texture.txt
[INFO] Successfully loaded texture asset!
[INFO] Texture dimensions: 2x2
[INFO] === Asset System Test Complete ===
[INFO] === Testing Script System ===
[INFO] CoreCLR host is initialized
[INFO] Assembly loaded successfully!
[INFO] === Script System Test Complete ===
[INFO] === Testing Hot-Reloading System ===
[INFO] Creating initial test script...
[DEBUG] Windows file change detected: Scripts\HotReloadTest.cs (1)
[INFO] Hot-reload test initialized. Script will be modified after 5 seconds.
[INFO] === Hot-Reloading Test Setup Complete ===
# ... 60 FPS main loop for 15 seconds ...
[INFO] === Hot-Reload Test: Modifying Script ===
[DEBUG] Windows file change detected: Scripts\HotReloadTest.cs (1)
[INFO] Test run complete, exiting...macOS Smoke Tests
To validate CoreCLR hosting and the compile server on macOS:
bash
chmod +x Tools/Scripts/run-macos-scripting-smoke-tests.sh
./Tools/Scripts/run-macos-scripting-smoke-tests.shThis builds and runs EngineCoreClrSmokeTests and EngineCompileServerSmokeTests via ctest.
Performance Metrics
| Metric | Expected |
|---|---|
| Frame Rate | 60 FPS stable |
| File Change Detection | <1ms |
| Asset Discovery | <10ms |
| Engine Startup | <200ms |
| Memory Usage | <100MB (basic projects) |
Next Steps
- Start the Development Workflow
- Learn about the Build System for custom configs