From 59a741553e4b055aae774276501804fa466107e7 Mon Sep 17 00:00:00 2001 From: "Ramsey1, Paul (NBCUniversal)" Date: Mon, 6 Jul 2026 13:54:28 -0700 Subject: [PATCH] Merge pull request #139 from dwanim/MOONRAY-6075 MOONRAY-6075 add a DEPENDS_RAW which fully names the test depended on Signed-off-by: Jon Lanz --- cmake/RatsTest.cmake | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/cmake/RatsTest.cmake b/cmake/RatsTest.cmake index 5d866b4..6e097ae 100644 --- a/cmake/RatsTest.cmake +++ b/cmake/RatsTest.cmake @@ -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 @@ -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) @@ -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})