Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions cmake/RatsTest.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@ function(add_rats_test)
# but specifying an explicit dependency here allows such tests to run in the correct
# order when multiple jobs are used via the -J option to the ctest command).

DEPENDS_RAW # List of tests that should be run before this test
# where the full test name is specified

INPUTS # (required) Ordered list of input files the test requires.
# example: INPUTS scene.rdla scene.rdlb

Expand Down Expand Up @@ -182,6 +185,8 @@ function(add_rats_test)
set(render_test_name "render-${exec_mode_short}-${test_basename}")
file(MAKE_DIRECTORY ${render_dir})

set(update_dependencies "")
set(render_dependencies "")
if(ARG_DEPENDS)
# compute full name of dependency tests with prefix
list(TRANSFORM ARG_DEPENDS PREPEND "update-${exec_mode_short}-" OUTPUT_VARIABLE update_dependencies)
Expand All @@ -195,6 +200,17 @@ function(add_rats_test)
endif()
endforeach()
endif()
if(ARG_DEPENDS_RAW)
# provided dependencies are already full names so just append them to the respective lists of dependencies
list(APPEND update_dependencies ${ARG_DEPENDS_RAW})
list(APPEND render_dependencies ${ARG_DEPENDS_RAW})
# verify that each CTest exists
foreach(test IN LISTS ARG_DEPENDS_RAW)
if(NOT TEST ${test})
message(FATAL_ERROR "No test named ${test} exists to add as a dependency")
endif()
endforeach()
endif()

foreach(rdl_input ${ARG_INPUTS})
list(APPEND render_cmd -in ${CMAKE_CURRENT_SOURCE_DIR}/${rdl_input})
Expand Down