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:
@@ -3,7 +3,7 @@
|
||||
|
||||
using namespace XCEngine::RHI;
|
||||
|
||||
TEST_F(RHITestFixture, Sampler_Create) {
|
||||
TEST_P(RHITestFixture, Sampler_Create) {
|
||||
SamplerDesc desc = {};
|
||||
desc.filter = static_cast<uint32_t>(FilterMode::Linear);
|
||||
desc.addressU = static_cast<uint32_t>(TextureAddressMode::Wrap);
|
||||
@@ -26,7 +26,7 @@ TEST_F(RHITestFixture, Sampler_Create) {
|
||||
delete sampler;
|
||||
}
|
||||
|
||||
TEST_F(RHITestFixture, Sampler_Bind_Unbind) {
|
||||
TEST_P(RHITestFixture, Sampler_Bind_Unbind) {
|
||||
SamplerDesc desc = {};
|
||||
desc.filter = static_cast<uint32_t>(FilterMode::Linear);
|
||||
desc.addressU = static_cast<uint32_t>(TextureAddressMode::Wrap);
|
||||
@@ -43,7 +43,7 @@ TEST_F(RHITestFixture, Sampler_Bind_Unbind) {
|
||||
delete sampler;
|
||||
}
|
||||
|
||||
TEST_F(RHITestFixture, Sampler_GetID) {
|
||||
TEST_P(RHITestFixture, Sampler_GetID) {
|
||||
SamplerDesc desc = {};
|
||||
desc.filter = static_cast<uint32_t>(FilterMode::Linear);
|
||||
desc.addressU = static_cast<uint32_t>(TextureAddressMode::Wrap);
|
||||
@@ -60,7 +60,7 @@ TEST_F(RHITestFixture, Sampler_GetID) {
|
||||
delete sampler;
|
||||
}
|
||||
|
||||
TEST_F(RHITestFixture, Sampler_GetNativeHandle) {
|
||||
TEST_P(RHITestFixture, Sampler_GetNativeHandle) {
|
||||
SamplerDesc desc = {};
|
||||
desc.filter = static_cast<uint32_t>(FilterMode::Linear);
|
||||
desc.addressU = static_cast<uint32_t>(TextureAddressMode::Wrap);
|
||||
|
||||
Reference in New Issue
Block a user