Files
XCEngine/tests/RHI/unit/CMakeLists.txt
ssdfasd bc6b47ffcf fix: RHI单元测试修复与命名规范统一
RHI抽象层测试修复:
- OpenGL Shader: 空描述符正确返回nullptr
- OpenGL Texture: 修复TextureType映射(case 2/3)
- OpenGL Buffer: 设置stride和state支持
- OpenGL Texture: 添加Format和State支持
- OpenGL SwapChain: 修复IsFullscreen硬编码false问题

命名规范统一( snake_case + _test后缀):
- D3D12_Minimal -> d3d12_minimal_test
- D3D12_Triangle -> d3d12_triangle_test
- D3D12_Quad -> d3d12_quad_test
- D3D12_Sphere -> d3d12_sphere_test
- OpenGL_Minimal -> opengl_minimal_test
- OpenGL_Triangle -> opengl_triangle_test
- OpenGL_Quad -> opengl_quad_test
- OpenGL_Sphere -> opengl_sphere_test
- CTest名称去掉_Integration后缀

测试结果: 138个测试中从21个失败减少到16个失败
2026-03-23 20:32:33 +08:00

44 lines
1016 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/RHITestFixture.cpp
test_device.cpp
test_buffer.cpp
test_texture.cpp
test_swap_chain.cpp
test_command_list.cpp
test_command_queue.cpp
test_shader.cpp
test_fence.cpp
test_sampler.cpp
${CMAKE_SOURCE_DIR}/tests/opengl/package/src/glad.c
)
add_executable(rhi_unit_tests ${TEST_SOURCES})
target_compile_definitions(rhi_unit_tests PRIVATE XCENGINE_SUPPORT_OPENGL)
target_link_libraries(rhi_unit_tests PRIVATE
d3d12
dxgi
d3dcompiler
opengl32
XCEngine
GTest::gtest
GTest::gtest_main
)
target_include_directories(rhi_unit_tests PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/fixtures
${PROJECT_ROOT_DIR}/engine/include
${PROJECT_ROOT_DIR}/engine/src
${CMAKE_SOURCE_DIR}/tests/opengl/package/include/
)
include(GoogleTest)
gtest_discover_tests(rhi_unit_tests)