diff options
author | Allen Byrne <50328838+byrnHDF@users.noreply.github.com> | 2023-03-30 03:35:56 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-30 03:35:56 (GMT) |
commit | 70fa97e271ffdfa21b0a57206928c0f9bac89c2b (patch) | |
tree | 54d219d2a64af8cd266573bcea317eec9bf9f4fc /config/cmake/scripts/CTestScript.cmake | |
parent | da9310d08fc3ee9dd8e24f900d0947c51f8a2b00 (diff) | |
download | hdf5-70fa97e271ffdfa21b0a57206928c0f9bac89c2b.zip hdf5-70fa97e271ffdfa21b0a57206928c0f9bac89c2b.tar.gz hdf5-70fa97e271ffdfa21b0a57206928c0f9bac89c2b.tar.bz2 |
Fix CMake for version less then 3.18 (#2651)
Diffstat (limited to 'config/cmake/scripts/CTestScript.cmake')
-rw-r--r-- | config/cmake/scripts/CTestScript.cmake | 37 |
1 files changed, 23 insertions, 14 deletions
diff --git a/config/cmake/scripts/CTestScript.cmake b/config/cmake/scripts/CTestScript.cmake index fa149c3..fb9dd57 100644 --- a/config/cmake/scripts/CTestScript.cmake +++ b/config/cmake/scripts/CTestScript.cmake @@ -261,6 +261,10 @@ if (NOT DEFINED MODEL) set (MODEL "Experimental") endif () +set (ENV{CI_SITE_NAME} ${CTEST_SITE}) +set (ENV{CI_BUILD_NAME} ${CTEST_BUILD_NAME}) +set (ENV{CI_MODEL} ${MODEL}) + #----------------------------------------------------------------------------- ## NORMAL process ## -- LOCAL_UPDATE updates the source folder from svn @@ -269,7 +273,11 @@ endif () ## -- LOCAL_MEMCHECK_TEST executes the Valgrind testing ## -- LOCAL_COVERAGE_TEST executes code coverage process ## -------------------------- - ctest_start (${MODEL} GROUP ${MODEL}) + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.16.0") + ctest_start (${MODEL} GROUP ${MODEL}) + else () + ctest_start (${MODEL} TRACK ${MODEL}) + endif () if (LOCAL_UPDATE) ctest_update (SOURCE "${CTEST_SOURCE_DIRECTORY}") endif () @@ -315,19 +323,17 @@ endif () execute_process (COMMAND ${LOCAL_BATCH_SCRIPT_COMMAND} ${LOCAL_BATCH_SCRIPT_ARGS} ${CTEST_BINARY_DIRECTORY}/${LOCAL_BATCH_SCRIPT_NAME}) endif() endif () - message(STATUS "Check for existence of ${CTEST_BINARY_DIRECTORY}/Testing/${TAG_CONTENTS}/Test.xml") - execute_process(COMMAND ls ${CTEST_BINARY_DIRECTORY}/Testing/${TAG_CONTENTS}/Test.xml RESULT_VARIABLE result OUTPUT_QUIET ERROR_QUIET) + message(STATUS "Check for existence of ${CTEST_BINARY_DIRECTORY}/ctestS.done") + execute_process(COMMAND ls ${CTEST_BINARY_DIRECTORY}/ctestS.done RESULT_VARIABLE result OUTPUT_QUIET ERROR_QUIET) while(result) ctest_sleep(60) - execute_process(COMMAND ls ${CTEST_BINARY_DIRECTORY}/Testing/${TAG_CONTENTS}/Test.xml RESULT_VARIABLE result OUTPUT_QUIET ERROR_QUIET) + execute_process(COMMAND ls ${CTEST_BINARY_DIRECTORY}/ctestS.done RESULT_VARIABLE result OUTPUT_QUIET ERROR_QUIET) endwhile(result) + message(STATUS "Serial tests completed.") + if (LOCAL_SUBMIT) + ctest_submit (PARTS Test) + endif () if (LOCAL_BATCH_SCRIPT_PARALLEL_NAME) - if (LOCAL_SUBMIT) - ctest_submit (PARTS Test) - endif () - message(STATUS "Found ${CTEST_BINARY_DIRECTORY}/Testing/${TAG_CONTENTS}/Test.xml for serial tests. Renaming to SerialTest.xml") - file (RENAME ${CTEST_BINARY_DIRECTORY}/Testing/${TAG_CONTENTS}/Test.xml ${CTEST_BINARY_DIRECTORY}/Testing/${TAG_CONTENTS}/SerialTest.xml) - file (RENAME ${CTEST_BINARY_DIRECTORY}/Testing/Temporary/LastTest_${TAG_CONTENTS}.log ${CTEST_BINARY_DIRECTORY}/Testing/Temporary/LastTest_${TAG_CONTENTS}_Serial.log) unset(result CACHE) if (LOCAL_BATCH_SCRIPT_COMMAND STREQUAL "raybsub") execute_process (COMMAND ${CTEST_BINARY_DIRECTORY}/${LOCAL_BATCH_SCRIPT_COMMAND} ${LOCAL_BATCH_SCRIPT_ARGS} ${CTEST_BINARY_DIRECTORY}/${LOCAL_BATCH_SCRIPT_PARALLEL_NAME}) @@ -338,13 +344,13 @@ endif () execute_process (COMMAND ${LOCAL_BATCH_SCRIPT_COMMAND} ${LOCAL_BATCH_SCRIPT_ARGS} ${CTEST_BINARY_DIRECTORY}/${LOCAL_BATCH_SCRIPT_PARALLEL_NAME}) endif () endif () - message(STATUS "Check for existence of ${CTEST_BINARY_DIRECTORY}/Testing/${TAG_CONTENTS}/Test.xml") - execute_process(COMMAND ls ${CTEST_BINARY_DIRECTORY}/Testing/${TAG_CONTENTS}/Test.xml RESULT_VARIABLE result OUTPUT_QUIET ERROR_QUIET) + message(STATUS "Check for existence of ${CTEST_BINARY_DIRECTORY}/ctestP.done") + execute_process(COMMAND ls ${CTEST_BINARY_DIRECTORY}/ctestP.done RESULT_VARIABLE result OUTPUT_QUIET ERROR_QUIET) while(result) ctest_sleep(60) - execute_process(COMMAND ls ${CTEST_BINARY_DIRECTORY}/Testing/${TAG_CONTENTS}/Test.xml RESULT_VARIABLE result OUTPUT_QUIET ERROR_QUIET) + execute_process(COMMAND ls ${CTEST_BINARY_DIRECTORY}/ctestP.done RESULT_VARIABLE result OUTPUT_QUIET ERROR_QUIET) endwhile(result) - message(STATUS "Found ${CTEST_BINARY_DIRECTORY}/Testing/${TAG_CONTENTS}/Test.xml for parallel tests.") + message(STATUS "parallel tests completed.") endif() endif () if (LOCAL_SUBMIT) @@ -365,6 +371,9 @@ endif () ctest_submit (PARTS Coverage) endif () endif () + if (LOCAL_SUBMIT) + ctest_submit (PARTS Done) + endif () endif () if (NOT LOCAL_MEMCHECK_TEST AND NOT LOCAL_NO_PACKAGE AND NOT LOCAL_SKIP_BUILD) |