From d5d53aa6e9250236b6cdbf1dae072c223c3465a0 Mon Sep 17 00:00:00 2001 From: Matthias Maier Date: Wed, 18 Sep 2013 14:47:36 +0000 Subject: [PATCH] some progress git-svn-id: https://svn.dealii.org/branches/branch_port_the_testsuite@30794 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/CTestConfig.cmake | 1 + deal.II/run_testsuite.cmake | 62 ++++++++++++++++++++++++++++++++----- 2 files changed, 56 insertions(+), 7 deletions(-) diff --git a/deal.II/CTestConfig.cmake b/deal.II/CTestConfig.cmake index 2713b51e4f..cdba0392fa 100644 --- a/deal.II/CTestConfig.cmake +++ b/deal.II/CTestConfig.cmake @@ -51,3 +51,4 @@ EXEC_PROGRAM(${HOSTNAME_COMMAND} OUTPUT_VARIABLE _hostname) SET(CTEST_SITE "${_hostname}") SET(CTEST_BUILD_NAME "${CMAKE_SYSTEM}-${CMAKE_SYSTEM_PROCESSOR}-todo") + diff --git a/deal.II/run_testsuite.cmake b/deal.II/run_testsuite.cmake index 9b6df3a5f3..900c705fc8 100644 --- a/deal.II/run_testsuite.cmake +++ b/deal.II/run_testsuite.cmake @@ -20,21 +20,23 @@ # # ######################################################################## +# +# CTEST_SOURCE_DIRECTORY +# CTEST_BINARY_DIRECTORY +# CTEST_CMAKE_GENERATOR # # TRACK # # DEAL_II_NO_JOBS # DEAL_II_CONFIG_FILE # -# CTEST_SOURCE_DIRECTORY -# CTEST_BINARY_DIRECTORY -# -# CTEST_CMAKE_GENERATOR -# CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8) MESSAGE("-- This is CTest ${CTEST_VERSION}") +# +# CTEST_SOURCE_DIR: +# IF("${CTEST_SOURCE_DIRECTORY}" STREQUAL "") # @@ -46,6 +48,9 @@ ENDIF() MESSAGE("-- CTEST_SOURCE_DIRECTORY: ${CTEST_SOURCE_DIRECTORY}") +# +# CTEST_BINARY_DIR: +# IF("${CTEST_BINARY_DIRECTORY}" STREQUAL "") # @@ -64,6 +69,44 @@ ENDIF() MESSAGE("-- CTEST_BINARY_DIRECTORY: ${CTEST_BINARY_DIRECTORY}") +# +# CTEST_CMAKE_GENERATOR: +# + +# Query Generator from build directory (if possible): +IF(EXISTS ${CTEST_BINARY_DIRECTORY}/CMakeCache.txt) + FILE(STRINGS ${CTEST_BINARY_DIRECTORY}/CMakeCache.txt _generator + REGEX "^CMAKE_GENERATOR:" + ) + STRING(REGEX REPLACE "^.*=" "" _generator ${_generator}) +ENDIF() + +IF("${CTEST_CMAKE_GENERATOR}" STREQUAL "") + IF(NOT "${_generator}" STREQUAL "") + SET(CTEST_CMAKE_GENERATOR ${_generator}) + ELSE() + MESSAGE(FATAL_ERROR " +The build directory is not configured and CTEST_CMAKE_GENERATOR is not set. +different Generator \"${CTEST_CMAKE_GENERATOR}\". +" + ) + ENDIF() +ELSE() + # ensure that CTEST_CMAKE_GENERATOR (that was apparantly set) is + # compatible with the build directory: + IF( NOT "${CTEST_CMAKE_GENERATOR}" STREQUAL "${_generator}" + AND NOT "${_generator}" STREQUAL "" ) + MESSAGE(FATAL_ERROR " +The build directory is already set up with Generator \"${_generator}\", but +CTEST_CMAKE_GENERATOR was set to a different Generator \"${CTEST_CMAKE_GENERATOR}\". +" + ) + ENDIF() +ENDIF() + +# +# DEAL_II_NO_JOBS: +# IF("${DEAL_II_NO_JOBS}" STREQUAL "") SET(DEAL_II_NO_JOBS "1") @@ -71,13 +114,16 @@ ENDIF() MESSAGE("-- DEAL_II_NO_JOBS: ${DEAL_II_NO_JOBS}") +# +# Finalize: +# + SET(CMAKE_EXTRA_SUBMIT_FILES ${CTEST_BINARY_DIRECTORY}/detailed.log # TODO ) - ######################################################################## # # # Run the testsuite: # @@ -97,12 +143,14 @@ IF("${TRACK}" STREQUAL "Experimental") # - No cleanup is done prior to test run # + + CTEST_START(Experimental TRACK Experimental) CTEST_CONFIGURE() # just reconfigure (without any options) CTEST_BUILD(TARGET setup_test) # setup tests CTEST_BUILD(TARGET) # builds the "all" target CTEST_TEST(PARALLEL_LEVEL ${DEAL_II_NO_JOBS}) - CTEST_SUBMIT() + #CTEST_SUBMIT() ELSE() -- 2.39.5