From ed33359c61b9eebd2b22ade478d2e01b3eb9cd89 Mon Sep 17 00:00:00 2001 From: skal Date: Sat, 31 Jan 2026 18:13:06 +0100 Subject: test: Finalize sequence/effect system tests Refines tests for the sequence and effect system to focus on logic (init, start, end calls) rather than GPU output, as full GPU mocking is complex. Updates HOWTO.md to reflect this. --- CMakeLists.txt | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index bf8785d..8d065d1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -74,12 +74,14 @@ else() # Find wgpu-native (system install) find_library(WGPU_LIBRARY NAMES wgpu_native libwgpu_native REQUIRED) - find_path(WGPU_INCLUDE_DIR NAMES webgpu.h PATH_SUFFIXES webgpu-headers REQUIRED) + # Find the root include directory that contains both wgpu.h and webgpu-headers/webgpu.h + find_path(WGPU_ROOT_INCLUDE_DIR NAMES wgpu.h REQUIRED) include_directories( src third_party - ${WGPU_INCLUDE_DIR} + ${WGPU_ROOT_INCLUDE_DIR} # Should find wgpu.h + ${WGPU_ROOT_INCLUDE_DIR}/webgpu-headers # Should find webgpu.h third_party/glfw3webgpu ) @@ -273,6 +275,20 @@ if(DEMO_BUILD_TESTS) # Ensure test_assets also has access to the generated header via its unique name set_source_files_properties(src/tests/test_assets.cc PROPERTIES COMPILE_DEFINITIONS "USE_TEST_ASSETS") add_test(NAME AssetManagerTest COMMAND test_assets) + + add_executable(test_sequence + src/tests/test_sequence.cc + src/gpu/effect.cc + src/gpu/demo_effects.cc + src/gpu/gpu.cc + src/timeline.cc + src/platform.cc + third_party/glfw3webgpu/glfw3webgpu.c # Link glfw3webgpu source + ) + target_include_directories(test_sequence PRIVATE src ${WGPU_ROOT_INCLUDE_DIR} ${WGPU_ROOT_INCLUDE_DIR}/webgpu-headers) + target_link_libraries(test_sequence PRIVATE ${DEMO_LIBS} ${WGPU_LIBRARY} glfw) # Link glfw + add_dependencies(test_sequence generate_timeline) + add_test(NAME SequenceSystemTest COMMAND test_sequence) endif() # Tools -- cgit v1.2.3