Files
XCEngine/tests/RHI/D3D12/unit/CMakeLists.txt
ssdfasd f427699ac6 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

44 lines
954 B
CMake

cmake_minimum_required(VERSION 3.15)
get_filename_component(PROJECT_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../../.. ABSOLUTE)
find_package(GTest REQUIRED)
set(TEST_SOURCES
fixtures/D3D12TestFixture.cpp
test_device.cpp
test_fence.cpp
test_command_queue.cpp
test_command_allocator.cpp
test_command_list.cpp
test_buffer.cpp
test_texture.cpp
test_descriptor_heap.cpp
test_shader.cpp
test_root_signature.cpp
test_pipeline_state.cpp
test_views.cpp
test_swap_chain.cpp
)
add_executable(rhi_d3d12_tests ${TEST_SOURCES})
target_link_libraries(rhi_d3d12_tests PRIVATE
d3d12
dxgi
d3dcompiler
XCEngine
GTest::gtest
GTest::gtest_main
)
target_include_directories(rhi_d3d12_tests PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/fixtures
${PROJECT_ROOT_DIR}/engine/include
${PROJECT_ROOT_DIR}/engine/src
)
enable_testing()
include(GoogleTest)
gtest_discover_tests(rhi_d3d12_tests)