2026-03-17 19:38:27 +08:00
|
|
|
# ============================================================
|
|
|
|
|
# Resources Library Tests
|
|
|
|
|
# ============================================================
|
|
|
|
|
|
|
|
|
|
set(RESOURCES_TEST_SOURCES
|
|
|
|
|
test_resource_types.cpp
|
|
|
|
|
test_resource_guid.cpp
|
2026-03-17 22:50:21 +08:00
|
|
|
test_iresource.cpp
|
2026-03-17 23:07:33 +08:00
|
|
|
test_resource_handle.cpp
|
|
|
|
|
test_resource_cache.cpp
|
2026-03-17 23:45:06 +08:00
|
|
|
test_iresource_loader.cpp
|
|
|
|
|
test_texture.cpp
|
|
|
|
|
test_mesh.cpp
|
|
|
|
|
test_audio_clip.cpp
|
2026-03-18 00:09:06 +08:00
|
|
|
test_resource_filesystem.cpp
|
|
|
|
|
test_file_archive.cpp
|
|
|
|
|
test_shader.cpp
|
|
|
|
|
test_material.cpp
|
|
|
|
|
test_texture_loader.cpp
|
|
|
|
|
test_mesh_loader.cpp
|
|
|
|
|
test_audio_loader.cpp
|
|
|
|
|
test_shader_loader.cpp
|
|
|
|
|
test_material_loader.cpp
|
2026-03-18 00:49:22 +08:00
|
|
|
test_resource_package.cpp
|
2026-03-18 01:13:02 +08:00
|
|
|
test_resource_dependency.cpp
|
2026-03-18 13:39:32 +08:00
|
|
|
test_texture_import_settings.cpp
|
|
|
|
|
test_mesh_import_settings.cpp
|
|
|
|
|
test_resource_path.cpp
|
2026-03-17 19:38:27 +08:00
|
|
|
)
|
|
|
|
|
|
refactor: improve test infrastructure and fix OpenGL GLAD initialization
- Rename D3D12Enum.h to D3D12Enums.h for naming consistency
- Fix OpenGL unit test GLAD initialization by using gladLoadGL()
instead of gladLoadGLLoader(wglGetProcAddress) for fallback support
- Migrate remaining tests to use gtest_discover_tests for granular
test discovery (math, core, containers, memory, threading, debug,
components, scene, resources, input, opengl)
- Remove obsolete TEST_RESOURCES_DIR and copy_directory commands
from OpenGL unit test CMakeLists (minimal/Res doesn't exist)
- Update TEST_SPEC.md with performance metrics and per-module
build/test commands for faster development workflow
- Update CMake path references to use lowercase paths
2026-03-23 00:43:02 +08:00
|
|
|
add_executable(resources_tests ${RESOURCES_TEST_SOURCES})
|
2026-03-17 19:38:27 +08:00
|
|
|
|
|
|
|
|
if(MSVC)
|
refactor: improve test infrastructure and fix OpenGL GLAD initialization
- Rename D3D12Enum.h to D3D12Enums.h for naming consistency
- Fix OpenGL unit test GLAD initialization by using gladLoadGL()
instead of gladLoadGLLoader(wglGetProcAddress) for fallback support
- Migrate remaining tests to use gtest_discover_tests for granular
test discovery (math, core, containers, memory, threading, debug,
components, scene, resources, input, opengl)
- Remove obsolete TEST_RESOURCES_DIR and copy_directory commands
from OpenGL unit test CMakeLists (minimal/Res doesn't exist)
- Update TEST_SPEC.md with performance metrics and per-module
build/test commands for faster development workflow
- Update CMake path references to use lowercase paths
2026-03-23 00:43:02 +08:00
|
|
|
set_target_properties(resources_tests PROPERTIES
|
2026-03-17 19:38:27 +08:00
|
|
|
LINK_FLAGS "/NODEFAULTLIB:libcpmt.lib /NODEFAULTLIB:libcmt.lib"
|
|
|
|
|
)
|
|
|
|
|
endif()
|
|
|
|
|
|
refactor: improve test infrastructure and fix OpenGL GLAD initialization
- Rename D3D12Enum.h to D3D12Enums.h for naming consistency
- Fix OpenGL unit test GLAD initialization by using gladLoadGL()
instead of gladLoadGLLoader(wglGetProcAddress) for fallback support
- Migrate remaining tests to use gtest_discover_tests for granular
test discovery (math, core, containers, memory, threading, debug,
components, scene, resources, input, opengl)
- Remove obsolete TEST_RESOURCES_DIR and copy_directory commands
from OpenGL unit test CMakeLists (minimal/Res doesn't exist)
- Update TEST_SPEC.md with performance metrics and per-module
build/test commands for faster development workflow
- Update CMake path references to use lowercase paths
2026-03-23 00:43:02 +08:00
|
|
|
target_link_libraries(resources_tests
|
2026-03-17 19:38:27 +08:00
|
|
|
PRIVATE
|
|
|
|
|
XCEngine
|
|
|
|
|
GTest::gtest
|
|
|
|
|
GTest::gtest_main
|
|
|
|
|
)
|
|
|
|
|
|
refactor: improve test infrastructure and fix OpenGL GLAD initialization
- Rename D3D12Enum.h to D3D12Enums.h for naming consistency
- Fix OpenGL unit test GLAD initialization by using gladLoadGL()
instead of gladLoadGLLoader(wglGetProcAddress) for fallback support
- Migrate remaining tests to use gtest_discover_tests for granular
test discovery (math, core, containers, memory, threading, debug,
components, scene, resources, input, opengl)
- Remove obsolete TEST_RESOURCES_DIR and copy_directory commands
from OpenGL unit test CMakeLists (minimal/Res doesn't exist)
- Update TEST_SPEC.md with performance metrics and per-module
build/test commands for faster development workflow
- Update CMake path references to use lowercase paths
2026-03-23 00:43:02 +08:00
|
|
|
target_include_directories(resources_tests PRIVATE
|
2026-03-17 19:38:27 +08:00
|
|
|
${CMAKE_SOURCE_DIR}/engine/include
|
|
|
|
|
${CMAKE_SOURCE_DIR}/tests/fixtures
|
|
|
|
|
)
|
|
|
|
|
|
refactor: improve test infrastructure and fix OpenGL GLAD initialization
- Rename D3D12Enum.h to D3D12Enums.h for naming consistency
- Fix OpenGL unit test GLAD initialization by using gladLoadGL()
instead of gladLoadGLLoader(wglGetProcAddress) for fallback support
- Migrate remaining tests to use gtest_discover_tests for granular
test discovery (math, core, containers, memory, threading, debug,
components, scene, resources, input, opengl)
- Remove obsolete TEST_RESOURCES_DIR and copy_directory commands
from OpenGL unit test CMakeLists (minimal/Res doesn't exist)
- Update TEST_SPEC.md with performance metrics and per-module
build/test commands for faster development workflow
- Update CMake path references to use lowercase paths
2026-03-23 00:43:02 +08:00
|
|
|
include(GoogleTest)
|
|
|
|
|
gtest_discover_tests(resources_tests)
|