test: 添加 D3D12 引擎测试框架
- 修复 engine/CMakeLists.txt 路径问题 - 在 tests/D3D12_engine/test/ 创建测试框架 - 添加基础测试夹具 D3D12TestFixture - 添加 13 个基础测试用例 - 所有测试通过
This commit is contained in:
36
tests/D3D12_engine/test/fixtures/D3D12TestFixture.h
vendored
Normal file
36
tests/D3D12_engine/test/fixtures/D3D12TestFixture.h
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
#pragma once
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
#include <d3d12.h>
|
||||
#include <dxgi1_4.h>
|
||||
#include <wrl/client.h>
|
||||
|
||||
#include "XCEngine/RHI/D3D12/D3D12Device.h"
|
||||
#include "XCEngine/RHI/D3D12/D3D12CommandQueue.h"
|
||||
#include "XCEngine/RHI/D3D12/D3D12CommandAllocator.h"
|
||||
#include "XCEngine/RHI/D3D12/D3D12CommandList.h"
|
||||
#include "XCEngine/RHI/D3D12/D3D12Fence.h"
|
||||
|
||||
using namespace Microsoft::WRL;
|
||||
|
||||
class D3D12TestFixture : public ::testing::Test {
|
||||
protected:
|
||||
static void SetUpTestSuite();
|
||||
static void TearDownTestSuite();
|
||||
|
||||
void SetUp() override;
|
||||
void TearDown() override;
|
||||
|
||||
ID3D12Device* GetDevice() { return mDevice.Get(); }
|
||||
ID3D12CommandQueue* GetCommandQueue() { return mCommandQueue.Get(); }
|
||||
ID3D12CommandList* GetCommandList() { return mCommandList.Get(); }
|
||||
ID3D12CommandAllocator* GetCommandAllocator() { return mCommandAllocator.Get(); }
|
||||
|
||||
void WaitForGPU();
|
||||
|
||||
private:
|
||||
static ComPtr<ID3D12Device> mDevice;
|
||||
ComPtr<ID3D12CommandQueue> mCommandQueue;
|
||||
ComPtr<ID3D12CommandAllocator> mCommandAllocator;
|
||||
ComPtr<ID3D12CommandList> mCommandList;
|
||||
};
|
||||
Reference in New Issue
Block a user