From 42f9b5da8ec9bb45e05ce82ea5aee195420d9ea3 Mon Sep 17 00:00:00 2001 From: maier Date: Wed, 18 Sep 2013 14:06:49 +0000 Subject: [PATCH] Provide a run script for tests to submit to a dashboard (first step...) git-svn-id: https://svn.dealii.org/branches/branch_port_the_testsuite@30789 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/CTestConfig.cmake | 27 +++++++ deal.II/doc/development/Config.sample | 36 +++++++++ deal.II/run_testsuite.cmake | 111 ++++++++++++++++++++++++++ tests/CMakeLists.txt | 1 - tests/README | 10 +-- 5 files changed, 179 insertions(+), 6 deletions(-) create mode 100644 deal.II/run_testsuite.cmake diff --git a/deal.II/CTestConfig.cmake b/deal.II/CTestConfig.cmake index c6407397e8..901b102259 100644 --- a/deal.II/CTestConfig.cmake +++ b/deal.II/CTestConfig.cmake @@ -14,10 +14,23 @@ ## ## --------------------------------------------------------------------- + +######################################################################## +# # +# General configuration: # +# # +######################################################################## + SET(CTEST_PROJECT_NAME "deal.II") SET(CTEST_NIGHTLY_START_TIME "1:00:00 UTC") +# TODO Drop method + +# +# Coverage options: +# + SET(CTEST_CUSTOM_COVERAGE_EXCLUDE "/bundled" "/CMakeFiles/CMakeTmp/" @@ -25,3 +38,17 @@ SET(CTEST_CUSTOM_COVERAGE_EXCLUDE ) SET(CTEST_USE_LAUNCHERS 1) + + +######################################################################## +# # +# Site and Build configuration: # +# # +######################################################################## + +FIND_PROGRAM(HOSTNAME_COMMAND NAMES hostname) +EXEC_PROGRAM(${HOSTNAME_COMMAND} OUTPUT_VARIABLE _hostname) +SET(CTEST_SITE "${_hostname}") + +SET(CTEST_BUILD_NAME "${CMAKE_SYSTEM}-${CMAKE_SYSTEM_PROCESSOR}-compiler") +MESSAGE(FATAL_ERROR "${CMAKE_SYSTEM}-${CMAKE_SYSTEM_PROCESSOR}") diff --git a/deal.II/doc/development/Config.sample b/deal.II/doc/development/Config.sample index df14dc07d3..0aadca83cc 100644 --- a/deal.II/doc/development/Config.sample +++ b/deal.II/doc/development/Config.sample @@ -561,6 +561,42 @@ +########################################################################### +# # +# Configuration Options for the Testsuite: # +# # +########################################################################### + + + +# +# You can limit the tests that will be set up by the setup_test target by +# setting TEST_PICKUP_REGEX: +# +# SET(TEST_PICKUP_REGEX "" CACHE STRING +# "A regular expression to control which tests will be configured" +# ) +# +# +# If numdiff is found, the TEST_DIFF defaults to 'numdiff -a 1e-6 -s ' \t\n:' +# otherwise pure diff will be used. You can set your own diff command via +# +# SET(TEST_DIFF "" CACHE STRING +# "The diff tool and command line to use" +# ) +# +# +# SET(TEST_TIME_LIMITTEST_DIFF "180" CACHE STRING +# "The time limit (in seconds) a single test (build, run, diff) is allowed to run" +# ) +# +# +# An optional hint to the numdiff executable: +# SET(NUMDIFF_DIR "/.../..." CACHE PATH "") +# + + + ########################################################################### # # # Advanced Configuration: # diff --git a/deal.II/run_testsuite.cmake b/deal.II/run_testsuite.cmake new file mode 100644 index 0000000000..bb9f9e766b --- /dev/null +++ b/deal.II/run_testsuite.cmake @@ -0,0 +1,111 @@ +## --------------------------------------------------------------------- +## $Id$ +## +## Copyright (C) 2013 by the deal.II authors +## +## This file is part of the deal.II library. +## +## The deal.II library is free software; you can use it, redistribute +## it, and/or modify it under the terms of the GNU Lesser General +## Public License as published by the Free Software Foundation; either +## version 2.1 of the License, or (at your option) any later version. +## The full text of the license can be found in the file LICENSE at +## the top level of the deal.II distribution. +## +## --------------------------------------------------------------------- + +######################################################################## +# # +# Test setup: # +# # +######################################################################## + +# +# 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}") + + +IF("${CTEST_SOURCE_DIRECTORY}" STREQUAL "") + # + # If CTEST_SOURCE_DIRECTORY is not set we just assume that this script + # was called residing in the source directory. + # + SET(CTEST_SOURCE_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}) +ENDIF() + +MESSAGE("-- CTEST_SOURCE_DIRECTORY: ${CTEST_SOURCE_DIRECTORY}") + + +IF("${CTEST_BINARY_DIRECTORY}" STREQUAL "") + # + # If CTEST_BINARY_DIRECTORY is not set we just use the current directory + # except it is equal to CTEST_SOURCE_DIRECTORY in which case we fail. + # + SET(CTEST_BINARY_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) + + IF("${CTEST_BINARY_DIRECTORY}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}") + MESSAGE(FATAL_ERROR " +ctest was invoked in the source directory and CTEST_BINARY_DIRECTORY is not set. +Please either call ctest from within a designated build directory, or set CTEST_BINARY_DIRECTORY accordingly." + ) + ENDIF() +ENDIF() + +MESSAGE("-- CTEST_BINARY_DIRECTORY: ${CTEST_BINARY_DIRECTORY}") + + +IF("${DEAL_II_NO_JOBS}" STREQUAL "") + SET(DEAL_II_NO_JOBS "1") +ENDIF() + +MESSAGE("-- DEAL_II_NO_JOBS: ${DEAL_II_NO_JOBS}") + + +######################################################################## +# # +# Run the testsuite: # +# # +######################################################################## + +IF("${TRACK}" STREQUAL "Experimental") + + # + # TRACK Experimental: + # + # It is assumed that the build directory is already configured + # + # - Run the configure, build and test stages and submit the results to + # the "Experimental" track + # + # - 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() + +ELSE() + + MESSAGE(FATAL_ERROR "TRACK has to be set TODO") + +ENDIF() + +#IF(NOT "${DEAL_II_CONFIG_FILE}" STREQUAL "") +# CTEST_CONFIGURE(OPTIONS -C"${DEAL_II_CONFIG_FILE}") +#ELSE() +# CTEST_CONFIGURE() +#ENDIF() diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 95e998ccf2..2a34868a65 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -135,7 +135,6 @@ FOREACH(_category ${_categories}) DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${_category} COMMENT "Processing ./tests/${_category}" ) - ADD_DEPENDENCIES(setup_test_${_category} library) ADD_DEPENDENCIES(setup_test setup_test_${_category}) ADD_CUSTOM_TARGET(clean_test_${_category} diff --git a/tests/README b/tests/README index 349a7c47c1..b9c5912d0d 100644 --- a/tests/README +++ b/tests/README @@ -137,6 +137,11 @@ CMake configuration variables for the testsuite The testsuite has the following options: + TEST_PICKUP_REGEX + - A regular expression to filter tests. If this is a nonempty string + only tests that match the regular expression will be set up. An empty + string is interpreted as a catchall. + TEST_DIFF - the diff tool and command line to use for comparison. If numdiff is available it defaults to "numdiff -a 1e-6 -q", otherwise plain diff @@ -146,11 +151,6 @@ The testsuite has the following options: - The time limit (in seconds) a single test is allowed to run. Defaults to 180 seconds - TEST_PICKUP_REGEX - - A regular expression to filter tests. If this is a nonempty string - only tests that match the regular expression will be set up. An empty - string is interpreted as a catchall. - These options can be set as environment variables prior to the call to the setup_test target: -- 2.39.5