Files
XCEngine/tests/RHI/D3D12/unit/CMakeLists.txt
ssdfasd a4e7785751 fix: use gtest_discover_tests for granular CTest test discovery
Replace add_test() with gtest_discover_tests() to enable CTest to
discover all 55 individual Google Test cases instead of treating them
as a single test. This improves test reporting granularity from 1/1
to 55/55 tests.
2026-03-22 21:53:42 +08:00

46 lines
968 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(d3d12_engine_tests ${TEST_SOURCES})
target_link_libraries(d3d12_engine_tests PRIVATE
d3d12
dxgi
d3dcompiler
XCEngine
GTest::gtest
GTest::gtest_main
)
target_include_directories(d3d12_engine_tests PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/fixtures
${PROJECT_ROOT_DIR}/engine/include
${PROJECT_ROOT_DIR}/engine/src
)
enable_testing()
include(GoogleTest)
gtest_discover_tests(d3d12_engine_tests)