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:
@@ -5,7 +5,7 @@
|
||||
|
||||
using namespace XCEngine::RHI;
|
||||
|
||||
TEST_F(RHITestFixture, CommandQueue_ExecuteCommandLists) {
|
||||
TEST_P(RHITestFixture, CommandQueue_ExecuteCommandLists) {
|
||||
CommandQueueDesc queueDesc = {};
|
||||
queueDesc.queueType = static_cast<uint32_t>(CommandQueueType::Direct);
|
||||
|
||||
@@ -30,7 +30,7 @@ TEST_F(RHITestFixture, CommandQueue_ExecuteCommandLists) {
|
||||
delete queue;
|
||||
}
|
||||
|
||||
TEST_F(RHITestFixture, CommandQueue_SignalWaitFence) {
|
||||
TEST_P(RHITestFixture, CommandQueue_SignalWaitFence) {
|
||||
CommandQueueDesc queueDesc = {};
|
||||
queueDesc.queueType = static_cast<uint32_t>(CommandQueueType::Direct);
|
||||
|
||||
@@ -54,7 +54,7 @@ TEST_F(RHITestFixture, CommandQueue_SignalWaitFence) {
|
||||
delete queue;
|
||||
}
|
||||
|
||||
TEST_F(RHITestFixture, CommandQueue_GetCompletedValue) {
|
||||
TEST_P(RHITestFixture, CommandQueue_GetCompletedValue) {
|
||||
CommandQueueDesc queueDesc = {};
|
||||
queueDesc.queueType = static_cast<uint32_t>(CommandQueueType::Direct);
|
||||
|
||||
@@ -68,7 +68,7 @@ TEST_F(RHITestFixture, CommandQueue_GetCompletedValue) {
|
||||
delete queue;
|
||||
}
|
||||
|
||||
TEST_F(RHITestFixture, CommandQueue_WaitForIdle) {
|
||||
TEST_P(RHITestFixture, CommandQueue_WaitForIdle) {
|
||||
CommandQueueDesc queueDesc = {};
|
||||
queueDesc.queueType = static_cast<uint32_t>(CommandQueueType::Direct);
|
||||
|
||||
@@ -81,7 +81,7 @@ TEST_F(RHITestFixture, CommandQueue_WaitForIdle) {
|
||||
delete queue;
|
||||
}
|
||||
|
||||
TEST_F(RHITestFixture, CommandQueue_GetType) {
|
||||
TEST_P(RHITestFixture, CommandQueue_GetType) {
|
||||
CommandQueueDesc queueDesc = {};
|
||||
queueDesc.queueType = static_cast<uint32_t>(CommandQueueType::Direct);
|
||||
|
||||
@@ -94,7 +94,7 @@ TEST_F(RHITestFixture, CommandQueue_GetType) {
|
||||
delete queue;
|
||||
}
|
||||
|
||||
TEST_F(RHITestFixture, CommandQueue_GetTimestampFrequency) {
|
||||
TEST_P(RHITestFixture, CommandQueue_GetTimestampFrequency) {
|
||||
CommandQueueDesc queueDesc = {};
|
||||
queueDesc.queueType = static_cast<uint32_t>(CommandQueueType::Direct);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user