refactor: RHI抽象层测试支持参数化
- 将RHITestFixture改为TestWithParam<RHIType>,支持D3D12和OpenGL双后端 - 重构RHIFactory.cpp的include结构,修复OpenGL设备创建 - 在CMakeLists.txt中添加XCENGINE_SUPPORT_OPENGL宏定义 - 更新engine/CMakeLists.txt和tests/RHI/unit/CMakeLists.txt - 将所有TEST_F改为TEST_P以支持参数化测试 测试结果: 138 tests (D3D12: 58 passed / OpenGL: 48 passed)
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
|
||||
using namespace XCEngine::RHI;
|
||||
|
||||
TEST_F(RHITestFixture, CommandList_Reset_Close) {
|
||||
TEST_P(RHITestFixture, CommandList_Reset_Close) {
|
||||
CommandListDesc cmdDesc = {};
|
||||
cmdDesc.commandListType = static_cast<uint32_t>(CommandQueueType::Direct);
|
||||
|
||||
@@ -18,7 +18,7 @@ TEST_F(RHITestFixture, CommandList_Reset_Close) {
|
||||
delete cmdList;
|
||||
}
|
||||
|
||||
TEST_F(RHITestFixture, CommandList_SetPrimitiveTopology) {
|
||||
TEST_P(RHITestFixture, CommandList_SetPrimitiveTopology) {
|
||||
CommandListDesc cmdDesc = {};
|
||||
cmdDesc.commandListType = static_cast<uint32_t>(CommandQueueType::Direct);
|
||||
|
||||
@@ -33,7 +33,7 @@ TEST_F(RHITestFixture, CommandList_SetPrimitiveTopology) {
|
||||
delete cmdList;
|
||||
}
|
||||
|
||||
TEST_F(RHITestFixture, CommandList_SetViewport) {
|
||||
TEST_P(RHITestFixture, CommandList_SetViewport) {
|
||||
CommandListDesc cmdDesc = {};
|
||||
cmdDesc.commandListType = static_cast<uint32_t>(CommandQueueType::Direct);
|
||||
|
||||
@@ -50,7 +50,7 @@ TEST_F(RHITestFixture, CommandList_SetViewport) {
|
||||
delete cmdList;
|
||||
}
|
||||
|
||||
TEST_F(RHITestFixture, CommandList_SetViewports) {
|
||||
TEST_P(RHITestFixture, CommandList_SetViewports) {
|
||||
CommandListDesc cmdDesc = {};
|
||||
cmdDesc.commandListType = static_cast<uint32_t>(CommandQueueType::Direct);
|
||||
|
||||
@@ -70,7 +70,7 @@ TEST_F(RHITestFixture, CommandList_SetViewports) {
|
||||
delete cmdList;
|
||||
}
|
||||
|
||||
TEST_F(RHITestFixture, CommandList_SetScissorRect) {
|
||||
TEST_P(RHITestFixture, CommandList_SetScissorRect) {
|
||||
CommandListDesc cmdDesc = {};
|
||||
cmdDesc.commandListType = static_cast<uint32_t>(CommandQueueType::Direct);
|
||||
|
||||
@@ -87,7 +87,7 @@ TEST_F(RHITestFixture, CommandList_SetScissorRect) {
|
||||
delete cmdList;
|
||||
}
|
||||
|
||||
TEST_F(RHITestFixture, CommandList_Draw) {
|
||||
TEST_P(RHITestFixture, CommandList_Draw) {
|
||||
CommandListDesc cmdDesc = {};
|
||||
cmdDesc.commandListType = static_cast<uint32_t>(CommandQueueType::Direct);
|
||||
|
||||
@@ -103,7 +103,7 @@ TEST_F(RHITestFixture, CommandList_Draw) {
|
||||
delete cmdList;
|
||||
}
|
||||
|
||||
TEST_F(RHITestFixture, CommandList_DrawIndexed) {
|
||||
TEST_P(RHITestFixture, CommandList_DrawIndexed) {
|
||||
CommandListDesc cmdDesc = {};
|
||||
cmdDesc.commandListType = static_cast<uint32_t>(CommandQueueType::Direct);
|
||||
|
||||
@@ -119,7 +119,7 @@ TEST_F(RHITestFixture, CommandList_DrawIndexed) {
|
||||
delete cmdList;
|
||||
}
|
||||
|
||||
TEST_F(RHITestFixture, CommandList_ClearRenderTarget) {
|
||||
TEST_P(RHITestFixture, CommandList_ClearRenderTarget) {
|
||||
CommandListDesc cmdDesc = {};
|
||||
cmdDesc.commandListType = static_cast<uint32_t>(CommandQueueType::Direct);
|
||||
|
||||
@@ -147,7 +147,7 @@ TEST_F(RHITestFixture, CommandList_ClearRenderTarget) {
|
||||
delete cmdList;
|
||||
}
|
||||
|
||||
TEST_F(RHITestFixture, CommandList_SetDepthStencilState) {
|
||||
TEST_P(RHITestFixture, CommandList_SetDepthStencilState) {
|
||||
CommandListDesc cmdDesc = {};
|
||||
cmdDesc.commandListType = static_cast<uint32_t>(CommandQueueType::Direct);
|
||||
|
||||
@@ -167,7 +167,7 @@ TEST_F(RHITestFixture, CommandList_SetDepthStencilState) {
|
||||
delete cmdList;
|
||||
}
|
||||
|
||||
TEST_F(RHITestFixture, CommandList_SetBlendState) {
|
||||
TEST_P(RHITestFixture, CommandList_SetBlendState) {
|
||||
CommandListDesc cmdDesc = {};
|
||||
cmdDesc.commandListType = static_cast<uint32_t>(CommandQueueType::Direct);
|
||||
|
||||
@@ -186,7 +186,7 @@ TEST_F(RHITestFixture, CommandList_SetBlendState) {
|
||||
delete cmdList;
|
||||
}
|
||||
|
||||
TEST_F(RHITestFixture, CommandList_SetStencilRef) {
|
||||
TEST_P(RHITestFixture, CommandList_SetStencilRef) {
|
||||
CommandListDesc cmdDesc = {};
|
||||
cmdDesc.commandListType = static_cast<uint32_t>(CommandQueueType::Direct);
|
||||
|
||||
@@ -201,7 +201,7 @@ TEST_F(RHITestFixture, CommandList_SetStencilRef) {
|
||||
delete cmdList;
|
||||
}
|
||||
|
||||
TEST_F(RHITestFixture, CommandList_TransitionBarrier) {
|
||||
TEST_P(RHITestFixture, CommandList_TransitionBarrier) {
|
||||
CommandListDesc cmdDesc = {};
|
||||
cmdDesc.commandListType = static_cast<uint32_t>(CommandQueueType::Direct);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user