From 222c3a24d6abd5c7c9d95f5d94d352430be1540d Mon Sep 17 00:00:00 2001 From: maier Date: Thu, 26 Sep 2013 14:28:48 +0000 Subject: [PATCH] Finalize run_test.cmake, cleanup some other parts, Update TODO git-svn-id: https://svn.dealii.org/branches/branch_port_the_testsuite@30954 0785d39b-7218-0410-832d-ea1e28bc413d --- tests/TODO | 10 ----- tests/cmake/scripts/run_test.cmake | 21 +--------- tests/cmake/setup_testsuite.cmake | 1 - tests/run_testsuite.cmake | 61 +++++++++++++++++++++++++----- 4 files changed, 53 insertions(+), 40 deletions(-) diff --git a/tests/TODO b/tests/TODO index 86be6e6cb3..a84bb97d84 100644 --- a/tests/TODO +++ b/tests/TODO @@ -55,16 +55,6 @@ Issues: Depending on the version of boost, a version number in the serialization output changes and all tests just under serialization/ just fail - - Write a ctest configuration file (I'll do this sometime this week) - - - and setup a cdash test server - - Mesh converter tests? - Benchmark should be extra, am I right? - - - What about the files in - - ./base/data_out_base_dx - ./base/data_out_base_povray? - diff --git a/tests/cmake/scripts/run_test.cmake b/tests/cmake/scripts/run_test.cmake index 870e741160..4a27a36ee6 100644 --- a/tests/cmake/scripts/run_test.cmake +++ b/tests/cmake/scripts/run_test.cmake @@ -34,27 +34,8 @@ IF("${_result_code}" STREQUAL "0") MESSAGE("Test ${TEST}: PASSED") MESSAGE("=============================== OUTPUT BEGIN ===============================") - # # Do not output everything, just that we are successful: - # - IF(TRGT MATCHES "\\.diff$") # ordinary test: - MESSAGE("${TEST}: BUILD successful.") - MESSAGE("${TEST}: RUN successful.") - MESSAGE("${TEST}: DIFF successful.") - MESSAGE("${TEST}: PASSED.") - ELSEIF(TRGT MATCHES "\\.run$") # build_test for steps: - MESSAGE("${TEST}: CONFIGURE successful.") - MESSAGE("${TEST}: BUILD successful.") - MESSAGE("${TEST}: RUN successful.") - MESSAGE("${TEST}: PASSED.") - ELSEIF(TRGT MATCHES "\\.build$") # build_test for steps: - MESSAGE("${TEST}: CONFIGURE successful.") - MESSAGE("${TEST}: BUILD successful.") - MESSAGE("${TEST}: PASSED.") - ELSE() # all-headers test: - MESSAGE("${TEST}: BUILD successful.") - MESSAGE("${TEST}: PASSED.") - ENDIF() + MESSAGE("${TEST}: PASSED.") MESSAGE("=============================== OUTPUT END ===============================") ELSE() diff --git a/tests/cmake/setup_testsuite.cmake b/tests/cmake/setup_testsuite.cmake index 53d56a5e31..7a5b87fc0c 100644 --- a/tests/cmake/setup_testsuite.cmake +++ b/tests/cmake/setup_testsuite.cmake @@ -108,4 +108,3 @@ SET_IF_EMPTY(TEST_TIME_LIMIT 600) # ENABLE_TESTING() - diff --git a/tests/run_testsuite.cmake b/tests/run_testsuite.cmake index cc03cf838a..468722a1fb 100644 --- a/tests/run_testsuite.cmake +++ b/tests/run_testsuite.cmake @@ -22,13 +22,14 @@ ######################################################################## # -# This is the test script for running the testsuite. +# This is the ctest script for running and submitting build and regression +# tests. # # Invoke it in a _build directory_ (or designated build directory) via: # # ctest -S <...>/run_testsuite.cmake # -# The following configuration variables can be overriden with +# The following configuration variables can be overwritten with # # ctest -D= [...] # @@ -55,7 +56,17 @@ # be used, otherwise "Unix Makefiles". # # TRACK -# - TODO (defaults to "Experimental") +# - The track the test should be submitted to. Defaults to +# "Experimental". Possible values are: +# +# "Experimental" - all tests that are not specifically "build" or +# "regression" tests should go into this track +# +# "Build Tests" - Build tests that configure and build in a +# clean directory and run the build tests +# "build_tests/*" +# +# "Regression Tests" - Reserved for the Regression tester # # CONFIG_FILE # - A configuration file (see ../deal.II/docs/development/Config.sample) @@ -87,8 +98,12 @@ IF("${TRACK}" STREQUAL "") ENDIF() IF( NOT "${TRACK}" STREQUAL "Experimental" - AND NOT "${TRACK}" STREQUAL "Build Tests" ) - MESSAGE(FATAL_ERROR "TODO: Unknown TRACK \"${TRACK}\"") + AND NOT "${TRACK}" STREQUAL "Build Tests" + AND NOT "${TRACK}" STREQUAL "Regression Tests" ) + MESSAGE(FATAL_ERROR " +Unknown TRACK \"${TRACK}\" - see the manual for valid values. +" + ) ENDIF() MESSAGE("-- TRACK: ${TRACK}") @@ -195,6 +210,15 @@ SET(CTEST_SITE "${_hostname}") MESSAGE("-- CTEST_SITE: ${CTEST_SITE}") +IF( "${TRACK}" STREQUAL "Regression Tests" + AND NOT CTEST_SITE MATCHES "foobar" ) + MESSAGE(FATAL_ERROR " +I'm sorry ${CTEST_SITE}, I'm afraid I can't do that. +The TRACK \"Regression Tests\" is not for you. +" + ) +ENDIF() + # # Assemble configuration options, we need it now: # @@ -361,7 +385,10 @@ IF("${_res}" STREQUAL "0") OUTPUT_QUIET RESULT_VARIABLE _res ) IF(NOT "${_res}" STREQUAL "0") - MESSAGE(FATAL_ERROR "\"setup_test\" target exited with an error. Bailing out.") + MESSAGE(FATAL_ERROR " +\"setup_test\" target exited with an error. Bailing out. +" + ) ENDIF() CTEST_TEST() @@ -375,7 +402,10 @@ ENDIF() FILE(STRINGS ${CTEST_BINARY_DIRECTORY}/Testing/TAG _tag LIMIT_COUNT 1) SET(_path "${CTEST_BINARY_DIRECTORY}/Testing/${_tag}") IF(NOT EXISTS ${_path}) - MESSAGE(FATAL_ERROR "Unable to determine test submission files from TAG. Bailing out.") + MESSAGE(FATAL_ERROR " +Unable to determine test submission files from TAG. Bailing out. +" + ) ENDIF() FILE(GLOB _xml_files ${_path}/*.xml) EXECUTE_PROCESS(COMMAND sed -i -e @@ -384,7 +414,10 @@ EXECUTE_PROCESS(COMMAND sed -i -e OUTPUT_QUIET RESULT_VARIABLE _res ) IF(NOT "${_res}" STREQUAL "0") - MESSAGE(FATAL_ERROR "\"sed\" failed. Bailing out.") + MESSAGE(FATAL_ERROR " +\"sed\" failed. Bailing out. +" + ) ENDIF() IF(NOT "${_svn_WC_REVISION}" STREQUAL "") @@ -405,4 +438,14 @@ ENDIF() # And finally submit: # -CTEST_SUBMIT() +CTEST_SUBMIT(RETRY_COUNT 2 RETRY_DELAY 30 RETURN_VALUE _res) +IF("${_res}" STREQUAL "0") + MESSAGE("-- Test submission successful.") +ELSE() + MESSAGE(FATAL_ERROR " +Test submission failed. +" + ) +ENDIF() + +# .oO( This script is freaky 451 lines long... ) -- 2.39.5