Files
XCEngine/tests/RHI/D3D12/unit/fixtures/D3D12TestFixture.h
ssdfasd fae520854e refactor: reorganize unit tests into separate folder
- Move test_*.cpp and fixtures/ to tests/RHI/D3D12/unit/
- Create unit/CMakeLists.txt with proper test configuration
- Simplify parent CMakeLists.txt to use add_subdirectory
- Integration tests remain in integration/ folder
2026-03-20 02:58:33 +08:00

37 lines
1.1 KiB
C++

#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(); }
ID3D12GraphicsCommandList* GetCommandList() { return mCommandList.Get(); }
ID3D12CommandAllocator* GetCommandAllocator() { return mCommandAllocator.Get(); }
void WaitForGPU();
private:
ComPtr<ID3D12Device> mDevice;
ComPtr<ID3D12CommandQueue> mCommandQueue;
ComPtr<ID3D12CommandAllocator> mCommandAllocator;
ComPtr<ID3D12GraphicsCommandList> mCommandList;
};