2026-03-20 19:17:20 +08:00
|
|
|
cmake_minimum_required(VERSION 3.15)
|
|
|
|
|
|
|
|
|
|
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
|
|
|
|
|
|
2026-03-23 20:32:33 +08:00
|
|
|
project(d3d12_sphere_test)
|
2026-03-20 19:17:20 +08:00
|
|
|
|
|
|
|
|
set(ENGINE_ROOT_DIR ${CMAKE_SOURCE_DIR}/engine)
|
|
|
|
|
|
2026-03-23 20:32:33 +08:00
|
|
|
add_executable(d3d12_sphere_test
|
2026-03-20 19:17:20 +08:00
|
|
|
WIN32
|
|
|
|
|
main.cpp
|
|
|
|
|
)
|
|
|
|
|
|
2026-03-23 20:32:33 +08:00
|
|
|
target_include_directories(d3d12_sphere_test PRIVATE
|
2026-03-20 19:17:20 +08:00
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}
|
|
|
|
|
${ENGINE_ROOT_DIR}/include
|
|
|
|
|
${ENGINE_ROOT_DIR}
|
|
|
|
|
)
|
|
|
|
|
|
2026-03-23 20:32:33 +08:00
|
|
|
target_compile_definitions(d3d12_sphere_test PRIVATE
|
2026-03-20 19:17:20 +08:00
|
|
|
UNICODE
|
|
|
|
|
_UNICODE
|
|
|
|
|
)
|
|
|
|
|
|
2026-03-23 20:32:33 +08:00
|
|
|
target_link_libraries(d3d12_sphere_test PRIVATE
|
2026-03-20 19:17:20 +08:00
|
|
|
d3d12
|
|
|
|
|
dxgi
|
|
|
|
|
d3dcompiler
|
|
|
|
|
winmm
|
|
|
|
|
XCEngine
|
|
|
|
|
)
|
|
|
|
|
|
2026-03-23 20:32:33 +08:00
|
|
|
add_custom_command(TARGET d3d12_sphere_test POST_BUILD
|
2026-03-20 19:17:20 +08:00
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/Res
|
2026-03-23 20:32:33 +08:00
|
|
|
$<TARGET_FILE_DIR:d3d12_sphere_test>/Res
|
2026-03-20 19:17:20 +08:00
|
|
|
)
|
|
|
|
|
|
2026-03-23 20:32:33 +08:00
|
|
|
add_custom_command(TARGET d3d12_sphere_test POST_BUILD
|
2026-03-20 19:17:20 +08:00
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
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
|
|
|
${CMAKE_SOURCE_DIR}/tests/rhi/d3d12/integration/compare_ppm.py
|
2026-03-23 20:32:33 +08:00
|
|
|
$<TARGET_FILE_DIR:d3d12_sphere_test>/
|
2026-03-20 19:17:20 +08:00
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
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
|
|
|
${CMAKE_SOURCE_DIR}/tests/rhi/d3d12/integration/run_integration_test.py
|
2026-03-23 20:32:33 +08:00
|
|
|
$<TARGET_FILE_DIR:d3d12_sphere_test>/
|
2026-03-22 21:41:56 +08:00
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/GT.ppm
|
2026-03-23 20:32:33 +08:00
|
|
|
$<TARGET_FILE_DIR:d3d12_sphere_test>/
|
2026-03-24 05:00:38 +08:00
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
|
|
|
|
${ENGINE_ROOT_DIR}/third_party/renderdoc/renderdoc.dll
|
|
|
|
|
$<TARGET_FILE_DIR:d3d12_sphere_test>/
|
2026-03-20 19:17:20 +08:00
|
|
|
)
|
|
|
|
|
|
2026-03-23 20:32:33 +08:00
|
|
|
add_test(NAME d3d12_sphere_test
|
|
|
|
|
COMMAND ${Python3_EXECUTABLE} $<TARGET_FILE_DIR:d3d12_sphere_test>/run_integration_test.py
|
|
|
|
|
$<TARGET_FILE:d3d12_sphere_test>
|
2026-03-22 21:41:56 +08:00
|
|
|
sphere.ppm
|
2026-03-20 19:17:20 +08:00
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/GT.ppm
|
2026-03-22 21:41:56 +08:00
|
|
|
0
|
2026-03-23 20:32:33 +08:00
|
|
|
WORKING_DIRECTORY $<TARGET_FILE_DIR:d3d12_sphere_test>
|
2026-03-20 19:17:20 +08:00
|
|
|
)
|