From 1aa0eadbe9e0d7581d8c64f896efae544e2e2e0a Mon Sep 17 00:00:00 2001 From: skal Date: Sat, 7 Feb 2026 09:13:36 +0100 Subject: test: Add platform test coverage (test_platform.cc) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Created comprehensive test suite for platform windowing abstraction: Tests implemented: - String view helpers (Win32 vs native WebGPU API) - PlatformState default initialization - platform_get_time() with GLFW context - Platform lifecycle (init, poll, shutdown) - Fullscreen toggle state tracking Coverage impact: platform.cc 0% → ~70% (7 functions tested) Files: - src/tests/test_platform.cc (new, 180 lines) - CMakeLists.txt (added test_platform target) - PLATFORM_ANALYSIS.md (detailed analysis report) All tests pass on macOS with GLFW windowing. Related: Side quest to improve platform code coverage --- CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 74ecee2..5828db7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -482,6 +482,9 @@ if(DEMO_BUILD_TESTS) add_demo_executable(test_mesh src/tests/test_mesh.cc ${PLATFORM_SOURCES} ${GENERATED_TIMELINE_CC} ${GEN_DEMO_CC} ${GENERATED_MUSIC_DATA_CC}) target_link_libraries(test_mesh PRIVATE 3d gpu audio procedural util ${DEMO_LIBS}) add_dependencies(test_mesh generate_timeline generate_demo_assets generate_tracker_music) + + add_demo_executable(test_platform src/tests/test_platform.cc ${PLATFORM_SOURCES}) + target_link_libraries(test_platform PRIVATE util ${DEMO_LIBS}) endif() #-- - Extra Tools -- - -- cgit v1.2.3