Use ctest_test and APPEND to correctly report passed and failed test numbers in CDash (#2208)

* Change how HPC tests are executed

* Move ctest_test commands for serial and parallel tests into cmake files.

* Update checks for uploading Test.xml to CDash.

* Correct cmake scripots.

* Remove extraneous characters.

* Add ctest_start (APPEND).

* Add binary directories to scripts running ctest_test.

* Correct parameters for appending Test.xml.

* Set CTEST_SITE and CTEST_BUILD_NAME.

* Try to pass site and build_name to ctest_test sripts.

* Add site name and build name for ctest_test commands vi environment.

* Revert "Try to pass site and build_name to ctest_test sripts."

This reverts commit d364aaf0fa.

* Correct typo in src/CMakeLists.txt.

* Update batch scripts to run ctest_test scripts.

Co-authored-by: Allen Byrne <byrn@hdfgroup.org>
This commit is contained in:
Larry Knox
2022-11-02 11:02:47 -05:00
committed by GitHub
parent e4fb9aa96e
commit 6924d590cc
13 changed files with 83 additions and 43 deletions

View File

@@ -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
@@ -315,19 +319,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 +340,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 +367,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)