diff options
author | Jacob Smith <jake.smith@hdfgroup.org> | 2018-12-12 19:39:14 (GMT) |
---|---|---|
committer | Jacob Smith <jake.smith@hdfgroup.org> | 2018-12-12 23:26:08 (GMT) |
commit | ea7332525010ef75e27ce5800cf65dd91ba43576 (patch) | |
tree | 19f440d677555c016dacc4a2cd28aaa80961e350 /config/cmake/scripts/CTestScript.cmake | |
parent | 496de6922fb13aa11a5c5efe56a3f8de157a77ad (diff) | |
parent | 6f52793adcd5a14aa63731e3c33c9737b5a04d16 (diff) | |
download | hdf5-ea7332525010ef75e27ce5800cf65dd91ba43576.zip hdf5-ea7332525010ef75e27ce5800cf65dd91ba43576.tar.gz hdf5-ea7332525010ef75e27ce5800cf65dd91ba43576.tar.bz2 |
Merge branch 'develop' into dset_ohdr_minimize
Diffstat (limited to 'config/cmake/scripts/CTestScript.cmake')
-rwxr-xr-x | config/cmake/scripts/CTestScript.cmake | 126 |
1 files changed, 77 insertions, 49 deletions
diff --git a/config/cmake/scripts/CTestScript.cmake b/config/cmake/scripts/CTestScript.cmake index 670196b..9534b1e 100755 --- a/config/cmake/scripts/CTestScript.cmake +++ b/config/cmake/scripts/CTestScript.cmake @@ -36,10 +36,6 @@ if (NOT SITE_OS_NAME) message (STATUS "Dashboard script uname output: ${osname}-${osrel}-${cpu}\n")
set (CTEST_BUILD_NAME "${osname}-${osrel}-${cpu}")
- if (SITE_BUILDNAME_SUFFIX)
- set (CTEST_BUILD_NAME "${SITE_BUILDNAME_SUFFIX}-${CTEST_BUILD_NAME}")
- endif ()
- set (BUILD_OPTIONS "${ADD_BUILD_OPTIONS}")
else ()
## machine name provided
## --------------------------
@@ -48,11 +44,11 @@ else () else ()
set (CTEST_BUILD_NAME "${SITE_OS_NAME}-${SITE_OS_VERSION}-${SITE_COMPILER_NAME}")
endif ()
- if (SITE_BUILDNAME_SUFFIX)
- set (CTEST_BUILD_NAME "${CTEST_BUILD_NAME}-${SITE_BUILDNAME_SUFFIX}")
- endif ()
- set (BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DSITE:STRING=${CTEST_SITE} -DBUILDNAME:STRING=${CTEST_BUILD_NAME}")
endif ()
+if (SITE_BUILDNAME_SUFFIX) + set (CTEST_BUILD_NAME "${SITE_BUILDNAME_SUFFIX}-${CTEST_BUILD_NAME}") +endif () +set (BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DSITE:STRING=${CTEST_SITE} -DBUILDNAME:STRING=${CTEST_BUILD_NAME}") #-----------------------------------------------------------------------------
# MAC machines need special option
@@ -158,7 +154,12 @@ endif () # Use multiple CPU cores to build
include (ProcessorCount)
ProcessorCount (N)
-if (NOT N EQUAL 0)
+if (NOT N EQUAL 0) + if (MAX_PROC_COUNT) + if (N GREATER MAX_PROC_COUNT) + set (N ${MAX_PROC_COUNT}) + endif () + endif () if (NOT WIN32)
set (CTEST_BUILD_FLAGS -j${N})
endif ()
@@ -189,10 +190,10 @@ endforeach () #-----------------------------------------------------------------------------
# Initialize the CTEST commands
#------------------------------
-if(CMAKE_GENERATOR_TOOLSET)
- set(CTEST_CONFIGURE_TOOLSET "-T${CMAKE_GENERATOR_TOOLSET}")
+if (CMAKE_GENERATOR_TOOLSET)
+ set (CTEST_CONFIGURE_TOOLSET "-T${CMAKE_GENERATOR_TOOLSET}")
else ()
- set(CTEST_CONFIGURE_TOOLSET "")
+ set (CTEST_CONFIGURE_TOOLSET "")
endif()
if (LOCAL_MEMCHECK_TEST)
find_program (CTEST_MEMORYCHECK_COMMAND NAMES valgrind)
@@ -263,40 +264,67 @@ message (STATUS "Dashboard script configuration:\n${vars}\n") if (NOT LOCAL_SKIP_TEST)
if (NOT LOCAL_MEMCHECK_TEST)
- ctest_test (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND ${ctest_test_args} RETURN_VALUE res)
- if (LOCAL_SUBMIT)
- ctest_submit (PARTS Test)
- endif ()
- if (${res} LESS 0 OR ${res} GREATER 0)
- file (APPEND ${CTEST_SCRIPT_DIRECTORY}/FailedCTest.txt "Failed Tests: ${res}\n")
- endif ()
- else ()
- ctest_memcheck (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND ${ctest_test_args})
- if (LOCAL_SUBMIT)
- ctest_submit (PARTS MemCheck)
- endif ()
- endif ()
- if (LOCAL_COVERAGE_TEST)
- ctest_coverage (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND)
- if (LOCAL_SUBMIT)
- ctest_submit (PARTS Coverage)
- endif ()
- endif ()
- endif ()
-
- if (NOT LOCAL_MEMCHECK_TEST AND NOT LOCAL_NO_PACKAGE AND NOT LOCAL_SKIP_BUILD)
- ##-----------------------------------------------
- ## Package the product
- ##-----------------------------------------------
- execute_process (COMMAND cpack -C ${CTEST_CONFIGURATION_TYPE} -V
- WORKING_DIRECTORY ${CTEST_BINARY_DIRECTORY}
- RESULT_VARIABLE cpackResult
- OUTPUT_VARIABLE cpackLog
- ERROR_VARIABLE cpackLog.err
- )
- file (WRITE ${CTEST_BINARY_DIRECTORY}/cpack.log "${cpackLog.err}" "${cpackLog}")
- if (cpackResult GREATER 0)
- file (APPEND ${CTEST_SCRIPT_DIRECTORY}/FailedCTest.txt "Failed packaging: ${cpackResult}:${cpackLog.err} \n")
- endif ()
- endif ()
-#-----------------------------------------------------------------------------
+ if (NOT LOCAL_BATCH_TEST) + ctest_test (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND ${ctest_test_args} RETURN_VALUE res) + else () + file(STRINGS ${CTEST_BINARY_DIRECTORY}/Testing/TAG TAG_CONTENTS REGEX "^2([0-9]+)[-]([0-9]+)$") + execute_process (COMMAND ${LOCAL_BATCH_SCRIPT_COMMAND} ${CTEST_SOURCE_DIRECTORY}/bin/batch/${LOCAL_BATCH_SCRIPT_NAME}) + 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) + while(result) + ctest_sleep(60) + execute_process(COMMAND ls ${CTEST_BINARY_DIRECTORY}/Testing/${TAG_CONTENTS}/Test.xml RESULT_VARIABLE result OUTPUT_QUIET ERROR_QUIET) + endwhile(result) + 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) + unset(result CACHE) + execute_process (COMMAND ${LOCAL_BATCH_SCRIPT_COMMAND} ${CTEST_SOURCE_DIRECTORY}/bin/batch/${LOCAL_BATCH_SCRIPT_PARALLEL_NAME}) + 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) + while(result) + ctest_sleep(60) + execute_process(COMMAND ls ${CTEST_BINARY_DIRECTORY}/Testing/${TAG_CONTENTS}/Test.xml RESULT_VARIABLE result OUTPUT_QUIET ERROR_QUIET) + endwhile(result) + message(STATUS "Found ${CTEST_BINARY_DIRECTORY}/Testing/${TAG_CONTENTS}/Test.xml for parallel tests.") + endif() + endif () + if (LOCAL_SUBMIT) + ctest_submit (PARTS Test) + endif () + if (${res} LESS 0 OR ${res} GREATER 0) + file (APPEND ${CTEST_SCRIPT_DIRECTORY}/FailedCTest.txt "Failed Tests: ${res}\n") + endif () + else () + ctest_memcheck (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND ${ctest_test_args}) + if (LOCAL_SUBMIT) + ctest_submit (PARTS MemCheck) + endif () + endif () + if (LOCAL_COVERAGE_TEST) + ctest_coverage (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND) + if (LOCAL_SUBMIT) + ctest_submit (PARTS Coverage) + endif () + endif () + endif () + + if (NOT LOCAL_MEMCHECK_TEST AND NOT LOCAL_NO_PACKAGE AND NOT LOCAL_SKIP_BUILD) + ##----------------------------------------------- + ## Package the product + ##----------------------------------------------- + execute_process (COMMAND cpack -C ${CTEST_CONFIGURATION_TYPE} -V + WORKING_DIRECTORY ${CTEST_BINARY_DIRECTORY} + RESULT_VARIABLE cpackResult + OUTPUT_VARIABLE cpackLog + ERROR_VARIABLE cpackLog.err + ) + file (WRITE ${CTEST_BINARY_DIRECTORY}/cpack.log "${cpackLog.err}" "${cpackLog}") + if (cpackResult GREATER 0) + file (APPEND ${CTEST_SCRIPT_DIRECTORY}/FailedCTest.txt "Failed packaging: ${cpackResult}:${cpackLog.err} \n") + endif () + endif () +#----------------------------------------------------------------------------- |