D3D12: Refactor integration tests with separate output directories
This commit is contained in:
55
tests/RHI/D3D12/integration/render_model/CMakeLists.txt
Normal file
55
tests/RHI/D3D12/integration/render_model/CMakeLists.txt
Normal file
@@ -0,0 +1,55 @@
|
||||
cmake_minimum_required(VERSION 3.15)
|
||||
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
|
||||
|
||||
project(D3D12_RenderModel)
|
||||
|
||||
set(ENGINE_ROOT_DIR ${CMAKE_SOURCE_DIR}/engine)
|
||||
|
||||
add_executable(D3D12_RenderModel
|
||||
WIN32
|
||||
main.cpp
|
||||
)
|
||||
|
||||
target_include_directories(D3D12_RenderModel PRIVATE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
${ENGINE_ROOT_DIR}/include
|
||||
${ENGINE_ROOT_DIR}
|
||||
)
|
||||
|
||||
target_compile_definitions(D3D12_RenderModel PRIVATE
|
||||
UNICODE
|
||||
_UNICODE
|
||||
)
|
||||
|
||||
target_link_libraries(D3D12_RenderModel PRIVATE
|
||||
d3d12
|
||||
dxgi
|
||||
d3dcompiler
|
||||
winmm
|
||||
XCEngine
|
||||
)
|
||||
|
||||
add_custom_command(TARGET D3D12_RenderModel POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/Res
|
||||
$<TARGET_FILE_DIR:D3D12_RenderModel>/Res
|
||||
)
|
||||
|
||||
add_custom_command(TARGET D3D12_RenderModel POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
||||
${CMAKE_SOURCE_DIR}/tests/RHI/D3D12/integration/compare_ppm.py
|
||||
$<TARGET_FILE_DIR:D3D12_RenderModel>/
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
||||
${CMAKE_SOURCE_DIR}/tests/RHI/D3D12/integration/run_integration_test.py
|
||||
$<TARGET_FILE_DIR:D3D12_RenderModel>/
|
||||
)
|
||||
|
||||
add_test(NAME D3D12_RenderModel_Integration
|
||||
COMMAND ${Python3_EXECUTABLE} $<TARGET_FILE_DIR:D3D12_RenderModel>/run_integration_test.py
|
||||
$<TARGET_FILE:D3D12_RenderModel>
|
||||
screenshot.ppm
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/GT.ppm
|
||||
5
|
||||
WORKING_DIRECTORY $<TARGET_FILE_DIR:D3D12_RenderModel>
|
||||
)
|
||||
Reference in New Issue
Block a user