Repository navigation
Test Suite Audit
Audience: Programmers | Mixed
Thread Context: N/A (audit/reference)
Platform/Backend Scope: All platforms (tests run headless / NullRHI; many use standalone reimplementations for CI)
A coverage analysis of SparkEngine's test suite: how many tests exist, which subsystems they cover, and where gaps remain. The suite has grown substantially since the original audit (April 2026): from 297 test files / 3,647 tests to 485 files / ~5,991 tests as of 2026-06-08. Most of the original audit's "critical missing test suite" and "medium priority" gaps have since been filled.
| Metric | Value |
|---|---|
C++ test files under Tests/
|
485 |
Total TEST / TEST_F macros |
~5,991 |
Engine headers (SparkEngine/Source) |
523 |
Editor headers (SparkEditor/Source) |
126 |
| GameModule headers | 115 |
Measurement commands:
find Tests -name '*.cpp' | wc -l
grep -rcE '\b(TEST|TEST_F)\s*\(' Tests --include='*.cpp' | awk -F: '{s+=$2} END{print s}'The original audit listed Priority-1 systems with zero dedicated tests. Most have since gained orchestration tests; the audit's own "Phase 1/2" recommendations were largely executed.
| Original gap (Priority 1/2) | Status |
|---|---|
| NetworkManager orchestration | Addressed — networking has expanded coverage (e.g. TestNetworkManager*, plus existing TestNetBuffer, TestReliableChannel, TestNetworkEncryption) |
| ECSystems ordering / SystemManager | Addressed |
| MaterialSystem validation | Addressed |
| AssetPipeline cache (LRU) | Addressed |
| EngineSettings parser | Addressed |
| PerceptionSystem math | Addressed |
| InputManager state | Addressed |
| GamepadInput processing | Addressed |
| Camera transforms | Addressed |
| WorldServer / AreaServer routing | Partial → expanded |
The audit's "MEDIUM" tier was already marked resolved in the source document at the time of writing: TestAudioMixerBus, TestMusicManager (24 tests), TestAngelScriptEngine (14), TestScriptHotReload (16), TestConsoleVariables, TestVRSystem (12), TestWeaponMechanics, TestGameObjectTransforms, TestSeamlessAreaManager (12) all exist.
These categories were the original audit's standing weak spots and remain the most likely places to find untested code:
-
Editor systems (
SparkEditor/Source, 126 headers): Historically ~4% tested. The most testable-without-GPU targets remainUndoRedoManager,CommandPalette,PrefabManager(now covered byTests/TestEditorSubsystemsReal.cpp),SceneSerializer,EditorLayoutManager,VersionControlSystem(Tests/TestVersionControlSystemGitReal.cpp),LevelStreamingSystem, and gizmo transform math (Tests/TestEditorGizmoTransformReal.cpp);AssetDatabasewas deleted (no production caller). - Game modules (115 headers across 10 modules): Per-module mechanic tests are uneven. FPS and MMO have coverage; RPG/ARPG/RTS/Racing/Platformer/OpenWorld/VisualScript modules are lighter.
-
RHI backend implementations (
D3D11Device,D3D12Device,VulkanDevice,MetalDevice,OpenGLDevice): require hardware; tested implicitly via NullRHI and standalone logic tests.
These do not need dedicated unit tests:
-
Platform stubs (
PlatformDirectXMathStubs,PlatformD3DStubs,PlatformAudioStubs) — exercised implicitly. -
Type / enum headers (
AnimationTypes,PhysicsTypes,RHITypes,GraphicsEnums) — data-only. -
Trivial helpers (
MakeDesc,DrawSortKey,LogMacros). -
Diagnostic debug tools (
CpuDebugger,ThreadDebugger,CacheDebugger,IODebugger).
- Framework: custom
TestFramework.hwithEXPECT/ASSERTmacros (not GoogleTest). - Naming:
Test<SystemName>.cpp. - A large majority of tests use standalone reimplementations (no engine/DirectXMath headers) for CI/Linux portability.
- All test files are registered in
Tests/CMakeLists.txtand run via CTest:
cd build && ctest --output-on-failure --no-tests=errorSee also the maintained AUTO: test inventory in wiki/.../Testing.md, regenerated by docs/sync-wiki.sh sync.
-
Original audit:
.claude/knowledge/test-suite-audit.md, last updated 2026-04-04. - Re-measured against codebase 2026-06-08.
- OLD → NEW numbers updated:
- Test files OLD 297 → NEW 485.
- Total
TEST/TEST_FOLD 3,647 → NEW ~5,991 (consistent withCLAUDE.md's "~5,962 across ~484 files"). - Engine headers OLD 405 → NEW 523.
- Editor headers OLD 109 → NEW 126.
- GameModule headers OLD 102 → NEW 115.
- Findings now resolved since the original audit:
- The five Priority-1 "critical, zero-test" systems (NetworkManager, ECSystems, MaterialSystem, AssetPipeline, EngineSettings) and the Priority-2 set (Perception, Input, Gamepad, Camera, WorldServer) now have coverage — the audit's Phase 1/2 plan was executed.
- The entire MEDIUM tier was already resolved in-source (audio, scripting, CVars, VR, weapons, transforms, seamless streaming).
- Still open: editor and game-module coverage remain the primary gaps.
Published from 2b03dc797148. Edit the canonical source in wiki/.
- Documentation
- Docs route
- Wiki index
- Guides
- Tutorials
- Samples
- Examples
- API Reference
- API route
- Reference
- Build Guide
- Dependencies
- FAQ
- Changelog
- Roadmap
- Contributing
- Code of Conduct
- Home
- FAQ
- Getting Started
- Quick-Start Tutorial
- Making Your First Game
- Making Your First Multiplayer Game
- Artist Workflow Guide
- Editor Walkthrough
- Migration Guide
- How SparkEngine Works
- Architecture Overview
- Engine Architecture Flowchart
- Creating a Game Module
- Game Modules (catalog)
- Entity Component System
- Rendering and Graphics
- Physics
- Cloth Simulation
- Audio
- Input System
- Camera System
- Scripting with AngelScript
- Visual Scripting
- AI and Navigation
- Animation
- 2D Systems
- Networking
- Dedicated Server
- Multiplayer Quick Start
- Area Server Architecture
- Scene Management
- Large World Support
- Collaborative Editing
- Coroutine System
- Event System
- Event Response System
- Job System
- UI System
- UI Layout Extensions
- Localization
- Dialogue System
- Destruction System
- Replay System
- Achievement System
- Loading System
- Mod System
- Content Delivery
- Tween System
- Memory Integrity
- Gameplay Systems
- Terrain and Procedural Generation
- Save System
- Persistence System
- Day Night Cycle and Weather
- Cinematic Sequencer
- Runtime Prefabs
- SparkEditor
- Editor Tutorials
- SparkConsole
- SparkDaemon
- Shader Pipeline
- Asset Pipeline
- Asset Validation
- Asset Migration
- Game Packaging
- Online Services
- DataTable System
- Loot and Crafting System
- CSG System
- Font System
- Timer Manager
- Movie Render Pipeline
- HLOD and World Partition
- Remote Debug System
- Selection Manager
- Asset Dependency Graph
- Editor Automation
- File Watcher
- Project Templates
- System Requirements
- VR Support
- Mobile Platform
- Accessibility
- Platform Input
- Platform Certification
- Cross-Compilation: Wine Testing
- RHI Abstraction Layer
- D3D11 Backend
- D3D12 Backend
- Vulkan Backend
- OpenGL Backend
- Metal Backend
- DXR Raytracing
- Hybrid Ray Tracing
- Upscaling (DLSS/FSR)
- Render Graph
- Shader Graph
- GPU Particles
- GPU-Driven Rendering
- Volumetric Fog
- Volumetric Clouds
- Global Illumination
- Virtual Texturing
- Water Rendering
- Clustered Lighting
- Material System
- Post-Processing
- Shadow System
- Particle System
- Decal System
- Sky and Atmosphere
- Foliage System
- Mesh Shaders
- Neural Rendering
- Configuration Reference
- Performance Tips
- Benchmark Framework
- Threading Model
- Fuzz Policy and Parser Security
- Memory Safety
- Memory Management Patterns
- Build System and CMake Modules
- Profiler and Debugging
- Performance Profiling Guide
- Telemetry System
- Crash Reporting
- Golden Image Testing
- Utilities
- Testing
- Fuzz Policy and Parser Security
- Codebase Statistics
- Codebase Health
- Error Handling Patterns
- Hot Reload Overview
- Troubleshooting
- Contributing
- Workflow Patterns
- Build Optimizations
- CI Reproducible Builds
- GitHub API and PR Checks
- Git Rebase Conflicts
- Clang-Format
- Code Quality Violations
- AI Bloat Pattern
- MinGW + Wine Cross-Compilation
- Live Editor Testing
- Engine & Renderer Landscape
- DuetOS Portability Catalog
- Five-Engine Analysis
- Eleven-Engine Analysis
- ThorVG / Unity Graphics Analysis
- Advanced Techniques Catalog
- Third-Party Library Evaluation
- Engine Viability Evaluation
- Engine Feature Recommendations
- Project Recommendations
- Mac Compatibility Analysis
- Codebase Observations
- Codebase Bloat Audit
- Test Suite Audit
- Documentation Coverage Audit
- ThirdParty Dependencies Audit
- Load Test Baseline
- Gameplay Systems Status
- SparkGame Module Status
- Stub and Abandoned Features
- Memory Integrity System
- Memory Safety Evaluation
- Hardware Acceleration Systems
- Jolt Physics Integration
- GPU/CPU Separation Plan
- Daemon Services Architecture
- Reflection & Polymorphism Refactoring Plan
- SparkBuild In-Tree
- Wine No-JobSystem Breakthrough
- Wine Role and Fallback Tiers