summaryrefslogtreecommitdiff
path: root/src/tests/test_demo_effects.cc
AgeCommit message (Collapse)Author
17 hourstest(gpu): Add automatic validation for effect test coverageskal
Problem: When new effects are added to demo_effects.h, developers might forget to update test_demo_effects.cc, leading to untested code. Solution: Added compile-time constants and runtime assertions to enforce test coverage: 1. Added EXPECTED_POST_PROCESS_COUNT = 8 2. Added EXPECTED_SCENE_COUNT = 6 3. Runtime validation in each test function 4. Fails with clear error message if counts don't match Error message when validation fails: ✗ COVERAGE ERROR: Expected N effects, but only tested M! ✗ Did you add a new effect without updating the test? ✗ Update EXPECTED_*_COUNT in test_demo_effects.cc Updated CONTRIBUTING.md with mandatory test update requirement: - Added step 3 to "Adding a New Visual Effect" workflow - Clear instructions on updating effect counts - Verification command examples This ensures no effect can be added without corresponding test coverage. Tested validation by intentionally breaking count - error caught correctly.
17 hourstest(gpu): Add comprehensive effect class testing (Phase 2.1)skal
Created test_demo_effects.cc to validate all effect classes: - Tests 8 post-process effects (FlashEffect, PassthroughEffect, GaussianBlurEffect, ChromaAberrationEffect, DistortEffect, SolarizeEffect, FadeEffect, ThemeModulationEffect) - Tests 6 scene effects (HeptagonEffect, ParticlesEffect, ParticleSprayEffect, MovingEllipseEffect, FlashCubeEffect, Hybrid3DEffect) - Gracefully skips effects requiring full Renderer3D pipeline (FlashCubeEffect, Hybrid3DEffect) with warning messages - Validates effect type classification (is_post_process()) Test approach: Smoke tests for construction and initialization - Construct effect → Add to Sequence → Sequence::init() - Verify is_initialized flag transitions from false → true - No crashes during initialization Added CMake target with proper dependencies: - Links against gpu, 3d, audio, procedural, util libraries - Depends on generate_timeline and generate_demo_assets Coverage: Adds validation for all 14 production effect classes Zero binary size impact: All test code under #if !defined(STRIP_ALL) Part of GPU Effects Test Infrastructure (Phase 2/3) Next: test_post_process_helper.cc (Phase 2.2)