]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Refactor test layout: Move all relevant parts of the new testsuite to the source...
authorMatthias Maier <tamiko@kyomu.43-1.org>
Thu, 10 Oct 2013 13:22:02 +0000 (13:22 +0000)
committerMatthias Maier <tamiko@kyomu.43-1.org>
Thu, 10 Oct 2013 13:22:02 +0000 (13:22 +0000)
git-svn-id: https://svn.dealii.org/branches/branch_port_the_testsuite@31194 0785d39b-7218-0410-832d-ea1e28bc413d

44 files changed:
deal.II/CMakeLists.txt
deal.II/cmake/macros/macro_add_test.cmake [moved from tests/cmake/macros/macro_add_test.cmake with 95% similarity]
deal.II/cmake/macros/macro_pickup_tests.cmake [moved from tests/cmake/macros/macro_pickup_tests.cmake with 100% similarity]
deal.II/cmake/scripts/normalize.pl [moved from tests/cmake/scripts/normalize.pl with 100% similarity]
deal.II/cmake/scripts/run_test.cmake
deal.II/cmake/scripts/run_testsuite.cmake [new file with mode: 0644]
deal.II/cmake/setup_testsuite.cmake [moved from tests/cmake/setup_testsuite.cmake with 89% similarity]
deal.II/tests/CMakeLists.txt
deal.II/tests/all-headers/CMakeLists.txt [moved from tests/all-headers/CMakeLists.txt with 93% similarity]
deal.II/tests/all-headers/test_header.cc [moved from tests/all-headers/test_header.cc with 100% similarity]
deal.II/tests/build_tests/CMakeLists.txt [moved from tests/build_tests/CMakeLists.txt with 97% similarity]
deal.II/tests/quick_tests/CMakeLists.txt [new file with mode: 0644]
deal.II/tests/quick_tests/affinity.cc [moved from deal.II/tests/affinity.cc with 100% similarity]
tests/CMakeLists.txt
tests/TODO
tests/a-framework/CMakeLists.txt
tests/aniso/CMakeLists.txt
tests/base/CMakeLists.txt
tests/bits/CMakeLists.txt
tests/cmake/macros/macro_item_matches.cmake [deleted file]
tests/cmake/macros/macro_set_if_empty.cmake [deleted file]
tests/cmake/scripts/run_test.cmake [deleted file]
tests/codim_one/CMakeLists.txt
tests/deal.II/CMakeLists.txt
tests/distributed_grids/CMakeLists.txt
tests/fail/CMakeLists.txt
tests/fe/CMakeLists.txt
tests/gla/CMakeLists.txt
tests/grid/CMakeLists.txt
tests/hp/CMakeLists.txt
tests/integrators/CMakeLists.txt
tests/lac/CMakeLists.txt
tests/lapack/CMakeLists.txt
tests/matrix_free/CMakeLists.txt
tests/metis/CMakeLists.txt
tests/mpi/CMakeLists.txt
tests/multigrid/CMakeLists.txt
tests/petsc/CMakeLists.txt
tests/run_buildtests.cmake [new file with mode: 0644]
tests/run_testsuite.cmake
tests/serialization/CMakeLists.txt
tests/slepc/CMakeLists.txt
tests/trilinos/CMakeLists.txt
tests/umfpack/CMakeLists.txt

index 81ee9592e8f7ea47fb987b47bfbca52e8debd8ab..c5e09474bc4cb9d003a5b4ea4c4f572fa261ab04 100644 (file)
@@ -145,11 +145,7 @@ ADD_SUBDIRECTORY(cmake/config) # has to be included after source
 ADD_SUBDIRECTORY(contrib) # has to be included after source
 ADD_SUBDIRECTORY(examples)
 
-ADD_SUBDIRECTORY(tests ${CMAKE_BINARY_DIR}/tests/quick_tests)
-
-IF(DEAL_II_HAVE_TESTS_DIRECTORY)
-  ADD_SUBDIRECTORY(${TEST_DIR} ${CMAKE_BINARY_DIR}/tests)
-ENDIF()
+ADD_SUBDIRECTORY(tests)
 
 #
 # And finally, print the configuration:
similarity index 95%
rename from tests/cmake/macros/macro_add_test.cmake
rename to deal.II/cmake/macros/macro_add_test.cmake
index c32d1a702f6bcf14b3f5994df76df395a6938fd4..a6988695aa205a15f311642e180206b76c3a83bb 100644 (file)
 #   - specifying the maximal wall clock time in seconds a test is allowed
 #     to run
 #
-# TEST_DIR
-#   - pointing to the ./tests folder where normalize.pl and run_test.cmake are
-#     located under cmake/scripts
-#
-#
 # Usage:
 #     DEAL_II_ADD_TEST(category test_name comparison_file n_cpu [configurations])
 #
@@ -138,13 +133,13 @@ MACRO(DEAL_II_ADD_TEST _category _test_name _comparison_file _n_cpu)
               && cat ${_test_directory}/failing_output
               && exit 1)
         COMMAND
-          ${PERL_EXECUTABLE} -pi ${TEST_DIR}/cmake/scripts/normalize.pl
+          ${PERL_EXECUTABLE} -pi ${DEAL_II_SOURCE_DIR}/cmake/scripts/normalize.pl
                                  ${_test_directory}/output
         WORKING_DIRECTORY
           ${_test_directory}
         DEPENDS
           ${_target}
-          ${TEST_DIR}/cmake/scripts/normalize.pl
+          ${DEAL_II_SOURCE_DIR}/cmake/scripts/normalize.pl
         )
       ADD_CUSTOM_COMMAND(OUTPUT ${_test_directory}/diff
         COMMAND touch ${_test_directory}/diff
@@ -184,7 +179,7 @@ MACRO(DEAL_II_ADD_TEST _category _test_name _comparison_file _n_cpu)
           -DTRGT=${_diff_target}
           -DTEST=${_test_full}
           -DDEAL_II_BINARY_DIR=${CMAKE_BINARY_DIR}
-          -P ${TEST_DIR}/cmake/scripts/run_test.cmake
+          -P ${DEAL_II_SOURCE_DIR}/cmake/scripts/run_test.cmake
         WORKING_DIRECTORY ${_test_directory}
         )
       SET_TESTS_PROPERTIES(${_test_full} PROPERTIES
index 1955519fdf08c8bd1631ee0a60a867136ceeb3fe..4a27a36ee671dc7d9641077848530eb04caf0059 100644 (file)
@@ -1,9 +1,27 @@
+## ---------------------------------------------------------------------
+## $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.
+##
+## ---------------------------------------------------------------------
+
+#
+# This is a small worker to run a single test in the testsuite
 #
-# TODO: The following variables have to be set:
+# The following variables have to be set:
 #
-# TARGET
-# TEST
-# DEAL_II_BINARY_DIR
+#   TRGT - the name of the target that should be invoked
+#   TEST - the test name (used for status messages)
+#   DEAL_II_BINARY_DIR - the build directory that contains the target
 #
 
 EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND}
@@ -16,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()
@@ -45,11 +44,12 @@ ELSE()
   # Determine whether the CONFIGURE, BUILD or RUN stages were run successfully:
   #
 
-  # configure is special because it only exists in build tests:
-  STRING(REGEX MATCH "${TEST}: CONFIGURE failed\\." _configure_regex ${_output})
+  # CONFIGURE is special because it only exists in build tests:
+  STRING(REGEX MATCH "${TEST}: CONFIGURE successful\\." _configure_regex ${_output})
+  STRING(REGEX MATCH "${TEST}: CONFIGURE failed\\." _configure_regex_fail ${_output})
   STRING(REGEX MATCH "${TEST}: BUILD successful\\." _build_regex ${_output})
   STRING(REGEX MATCH "${TEST}: RUN successful\\." _run_regex ${_output})
-  IF(NOT "${_configure_regex}" STREQUAL "")
+  IF(NOT "${_configure_regex_fail}" STREQUAL "")
     SET(_stage CONFIGURE)
   ELSEIF("${_build_regex}" STREQUAL "")
     SET(_stage BUILD)
@@ -59,11 +59,11 @@ ELSE()
     SET(_stage DIFF)
   ENDIF()
 
-
   MESSAGE("Test ${TEST}: ${_stage}")
   MESSAGE("===============================   OUTPUT BEGIN  ===============================")
-  IF("${_build_regex}" STREQUAL "")
-    # Some special output in case the BUILD stage failed:
+  IF( "${_build_regex}" STREQUAL "" AND
+      "${_configure_regex}" STREQUAL "" )
+    # Some special output in case the BUILD stage failed in a regression test:
     MESSAGE("${TEST}: BUILD failed. Output:")
   ENDIF()
   MESSAGE(${_output})
diff --git a/deal.II/cmake/scripts/run_testsuite.cmake b/deal.II/cmake/scripts/run_testsuite.cmake
new file mode 100644 (file)
index 0000000..2a2b115
--- /dev/null
@@ -0,0 +1,460 @@
+## ---------------------------------------------------------------------
+## $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:                              #
+#                                                                      #
+########################################################################
+
+#
+# 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 overwritten with
+#
+#   ctest -D<variable>=<value> [...]
+#
+#
+#   CTEST_SOURCE_DIRECTORY
+#     - The source directory of deal.II (usually ending in "[...]/deal.II"
+#       (equivalent to https://svn.dealii.org/trunk/deal.II)
+#       Note: This is _not_ the test directory ending in "[...]/tests"
+#     - If unspecified, "../deal.II" relative to the location of this
+#       script is used. If this is not a source directory, an error is
+#       thrown.
+#
+#   CTEST_BINARY_DIRECTORY
+#     - The designated build directory (already configured, empty, or non
+#       existent - see the information about TRACKs what will happen)
+#     - If unspecified the current directory is used. If the current
+#       directory is equal to CTEST_SOURCE_DIRECTORY or the "tests"
+#       directory, an error is thrown.
+#
+#   CTEST_CMAKE_GENERATOR
+#     - The CMake Generator to use (e.g. "Unix Makefiles", or "Ninja", see
+#       $ man cmake)
+#     - If unspecified the generator of a configured build directory will
+#       be used, otherwise "Unix Makefiles".
+#
+#   TRACK
+#     - 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)
+#       that will be used during the configuration stage (invokes
+#       # cmake -C ${CONFIG_FILE}). This only has an effect if
+#       CTEST_BINARY_DIRECTORY is empty.
+#
+# Furthermore, the following variables controlling the testsuite can be set
+# and will be automatically handed down to cmake:
+#
+#   TEST_DIFF
+#   TEST_TIME_LIMIT
+#   TEST_PICKUP_REGEX
+#   NUMDIFF_DIR
+#
+# For details, consult the ./README file.
+#
+
+CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8)
+MESSAGE("-- This is CTest ${CMAKE_VERSION}")
+
+#
+# TRACK: Default to Experimental:
+#
+
+IF("${TRACK}" STREQUAL "")
+  SET(TRACK "Experimental")
+ENDIF()
+
+IF( NOT "${TRACK}" STREQUAL "Experimental"
+    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}")
+
+#
+# CTEST_SOURCE_DIRECTORY:
+#
+
+IF("${CTEST_SOURCE_DIRECTORY}" STREQUAL "")
+  #
+  # If CTEST_SOURCE_DIRECTORY is not set we just assume that this script
+  # was called residing under (a) ../tests relative to the source directory
+  # or (b) cmake/scipts in the source directory
+  #
+  GET_FILENAME_COMPONENT(_path "${CMAKE_CURRENT_LIST_DIR}" PATH)
+  SET(CTEST_SOURCE_DIRECTORY ${_path}/deal.II)
+
+  IF(NOT EXISTS ${CTEST_SOURCE_DIRECTORY}/CMakeLists.txt)
+    GET_FILENAME_COMPONENT(_path "${_path}" PATH)
+    SET(CTEST_SOURCE_DIRECTORY ${_path})
+  ENDIF()
+
+  IF(NOT EXISTS ${CTEST_SOURCE_DIRECTORY}/CMakeLists.txt)
+    MESSAGE(FATAL_ERROR "
+Could not find a suitable source directory. There is no source directory
+\"../deal.II\" or \"../../\" relative to the location of this script.
+Please, set CTEST_SOURCE_DIRECTORY manually to the appropriate source
+directory.
+"
+      )
+  ENDIF()
+ENDIF()
+
+MESSAGE("-- CTEST_SOURCE_DIRECTORY: ${CTEST_SOURCE_DIRECTORY}")
+
+#
+# Read in custom config files:
+#
+
+CTEST_READ_CUSTOM_FILES(${CTEST_SOURCE_DIRECTORY})
+
+#
+# CTEST_BINARY_DIRECTORY:
+#
+
+IF("${CTEST_BINARY_DIRECTORY}" STREQUAL "")
+  #
+  # If CTEST_BINARY_DIRECTORY is not set we just use the current directory
+  # except if it is equal to CTEST_SOURCE_DIRECTORY in which case we fail.
+  #
+  SET(CTEST_BINARY_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
+
+  IF( "${CTEST_BINARY_DIRECTORY}" STREQUAL "${CTEST_SOURCE_DIR}"
+      OR "${CTEST_BINARY_DIRECTORY}" STREQUAL "${CMAKE_CURRENT_LIST_DIR}" )
+    MESSAGE(FATAL_ERROR "
+ctest was invoked in the source directory (or test 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()
+
+#
+# Read in custom config files:
+#
+
+CTEST_READ_CUSTOM_FILES(${CTEST_BINARY_DIRECTORY})
+
+# Make sure that for a build test the directory is empty:
+FILE(GLOB _test ${CTEST_BINARY_DIRECTORY}/*)
+IF( "${TRACK}" STREQUAL "Build Tests"
+    AND NOT "${_test}" STREQUAL "" )
+      MESSAGE(FATAL_ERROR "
+TRACK was set to \"Build Tests\" which require an empty build directory.
+But files were found in \"${CTEST_BINARY_DIRECTORY}\"
+"
+        )
+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()
+    # default to "Unix Makefiles"
+    SET(CTEST_CMAKE_GENERATOR "Unix Makefiles")
+  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()
+
+#
+# CTEST_SITE:
+#
+
+FIND_PROGRAM(HOSTNAME_COMMAND NAMES hostname)
+EXEC_PROGRAM(${HOSTNAME_COMMAND} OUTPUT_VARIABLE _hostname)
+SET(CTEST_SITE "${_hostname}")
+
+MESSAGE("-- CTEST_SITE:             ${CTEST_SITE}")
+
+IF( "${TRACK}" STREQUAL "Regression Tests"
+    AND NOT CTEST_SITE MATCHES "c0541" )
+  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:
+#
+
+IF(NOT "${CONFIG_FILE}" STREQUAL "")
+  SET(_options "-C${CONFIG_FILE}")
+ENDIF()
+
+IF("${TRACK}" STREQUAL "Build Tests")
+  SET(TEST_PICKUP_REGEX "^build_tests")
+ENDIF()
+
+# Pass all relevant "TEST_" variables down to configure:
+GET_CMAKE_PROPERTY(_variables VARIABLES)
+FOREACH(_var ${_variables})
+  IF(_var MATCHES
+      "^(TEST_DIFF|TEST_TIME_LIMIT|TEST_PICKUP_REGEX|NUMDIFF_DIR)$"
+      )
+    LIST(APPEND _options "-D${_var}=${${_var}}")
+  ENDIF()
+ENDFOREACH()
+
+#
+# CTEST_BUILD_NAME:
+#
+
+# Append compiler information to CTEST_BUILD_NAME:
+IF(NOT EXISTS ${CTEST_BINARY_DIRECTORY}/detailed.log)
+  # Apparently, ${CTEST_BINARY_DIRECTORY} is not a configured build
+  # directory. In this case we need a trick: set up a dummy project and
+  # query it for the compiler information.
+  FILE(WRITE ${CTEST_BINARY_DIRECTORY}/query_for_compiler/CMakeLists.txt "
+FILE(WRITE ${CTEST_BINARY_DIRECTORY}/detailed.log
+  \"#        CMAKE_CXX_COMPILER:     \${CMAKE_CXX_COMPILER_ID} \${CMAKE_CXX_COMPILER_VERSION} on platform \${CMAKE_SYSTEM_NAME} \${CMAKE_SYSTEM_PROCESSOR}\"
+  )"
+    )
+  EXECUTE_PROCESS(
+    COMMAND ${CMAKE_COMMAND} ${_options} "-G${CTEST_CMAKE_GENERATOR}" .
+    OUTPUT_QUIET ERROR_QUIET
+    WORKING_DIRECTORY ${CTEST_BINARY_DIRECTORY}/query_for_compiler
+    )
+  FILE(REMOVE_RECURSE ${CTEST_BINARY_DIRECTORY}/query_for_compiler)
+ENDIF()
+
+IF(EXISTS ${CTEST_BINARY_DIRECTORY}/detailed.log)
+  FILE(STRINGS ${CTEST_BINARY_DIRECTORY}/detailed.log _compiler_id
+    REGEX "CMAKE_CXX_COMPILER:"
+    )
+  STRING(REGEX REPLACE
+    "^.*CMAKE_CXX_COMPILER:     \(.*\) on platform.*$" "\\1"
+    _compiler_id ${_compiler_id}
+    )
+  STRING(REGEX REPLACE "^\(.*\) .*$" "\\1" _compiler_name ${_compiler_id})
+  STRING(REGEX REPLACE "^.* " "" _compiler_version ${_compiler_id})
+  STRING(REGEX REPLACE " " "-" _compiler_id ${_compiler_id})
+  IF( NOT "${_compiler_id}" STREQUAL "" OR
+      _compiler_id MATCHES "CMAKE_CXX_COMPILER" )
+    SET(CTEST_BUILD_NAME "${_compiler_id}")
+  ENDIF()
+ENDIF()
+
+#
+# Append subversion branch to CTEST_BUILD_NAME:
+#
+FIND_PACKAGE(Subversion QUIET)
+EXECUTE_PROCESS(
+  COMMAND ${Subversion_SVN_EXECUTABLE} info ${CTEST_SOURCE_DIRECTORY}
+  OUTPUT_QUIET ERROR_QUIET
+  RESULT_VARIABLE _result
+  )
+IF(${_result} EQUAL 0)
+  Subversion_WC_INFO(${CTEST_SOURCE_DIRECTORY} _svn)
+  STRING(REGEX REPLACE "^${_svn_WC_ROOT}/" "" _branch ${_svn_WC_URL})
+  STRING(REGEX REPLACE "^branches/" "" _branch ${_branch})
+  STRING(REGEX REPLACE "/deal.II$" "" _branch ${_branch})
+  SET(CTEST_BUILD_NAME "${CTEST_BUILD_NAME}-${_branch}")
+ENDIF()
+
+#
+# Append config file name to CTEST_BUILD_NAME:
+#
+
+IF(NOT "${CONFIG_FILE}" STREQUAL "")
+  GET_FILENAME_COMPONENT(_conf ${CONFIG_FILE} NAME_WE)
+  STRING(REGEX REPLACE "#.*$" "" _conf ${_conf})
+  SET(CTEST_BUILD_NAME "${CTEST_BUILD_NAME}-${_conf}")
+ENDIF()
+
+MESSAGE("-- CTEST_BUILD_NAME:       ${CTEST_BUILD_NAME}")
+
+#
+# We require valid svn information for build tests:
+#
+
+IF( "${TRACK}" STREQUAL "Build Tests"
+    AND NOT DEFINED _svn_WC_REVISION )
+  MESSAGE(FATAL_ERROR "
+TRACK was set to \"Build Tests\" which requires the source directory to be
+under Subversion version control.
+"
+    )
+ENDIF()
+
+#
+# Write revision log:
+#
+
+IF(DEFINED _svn_WC_REVISION)
+  FILE(WRITE ${CTEST_BINARY_DIRECTORY}/revision.log
+"###
+#
+#  SVN information:
+#        SVN_WC_URL:               ${_svn_WC_URL}
+#        SVN_WC_REVISION:          ${_svn_WC_REVISION}
+#        SVN_WC_LAST_CHANGED_DATE: ${_svn_WC_LAST_CHANGED_DATE}
+#
+###"
+    )
+ELSE()
+  FILE(WRITE ${CTEST_BINARY_DIRECTORY}/revision.log
+"###
+#
+#  No SVN information available.
+#
+###"
+    )
+ENDIF()
+
+#
+# Declare files that should be submitted as notes:
+#
+
+SET(CTEST_NOTES_FILES
+  ${CTEST_BINARY_DIRECTORY}/revision.log
+  ${CTEST_BINARY_DIRECTORY}/summary.log
+  ${CTEST_BINARY_DIRECTORY}/detailed.log
+  ${CTEST_BINARY_DIRECTORY}/include/deal.II/base/config.h
+  )
+
+
+########################################################################
+#                                                                      #
+#                          Run the testsuite:                          #
+#                                                                      #
+########################################################################
+
+IF(NOT "${_branch}" STREQUAL "")
+  SET_PROPERTY(GLOBAL PROPERTY SubProject ${_branch})
+ENDIF()
+
+CTEST_START(Experimental TRACK ${TRACK})
+
+CTEST_CONFIGURE(OPTIONS "${_options}" RETURN_VALUE _res)
+
+IF("${_res}" STREQUAL "0")
+  # Only run the build stage if configure was successful:
+
+  CTEST_BUILD(TARGET NUMBER_ERRORS _res)
+
+  IF("${_res}" STREQUAL "0")
+    # Only run tests if the build was successful:
+
+    EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND}
+      --build ${CTEST_BINARY_DIRECTORY} --target setup_test
+      OUTPUT_QUIET RESULT_VARIABLE _res
+      )
+    IF(NOT "${_res}" STREQUAL "0")
+      MESSAGE(FATAL_ERROR "
+\"setup_test\" target exited with an error. Bailing out.
+"
+        )
+    ENDIF()
+
+    CTEST_TEST()
+  ENDIF()
+ENDIF()
+
+#
+# Inject compiler information and svn revision into xml files:
+#
+
+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.
+"
+    )
+ENDIF()
+FILE(GLOB _xml_files ${_path}/*.xml)
+EXECUTE_PROCESS(COMMAND sed -i -e
+  s/CompilerName=\"\"/CompilerName=\"${_compiler_name}\"\\n\\tCompilerVersion=\"${_compiler_version}\"/g
+  ${_xml_files}
+  OUTPUT_QUIET RESULT_VARIABLE  _res
+  )
+IF(NOT "${_res}" STREQUAL "0")
+  MESSAGE(FATAL_ERROR "
+\"sed\" failed. Bailing out.
+"
+    )
+ENDIF()
+
+IF(NOT "${_svn_WC_REVISION}" STREQUAL "")
+  FILE(WRITE ${_path}/Update.xml
+"<?xml version=\"1.0\" encoding=\"UTF-8\"?>
+<Update mode=\"Client\" Generator=\"ctest-${CTEST_VERSION}\">
+    <Site>${CTEST_SITE}</Site>
+      <BuildName>${CTEST_BUILD_NAME}</BuildName>
+        <BuildStamp>${_tag}-${TRACK}</BuildStamp>
+       <UpdateType>SVN</UpdateType>
+       <Revision>${_svn_WC_REVISION}</Revision>
+        <Path>${_branch}</Path>
+</Update>"
+    )
+ENDIF()
+
+#
+# And finally submit:
+#
+
+CTEST_SUBMIT()
+
+# .oO( This script is freaky 461 lines long... )
similarity index 89%
rename from tests/cmake/setup_testsuite.cmake
rename to deal.II/cmake/setup_testsuite.cmake
index 7a5b87fc0cd9a69948d9e90be5ba5ab729096fd1..e9a250e0e404a5dd5f346fa8e106fac016afca0c 100644 (file)
 ## ---------------------------------------------------------------------
 
 #
-# Setup necessary configuration for a testsuite sub project.
+# Setup necessary configuration in the testsuite subprojects.
+# This file is directly included by the test subprojects and not by the
+# main project.
 #
-# A testsuite subproject assumes the following cached variables to be set:
+# It is assumed that the following variables are set:
 #
 #    DEAL_II_BINARY_DIR
 #    DEAL_II_SOURCE_DIR
@@ -34,8 +36,7 @@
 #
 # Load all macros:
 #
-
-FILE(GLOB _macro_files ${CMAKE_CURRENT_LIST_DIR}/macros/*.cmake)
+FILE(GLOB _macro_files ${DEAL_II_SOURCE_DIR}/cmake/macros/*.cmake)
 FOREACH(_file ${_macro_files})
   INCLUDE(${_file})
 ENDFOREACH()
@@ -43,7 +44,6 @@ ENDFOREACH()
 #
 # Pick up values from environment:
 #
-
 SET_IF_EMPTY(DEAL_II_BINARY_DIR $ENV{DEAL_II_BINARY_DIR})
 SET_IF_EMPTY(DEAL_II_BINARY_DIR $ENV{DEAL_II_DIR})
 SET_IF_EMPTY(DEAL_II_SOURCE_DIR $ENV{DEAL_II_SOURCE_DIR})
@@ -54,7 +54,6 @@ SET_IF_EMPTY(TEST_PICKUP_REGEX $ENV{TEST_PICKUP_REGEX})
 #
 # We need deal.II and Perl as external packages:
 #
-
 FIND_PACKAGE(deal.II 8.0 REQUIRED
   HINTS ${DEAL_II_BINARY_DIR} ${DEAL_II_DIR}
   )
@@ -65,7 +64,6 @@ FIND_PACKAGE(Perl REQUIRED)
 #
 # We need a diff tool, preferably numdiff:
 #
-
 FIND_PROGRAM(DIFF_EXECUTABLE
   NAMES diff
   )
@@ -94,17 +92,15 @@ IF("${TEST_DIFF}" STREQUAL "")
 ELSE()
   # TODO: I have no idea how to prepare a custom string comming possibly
   # through two layers of command line into a list...
-  SEPARATE_ARGUMENTS(TEST_DIFF UNIX_COMMAND ${TEST_DIFF})
+  SEPARATE_ARGUMENTS(TEST_DIFF ${TEST_DIFF})
 ENDIF()
 
 #
 # Set a default time limit of 600 seconds:
 #
-
 SET_IF_EMPTY(TEST_TIME_LIMIT 600)
 
 #
 # And finally, enable testing:
 #
-
 ENABLE_TESTING()
index ad14ac2493930513b3ed8fa139bc19a16ab9c3e7..2ac4fed941adfc43bae02de8160aa55b0e2aad68 100644 (file)
 ## ---------------------------------------------------------------------
 
 #
-# A minimalistic set of tests:
+# This is a bloody hack to avoid a severe performance penalty when using
+# 12k top level targets with GNU Make that really does not like that...
 #
+# The only choice we have is to set up every test subdirectory as an
+# independent project. Unfortunately this adds quite a significant amount
+# of complexity :-(
+#
+
+ADD_SUBDIRECTORY(quick_tests)
+
+#
+# Custom targets to set and clean up the testsuite:
+#
+
+# Setup tests:
+ADD_CUSTOM_TARGET(setup_test)
+
+# Clean all tests
+ADD_CUSTOM_TARGET(clean_test)
 
-ENABLE_TESTING()
-
-FOREACH(_build ${DEAL_II_BUILD_TYPES})
-  STRING(TOLOWER ${_build} _build_lowercase)
-
-  #
-  # Test whether it is possible to configure, build and run a simplistic
-  # project, we use step 1:
-  #
-
-  SET(_target project.${_build_lowercase})
-  SET(_project_src ${CMAKE_SOURCE_DIR}/examples/step-1)
-  SET(_project ${CMAKE_CURRENT_BINARY_DIR}/${_target})
-
-  ADD_CUSTOM_COMMAND(OUTPUT ${_project}/CMakeLists.txt
-    COMMAND ${CMAKE_COMMAND} -E copy ${_project_src}/step-1.cc ${_project}/step-1.cc
-    COMMAND ${CMAKE_COMMAND} -E copy ${_project_src}/CMakeLists.txt ${_project}/CMakeLists.txt
-    DEPENDS ${_project_src}/step-1.cc ${_project_src}/CMakeLists.txt
-    )
-  ADD_CUSTOM_COMMAND(OUTPUT ${_project}-OK
-    COMMAND ${CMAKE_COMMAND} -DDEAL_II_DIR=${CMAKE_BINARY_DIR} -DCMAKE_BUILD_TYPE=${_build} .
-      || (rm ${_project}-OK && exit 1)
-    COMMAND ${CMAKE_COMMAND} --build ${_project} --target run > ${CMAKE_CURRENT_BINARY_DIR}/${_target}-OK
-      || (rm ${_project}-OK && exit 1)
-    COMMAND touch ${_project}-OK
-    WORKING_DIRECTORY ${_project}
-    DEPENDS ${_project}/CMakeLists.txt
-    )
-  ADD_CUSTOM_TARGET(${_target} DEPENDS ${_project}-OK)
-
-  ADD_TEST(NAME ${_target}
-    COMMAND ${CMAKE_COMMAND} -DTRGT=${_target} -DTEST=${_target}
-      -DDEAL_II_BINARY_DIR=${CMAKE_BINARY_DIR}
-      -P ${CMAKE_SOURCE_DIR}/cmake/scripts/run_test.cmake
-    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
-    )
-  SET_TESTS_PROPERTIES(${_test} PROPERTIES LABEL "sanity checks")
-
-  #
-  # Test whether thread affinity is well behaved:
-  #
-  SET(_target affinity.${_build_lowercase})
-
-  ADD_EXECUTABLE(${_target} EXCLUDE_FROM_ALL affinity.cc)
-  DEAL_II_INSOURCE_SETUP_TARGET(${_target} ${_build})
-
-  ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_target}-OK
-    COMMAND ${_target} > ${CMAKE_CURRENT_BINARY_DIR}/${_target}-OK 2>&1 || (rm ${_target}-OK && exit 1)
-    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
-    )
-  ADD_CUSTOM_TARGET(${_target}.run DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${_target}-OK)
-
-  ADD_TEST(NAME ${_target}
-    COMMAND ${CMAKE_COMMAND} -DTRGT=${_target}.run -DTEST=${_target}
-      -DDEAL_II_BINARY_DIR=${CMAKE_BINARY_DIR}
-      -P ${CMAKE_SOURCE_DIR}/cmake/scripts/run_test.cmake
-    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
-    )
-  SET_TESTS_PROPERTIES(${_target} PROPERTIES LABEL "sanity checks")
+# Remove all tests:
+ADD_CUSTOM_TARGET(prune_test)
 
+#
+# Write a minimalistic CTestTestfile.cmake file to CMAKE_BINARY_DIR and
+# CMAKE_CURRENT_BINARY_DIR:
+#
+FILE(WRITE ${CMAKE_BINARY_DIR}/CTestTestfile.cmake
+  "SUBDIRS(tests)"
+  )
+FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/CTestTestfile.cmake "")
+
+#
+# Pass all relevant "TEST_" and "_DIR" variables down to the subprojects:
+#
+SET(_options)
+LIST(APPEND _options -DDEAL_II_SOURCE_DIR=${CMAKE_SOURCE_DIR})
+LIST(APPEND _options -DDEAL_II_BINARY_DIR=${CMAKE_BINARY_DIR})
+FOREACH(_var TEST_DIFF TEST_TIME_LIMIT TEST_PICKUP_REGEX NUMDIFF_DIR)
+  LIST(APPEND _options "-U${_var}")
+  IF(DEFINED ${_var})
+    LIST(APPEND _options "-D${_var}=${${_var}}")
+  ENDIF()
 ENDFOREACH()
 
 #
-# A custom test target:
+# Glob together a list of all subfolders to set up:
 #
-# @TIMO: TODO, write a little script to be run after ctest that queries for
-# (affinity|project|etc).(debug|release)-OK and outputs an appropriate
-# message.
+FILE(GLOB _categories RELATIVE ${TEST_DIR} ${TEST_DIR}/*)
+SET(_categories all-headers build_tests ${_categories})
+
 #
-ADD_CUSTOM_TARGET(test
-  COMMAND ${CMAKE_CTEST_COMMAND} --force-new-ctest-process
-  WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
-  )
+# Define a subproject for every enabled category:
+#
+
+FOREACH(_category ${_categories})
+  IF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${_category}/CMakeLists.txt)
+    SET(_category_dir ${CMAKE_CURRENT_SOURCE_DIR}/${_category})
+  ELSEIF(EXISTS ${TEST_DIR}/${_category}/CMakeLists.txt)
+    SET(_category_dir ${TEST_DIR}/${_category})
+  ELSE()
+    SET(_category_dir)
+  ENDIF()
+
+  IF(NOT "${_category_dir}" STREQUAL "")
+
+    ADD_CUSTOM_TARGET(setup_test_${_category}
+      COMMAND ${CMAKE_COMMAND} -E make_directory
+        ${CMAKE_CURRENT_BINARY_DIR}/${_category}
+      COMMAND cd ${CMAKE_CURRENT_BINARY_DIR}/${_category} &&
+        ${CMAKE_COMMAND} -G${CMAKE_GENERATOR} ${_options} ${_category_dir}
+        > /dev/null # Shoo!
+      DEPENDS ${_category_dir}
+      COMMENT "Processing tests/${_category}"
+      )
+    ADD_DEPENDENCIES(setup_test setup_test_${_category})
+
+    # depend on a valid build directory (libraries built, config in place):
+    ADD_DEPENDENCIES(setup_test_${_category} setup_build_dir)
+
+    ADD_CUSTOM_TARGET(clean_test_${_category}
+      COMMAND [ ! -d ${_category} ] || ${CMAKE_COMMAND}
+        --build ${CMAKE_CURRENT_BINARY_DIR}/${_category} --target clean
+      )
+    ADD_DEPENDENCIES(clean_test clean_test_${_category})
+
+    ADD_CUSTOM_TARGET(prune_test_${_category}
+      COMMAND ${CMAKE_COMMAND} -E remove_directory
+        ${CMAKE_CURRENT_BINARY_DIR}/${_category}
+      )
+    ADD_DEPENDENCIES(prune_test prune_test_${_category})
+
+    FILE(APPEND ${CMAKE_CURRENT_BINARY_DIR}/CTestTestfile.cmake
+      "SUBDIRS(${_category})\n"
+      )
+
+  ENDIF()
+ENDFOREACH()
similarity index 93%
rename from tests/all-headers/CMakeLists.txt
rename to deal.II/tests/all-headers/CMakeLists.txt
index a43e407e9550dc1e7cfd4258c09ed1d808d58005..607240037a8646350652dcaba00d362d2756591a 100644 (file)
@@ -15,7 +15,7 @@
 ## ---------------------------------------------------------------------
 
 CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8)
-INCLUDE(${TEST_DIR}/cmake/setup_testsuite.cmake)
+INCLUDE(${DEAL_II_SOURCE_DIR}/cmake/setup_testsuite.cmake)
 PROJECT(testsuite CXX)
 INCLUDE(${DEAL_II_TARGET_CONFIG})
 
@@ -68,11 +68,9 @@ FOREACH(_full_file ${_header})
 
       # And finally add the test:
       ADD_TEST(NAME ${_test}
-        COMMAND ${CMAKE_COMMAND}
-          -DTRGT=${_target}
-          -DTEST=${_test}
+        COMMAND ${CMAKE_COMMAND} -DTRGT=${_target} -DTEST=${_test}
           -DDEAL_II_BINARY_DIR=${CMAKE_BINARY_DIR}
-          -P ${TEST_DIR}/cmake/scripts/run_test.cmake
+          -P ${DEAL_II_SOURCE_DIR}/cmake/scripts/run_test.cmake
         WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
         )
       SET_TESTS_PROPERTIES(${_test} PROPERTIES
similarity index 97%
rename from tests/build_tests/CMakeLists.txt
rename to deal.II/tests/build_tests/CMakeLists.txt
index 95f8a63152f6d7b4a164ed964ca39aa95af8b2fa..08aed0907847f7a2f28c3f5511a9c1ad531ef7f3 100644 (file)
@@ -15,7 +15,7 @@
 ## ---------------------------------------------------------------------
 
 CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8)
-INCLUDE(${TEST_DIR}/cmake/setup_testsuite.cmake)
+INCLUDE(${DEAL_II_SOURCE_DIR}/cmake/setup_testsuite.cmake)
 PROJECT(testsuite CXX)
 INCLUDE(${DEAL_II_TARGET_CONFIG})
 
@@ -164,11 +164,9 @@ FOREACH(_step_full ${_steps})
 
       # And finally add the test:
       ADD_TEST(NAME ${_test}
-        COMMAND ${CMAKE_COMMAND}
-          -DTRGT=${_target}
-          -DTEST=${_test}
+        COMMAND ${CMAKE_COMMAND} -DTRGT=${_target} -DTEST=${_test}
           -DDEAL_II_BINARY_DIR=${CMAKE_BINARY_DIR}
-          -P ${TEST_DIR}/cmake/scripts/run_test.cmake
+          -P ${DEAL_II_SOURCE_DIR}/cmake/scripts/run_test.cmake
         WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
         )
       SET_TESTS_PROPERTIES(${_test} PROPERTIES
diff --git a/deal.II/tests/quick_tests/CMakeLists.txt b/deal.II/tests/quick_tests/CMakeLists.txt
new file mode 100644 (file)
index 0000000..e8cac30
--- /dev/null
@@ -0,0 +1,56 @@
+## ---------------------------------------------------------------------
+## $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.
+##
+## ---------------------------------------------------------------------
+
+#
+# A minimalistic set of tests:
+#
+
+ENABLE_TESTING()
+
+FOREACH(_build ${DEAL_II_BUILD_TYPES})
+  STRING(TOLOWER ${_build} _build_lowercase)
+
+  #
+  # Test whether thread affinity is well behaved:
+  #
+  SET(_target affinity.${_build_lowercase})
+
+  ADD_EXECUTABLE(${_target} EXCLUDE_FROM_ALL affinity.cc)
+  DEAL_II_INSOURCE_SETUP_TARGET(${_target} ${_build})
+
+  ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_target}-OK
+    COMMAND ${_target} > ${CMAKE_CURRENT_BINARY_DIR}/${_target}-OK 2>&1 || (rm ${_target}-OK && exit 1)
+    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+    )
+  ADD_CUSTOM_TARGET(${_target}.run DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${_target}-OK)
+
+  ADD_TEST(NAME ${_target}
+    COMMAND ${CMAKE_COMMAND} -DTRGT=${_target}.run -DTEST=${_target}
+      -DDEAL_II_BINARY_DIR=${CMAKE_BINARY_DIR}
+      -P ${CMAKE_SOURCE_DIR}/cmake/scripts/run_test.cmake
+    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+    )
+  SET_TESTS_PROPERTIES(${_target} PROPERTIES LABEL "sanity checks")
+
+ENDFOREACH()
+
+#
+# A custom test target:
+#
+ADD_CUSTOM_TARGET(test
+  COMMAND ${CMAKE_CTEST_COMMAND} --force-new-ctest-process
+  WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+  )
index 1de72dd17ef6831ded402dd254c12002a4de285d..15b4d9ad0cd5fbef70b909f3245868d5cbb4cb0c 100644 (file)
@@ -1,150 +1,4 @@
-## ---------------------------------------------------------------------
-## $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.
-##
-## ---------------------------------------------------------------------
-
-#
-# This is a bloody hack to avoid a severe performance penalty when using
-# 12k top level targets with GNU Make that really does not like that...
-#
-# The only choice we have is to set up every test subdirectory as an
-# independent project. Unfortunately this adds quite a significant amount
-# of complexity :-(
-#
-
-CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8)
-MESSAGE(STATUS "Proceed to test definitions now.")
-ENABLE_TESTING()
-
-IF(NOT "${CMAKE_PROJECT_NAME}" STREQUAL "deal.II")
-  MESSAGE(FATAL_ERROR
-    "The testsuite cannot be set up as an independent project. Please configure \"deal.II\" instead."
-    )
-ENDIF()
-
-#
-# Write a minimalistic CTestTestfile.cmake file to CMAKE_BINARY_DIR:
-#
-FILE(WRITE ${CMAKE_BINARY_DIR}/CTestTestfile.cmake
-  "SUBDIRS(tests)"
+MESSAGE(FATAL_ERROR "\n
+The testsuite cannot be set up as an independent project.
+Please configure \"deal.II\" directly instead.\n\n"
   )
-
-#
-# The hook into CTest so that the tests from the suprojects get picked up
-# by the main project:
-#
-
-FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/deal.IITestfile.cmake "")
-SET_PROPERTY(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
-  APPEND PROPERTY TEST_INCLUDE_FILE deal.IITestfile.cmake
-  )
-
-#
-# Pass all relevant "TEST_" and "_DIR" variables down to the subprojects:
-#
-
-SET(_options)
-
-LIST(APPEND _options -DDEAL_II_SOURCE_DIR=${CMAKE_SOURCE_DIR})
-LIST(APPEND _options -DDEAL_II_BINARY_DIR=${CMAKE_BINARY_DIR})
-
-FOREACH(_var TEST_DIR TEST_DIFF TEST_TIME_LIMIT TEST_PICKUP_REGEX NUMDIFF_DIR)
-  LIST(APPEND _options "-U${_var}")
-  IF(DEFINED ${_var})
-    LIST(APPEND _options "-D${_var}=${${_var}}")
-  ENDIF()
-ENDFOREACH()
-
-#
-# Custom targets to set and clean up the testsuite:
-#
-
-# Setup tests:
-ADD_CUSTOM_TARGET(setup_test)
-
-# Clean all tests
-ADD_CUSTOM_TARGET(clean_test)
-
-# Remove all tests:
-ADD_CUSTOM_TARGET(prune_test)
-
-#
-# The list of subfolders to set up:
-#
-
-SET(_categories
-  all-headers aniso base bits build_tests codim_one deal.II fe grid hp integrators lac matrix_free multigrid serialization
-  )
-IF(DEAL_II_WITH_LAPACK)
-  LIST(APPEND _categories lapack)
-ENDIF()
-IF(DEAL_II_WITH_METIS)
-  LIST(APPEND _categories metis)
-ENDIF()
-IF(DEAL_II_WITH_MPI AND DEAL_II_WITH_P4EST)
-  LIST(APPEND _categories gla mpi)
-ENDIF()
-IF(DEAL_II_WITH_P4EST)
-  LIST(APPEND _categories distributed_grids)
-ENDIF()
-IF(DEAL_II_WITH_PETSC)
-  LIST(APPEND _categories petsc)
-ENDIF()
-IF(DEAL_II_WITH_SLEPC)
-  LIST(APPEND _categories slepc)
-ENDIF()
-IF(DEAL_II_WITH_TRILINOS)
-  LIST(APPEND _categories trilinos)
-ENDIF()
-IF(DEAL_II_WITH_UMFPACK)
-  LIST(APPEND _categories umfpack)
-ENDIF()
-
-#
-# Define a subproject for every enabled category:
-#
-
-FOREACH(_category ${_categories})
-  ADD_CUSTOM_TARGET(setup_test_${_category}
-    COMMAND ${CMAKE_COMMAND} -E make_directory
-      ${CMAKE_CURRENT_BINARY_DIR}/${_category}
-    COMMAND cd ${CMAKE_CURRENT_BINARY_DIR}/${_category} &&
-      ${CMAKE_COMMAND} -G${CMAKE_GENERATOR}
-      ${_options}
-      ${CMAKE_CURRENT_SOURCE_DIR}/${_category}
-      > /dev/null # Shoo!
-    DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${_category}
-    COMMENT "Processing ./tests/${_category}"
-    )
-  ADD_DEPENDENCIES(setup_test setup_test_${_category})
-
-  # depend on a valid build directory (libraries built, config in place):
-  ADD_DEPENDENCIES(setup_test_${_category} setup_build_dir)
-
-  ADD_CUSTOM_TARGET(clean_test_${_category}
-    COMMAND [ ! -d ${_category} ] || ${CMAKE_COMMAND}
-      --build ${CMAKE_CURRENT_BINARY_DIR}/${_category} --target clean
-    )
-  ADD_DEPENDENCIES(clean_test clean_test_${_category})
-
-  ADD_CUSTOM_TARGET(prune_test_${_category}
-    COMMAND ${CMAKE_COMMAND} -E remove_directory
-      ${CMAKE_CURRENT_BINARY_DIR}/${_category}
-    )
-  ADD_DEPENDENCIES(prune_test prune_test_${_category})
-
-  FILE(APPEND ${CMAKE_CURRENT_BINARY_DIR}/deal.IITestfile.cmake
-    "SUBDIRS(${_category})\n"
-    )
-ENDFOREACH()
index cd5b4e24877ae09267dbc8d72b3f89dc523034c1..fcbc2952cf23a43148ea39c2d53699047940b011 100644 (file)
@@ -13,8 +13,8 @@ Issues:
    distributed_grids/ fail.
 
  - ISSUE:
-   Depending on the version of boost, a version number in the serialization
-   output changes and all tests just under serialization/ just fail
+   Quite some tests that use PETSc depend on specific external packages,
+   e.g. hypre and mumps
 
  - Mesh converter tests?
 
index a51b880d4ffad7c62903fd19506a097d25728cbe..e39c51b85d2fa39981f342cb7b34ad9e3e6e2830 100644 (file)
@@ -1,5 +1,5 @@
 CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8)
-INCLUDE(${TEST_DIR}/cmake/setup_testsuite.cmake)
+INCLUDE(${DEAL_II_SOURCE_DIR}/cmake/setup_testsuite.cmake)
 PROJECT(testsuite CXX)
 INCLUDE(${DEAL_II_TARGET_CONFIG})
 DEAL_II_PICKUP_TESTS()
index a51b880d4ffad7c62903fd19506a097d25728cbe..e39c51b85d2fa39981f342cb7b34ad9e3e6e2830 100644 (file)
@@ -1,5 +1,5 @@
 CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8)
-INCLUDE(${TEST_DIR}/cmake/setup_testsuite.cmake)
+INCLUDE(${DEAL_II_SOURCE_DIR}/cmake/setup_testsuite.cmake)
 PROJECT(testsuite CXX)
 INCLUDE(${DEAL_II_TARGET_CONFIG})
 DEAL_II_PICKUP_TESTS()
index a51b880d4ffad7c62903fd19506a097d25728cbe..e39c51b85d2fa39981f342cb7b34ad9e3e6e2830 100644 (file)
@@ -1,5 +1,5 @@
 CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8)
-INCLUDE(${TEST_DIR}/cmake/setup_testsuite.cmake)
+INCLUDE(${DEAL_II_SOURCE_DIR}/cmake/setup_testsuite.cmake)
 PROJECT(testsuite CXX)
 INCLUDE(${DEAL_II_TARGET_CONFIG})
 DEAL_II_PICKUP_TESTS()
index a51b880d4ffad7c62903fd19506a097d25728cbe..e39c51b85d2fa39981f342cb7b34ad9e3e6e2830 100644 (file)
@@ -1,5 +1,5 @@
 CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8)
-INCLUDE(${TEST_DIR}/cmake/setup_testsuite.cmake)
+INCLUDE(${DEAL_II_SOURCE_DIR}/cmake/setup_testsuite.cmake)
 PROJECT(testsuite CXX)
 INCLUDE(${DEAL_II_TARGET_CONFIG})
 DEAL_II_PICKUP_TESTS()
diff --git a/tests/cmake/macros/macro_item_matches.cmake b/tests/cmake/macros/macro_item_matches.cmake
deleted file mode 100644 (file)
index 3e747bb..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-## ---------------------------------------------------------------------
-## $Id$
-##
-## Copyright (C) 2012 - 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.
-##
-## ---------------------------------------------------------------------
-
-#
-# A small macro to test whether a given list contains an element.
-#
-# Usage:
-#     ITEM_MATCHES(var regex list)
-#
-# var is set to true if list contains an item that matches regex.
-#
-
-MACRO(ITEM_MATCHES _var _regex)
-  SET(${_var})
-  FOREACH (_item ${ARGN})
-    IF("${_item}" MATCHES ${_regex})
-      SET(${_var} TRUE)
-      BREAK()
-    ENDIF()
-  ENDFOREACH()
-ENDMACRO()
-
diff --git a/tests/cmake/macros/macro_set_if_empty.cmake b/tests/cmake/macros/macro_set_if_empty.cmake
deleted file mode 100644 (file)
index 35acf55..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-## ---------------------------------------------------------------------
-## $Id$
-##
-## Copyright (C) 2012 - 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.
-##
-## ---------------------------------------------------------------------
-
-#
-# If 'variable' is empty it will be set to 'value'
-#
-MACRO(SET_IF_EMPTY _variable)
-  IF("${${_variable}}" STREQUAL "")
-    SET(${_variable} ${ARGN})
-  ENDIF()
-ENDMACRO()
-
diff --git a/tests/cmake/scripts/run_test.cmake b/tests/cmake/scripts/run_test.cmake
deleted file mode 100644 (file)
index 4a27a36..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-## ---------------------------------------------------------------------
-## $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.
-##
-## ---------------------------------------------------------------------
-
-#
-# This is a small worker to run a single test in the testsuite
-#
-# The following variables have to be set:
-#
-#   TRGT - the name of the target that should be invoked
-#   TEST - the test name (used for status messages)
-#   DEAL_II_BINARY_DIR - the build directory that contains the target
-#
-
-EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND}
-  --build ${DEAL_II_BINARY_DIR} --target ${TRGT}
-  RESULT_VARIABLE _result_code
-  OUTPUT_VARIABLE _output
-  )
-
-IF("${_result_code}" STREQUAL "0")
-
-  MESSAGE("Test ${TEST}: PASSED")
-  MESSAGE("===============================   OUTPUT BEGIN  ===============================")
-  # Do not output everything, just that we are successful:
-  MESSAGE("${TEST}: PASSED.")
-  MESSAGE("===============================    OUTPUT END   ===============================")
-
-ELSE()
-
-  #
-  # Determine whether the CONFIGURE, BUILD or RUN stages were run successfully:
-  #
-
-  # CONFIGURE is special because it only exists in build tests:
-  STRING(REGEX MATCH "${TEST}: CONFIGURE successful\\." _configure_regex ${_output})
-  STRING(REGEX MATCH "${TEST}: CONFIGURE failed\\." _configure_regex_fail ${_output})
-  STRING(REGEX MATCH "${TEST}: BUILD successful\\." _build_regex ${_output})
-  STRING(REGEX MATCH "${TEST}: RUN successful\\." _run_regex ${_output})
-  IF(NOT "${_configure_regex_fail}" STREQUAL "")
-    SET(_stage CONFIGURE)
-  ELSEIF("${_build_regex}" STREQUAL "")
-    SET(_stage BUILD)
-  ELSEIF("${_run_regex}" STREQUAL "")
-    SET(_stage RUN)
-  ELSE()
-    SET(_stage DIFF)
-  ENDIF()
-
-  MESSAGE("Test ${TEST}: ${_stage}")
-  MESSAGE("===============================   OUTPUT BEGIN  ===============================")
-  IF( "${_build_regex}" STREQUAL "" AND
-      "${_configure_regex}" STREQUAL "" )
-    # Some special output in case the BUILD stage failed in a regression test:
-    MESSAGE("${TEST}: BUILD failed. Output:")
-  ENDIF()
-  MESSAGE(${_output})
-  MESSAGE("")
-  MESSAGE("${TEST}: ******    ${_stage} failed    *******")
-  MESSAGE("")
-  MESSAGE("===============================    OUTPUT END   ===============================")
-  MESSAGE(FATAL_ERROR "*** abort")
-
-ENDIF()
index a51b880d4ffad7c62903fd19506a097d25728cbe..e39c51b85d2fa39981f342cb7b34ad9e3e6e2830 100644 (file)
@@ -1,5 +1,5 @@
 CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8)
-INCLUDE(${TEST_DIR}/cmake/setup_testsuite.cmake)
+INCLUDE(${DEAL_II_SOURCE_DIR}/cmake/setup_testsuite.cmake)
 PROJECT(testsuite CXX)
 INCLUDE(${DEAL_II_TARGET_CONFIG})
 DEAL_II_PICKUP_TESTS()
index a51b880d4ffad7c62903fd19506a097d25728cbe..e39c51b85d2fa39981f342cb7b34ad9e3e6e2830 100644 (file)
@@ -1,5 +1,5 @@
 CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8)
-INCLUDE(${TEST_DIR}/cmake/setup_testsuite.cmake)
+INCLUDE(${DEAL_II_SOURCE_DIR}/cmake/setup_testsuite.cmake)
 PROJECT(testsuite CXX)
 INCLUDE(${DEAL_II_TARGET_CONFIG})
 DEAL_II_PICKUP_TESTS()
index a51b880d4ffad7c62903fd19506a097d25728cbe..e1ba866f7edc5981b6034aa816b338aa1a768813 100644 (file)
@@ -1,5 +1,7 @@
 CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8)
-INCLUDE(${TEST_DIR}/cmake/setup_testsuite.cmake)
+INCLUDE(${DEAL_II_SOURCE_DIR}/cmake/setup_testsuite.cmake)
 PROJECT(testsuite CXX)
 INCLUDE(${DEAL_II_TARGET_CONFIG})
-DEAL_II_PICKUP_TESTS()
+IF(DEAL_II_WITH_P4EST)
+  DEAL_II_PICKUP_TESTS()
+ENDIF()
index a51b880d4ffad7c62903fd19506a097d25728cbe..e39c51b85d2fa39981f342cb7b34ad9e3e6e2830 100644 (file)
@@ -1,5 +1,5 @@
 CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8)
-INCLUDE(${TEST_DIR}/cmake/setup_testsuite.cmake)
+INCLUDE(${DEAL_II_SOURCE_DIR}/cmake/setup_testsuite.cmake)
 PROJECT(testsuite CXX)
 INCLUDE(${DEAL_II_TARGET_CONFIG})
 DEAL_II_PICKUP_TESTS()
index a51b880d4ffad7c62903fd19506a097d25728cbe..e39c51b85d2fa39981f342cb7b34ad9e3e6e2830 100644 (file)
@@ -1,5 +1,5 @@
 CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8)
-INCLUDE(${TEST_DIR}/cmake/setup_testsuite.cmake)
+INCLUDE(${DEAL_II_SOURCE_DIR}/cmake/setup_testsuite.cmake)
 PROJECT(testsuite CXX)
 INCLUDE(${DEAL_II_TARGET_CONFIG})
 DEAL_II_PICKUP_TESTS()
index a51b880d4ffad7c62903fd19506a097d25728cbe..ef84a0b38692feb3d496ef5e4626a2f25f8519e7 100644 (file)
@@ -1,5 +1,7 @@
 CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8)
-INCLUDE(${TEST_DIR}/cmake/setup_testsuite.cmake)
+INCLUDE(${DEAL_II_SOURCE_DIR}/cmake/setup_testsuite.cmake)
 PROJECT(testsuite CXX)
 INCLUDE(${DEAL_II_TARGET_CONFIG})
-DEAL_II_PICKUP_TESTS()
+IF(DEAL_II_WITH_MPI AND DEAL_II_WITH_P4EST)
+  DEAL_II_PICKUP_TESTS()
+ENDIF()
index a51b880d4ffad7c62903fd19506a097d25728cbe..e39c51b85d2fa39981f342cb7b34ad9e3e6e2830 100644 (file)
@@ -1,5 +1,5 @@
 CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8)
-INCLUDE(${TEST_DIR}/cmake/setup_testsuite.cmake)
+INCLUDE(${DEAL_II_SOURCE_DIR}/cmake/setup_testsuite.cmake)
 PROJECT(testsuite CXX)
 INCLUDE(${DEAL_II_TARGET_CONFIG})
 DEAL_II_PICKUP_TESTS()
index a51b880d4ffad7c62903fd19506a097d25728cbe..e39c51b85d2fa39981f342cb7b34ad9e3e6e2830 100644 (file)
@@ -1,5 +1,5 @@
 CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8)
-INCLUDE(${TEST_DIR}/cmake/setup_testsuite.cmake)
+INCLUDE(${DEAL_II_SOURCE_DIR}/cmake/setup_testsuite.cmake)
 PROJECT(testsuite CXX)
 INCLUDE(${DEAL_II_TARGET_CONFIG})
 DEAL_II_PICKUP_TESTS()
index a51b880d4ffad7c62903fd19506a097d25728cbe..e39c51b85d2fa39981f342cb7b34ad9e3e6e2830 100644 (file)
@@ -1,5 +1,5 @@
 CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8)
-INCLUDE(${TEST_DIR}/cmake/setup_testsuite.cmake)
+INCLUDE(${DEAL_II_SOURCE_DIR}/cmake/setup_testsuite.cmake)
 PROJECT(testsuite CXX)
 INCLUDE(${DEAL_II_TARGET_CONFIG})
 DEAL_II_PICKUP_TESTS()
index a51b880d4ffad7c62903fd19506a097d25728cbe..e39c51b85d2fa39981f342cb7b34ad9e3e6e2830 100644 (file)
@@ -1,5 +1,5 @@
 CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8)
-INCLUDE(${TEST_DIR}/cmake/setup_testsuite.cmake)
+INCLUDE(${DEAL_II_SOURCE_DIR}/cmake/setup_testsuite.cmake)
 PROJECT(testsuite CXX)
 INCLUDE(${DEAL_II_TARGET_CONFIG})
 DEAL_II_PICKUP_TESTS()
index a51b880d4ffad7c62903fd19506a097d25728cbe..13d07cf2c3f22a1488fbd9474080a0b518a6e75e 100644 (file)
@@ -1,5 +1,7 @@
 CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8)
-INCLUDE(${TEST_DIR}/cmake/setup_testsuite.cmake)
+INCLUDE(${DEAL_II_SOURCE_DIR}/cmake/setup_testsuite.cmake)
 PROJECT(testsuite CXX)
 INCLUDE(${DEAL_II_TARGET_CONFIG})
-DEAL_II_PICKUP_TESTS()
+IF(DEAL_II_WITH_LAPACK)
+  DEAL_II_PICKUP_TESTS()
+ENDIF()
index a51b880d4ffad7c62903fd19506a097d25728cbe..e39c51b85d2fa39981f342cb7b34ad9e3e6e2830 100644 (file)
@@ -1,5 +1,5 @@
 CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8)
-INCLUDE(${TEST_DIR}/cmake/setup_testsuite.cmake)
+INCLUDE(${DEAL_II_SOURCE_DIR}/cmake/setup_testsuite.cmake)
 PROJECT(testsuite CXX)
 INCLUDE(${DEAL_II_TARGET_CONFIG})
 DEAL_II_PICKUP_TESTS()
index a51b880d4ffad7c62903fd19506a097d25728cbe..3219ef35aa26b63255fc1ad0c9b320ea43e1c312 100644 (file)
@@ -1,5 +1,7 @@
 CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8)
-INCLUDE(${TEST_DIR}/cmake/setup_testsuite.cmake)
+INCLUDE(${DEAL_II_SOURCE_DIR}/cmake/setup_testsuite.cmake)
 PROJECT(testsuite CXX)
 INCLUDE(${DEAL_II_TARGET_CONFIG})
-DEAL_II_PICKUP_TESTS()
+IF(DEAL_II_WITH_METIS)
+  DEAL_II_PICKUP_TESTS()
+ENDIF()
index a51b880d4ffad7c62903fd19506a097d25728cbe..ef84a0b38692feb3d496ef5e4626a2f25f8519e7 100644 (file)
@@ -1,5 +1,7 @@
 CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8)
-INCLUDE(${TEST_DIR}/cmake/setup_testsuite.cmake)
+INCLUDE(${DEAL_II_SOURCE_DIR}/cmake/setup_testsuite.cmake)
 PROJECT(testsuite CXX)
 INCLUDE(${DEAL_II_TARGET_CONFIG})
-DEAL_II_PICKUP_TESTS()
+IF(DEAL_II_WITH_MPI AND DEAL_II_WITH_P4EST)
+  DEAL_II_PICKUP_TESTS()
+ENDIF()
index a51b880d4ffad7c62903fd19506a097d25728cbe..e39c51b85d2fa39981f342cb7b34ad9e3e6e2830 100644 (file)
@@ -1,5 +1,5 @@
 CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8)
-INCLUDE(${TEST_DIR}/cmake/setup_testsuite.cmake)
+INCLUDE(${DEAL_II_SOURCE_DIR}/cmake/setup_testsuite.cmake)
 PROJECT(testsuite CXX)
 INCLUDE(${DEAL_II_TARGET_CONFIG})
 DEAL_II_PICKUP_TESTS()
index a51b880d4ffad7c62903fd19506a097d25728cbe..5afa661fa1aebe266dbb35074ae235e6bb7bb4aa 100644 (file)
@@ -1,5 +1,7 @@
 CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8)
-INCLUDE(${TEST_DIR}/cmake/setup_testsuite.cmake)
+INCLUDE(${DEAL_II_SOURCE_DIR}/cmake/setup_testsuite.cmake)
 PROJECT(testsuite CXX)
 INCLUDE(${DEAL_II_TARGET_CONFIG})
-DEAL_II_PICKUP_TESTS()
+IF(DEAL_II_WITH_PETSC)
+  DEAL_II_PICKUP_TESTS()
+ENDIF()
diff --git a/tests/run_buildtests.cmake b/tests/run_buildtests.cmake
new file mode 100644 (file)
index 0000000..98014f1
--- /dev/null
@@ -0,0 +1,2 @@
+SET(TRACK "Build Tests")
+INCLUDE(${CMAKE_CURRENT_LIST_DIR}/run_testsuite.cmake)
index c44af61218e266e68ab87086381768a529a85ecc..51f970e900865f1ff8bf914deb8a98131aa9dcc0 100644 (file)
 ##
 ## ---------------------------------------------------------------------
 
-
-########################################################################
-#                                                                      #
-#                             Test setup:                              #
-#                                                                      #
-########################################################################
-
-#
-# 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 overwritten with
-#
-#   ctest -D<variable>=<value> [...]
-#
-#
-#   CTEST_SOURCE_DIRECTORY
-#     - The source directory of deal.II (usually ending in "[...]/deal.II"
-#       (equivalent to https://svn.dealii.org/trunk/deal.II)
-#       Note: This is _not_ the test directory ending in "[...]/tests"
-#     - If unspecified, "../deal.II" relative to the location of this
-#       script is used. If this is not a source directory, an error is
-#       thrown.
-#
-#   CTEST_BINARY_DIRECTORY
-#     - The designated build directory (already configured, empty, or non
-#       existent - see the information about TRACKs what will happen)
-#     - If unspecified the current directory is used. If the current
-#       directory is equal to CTEST_SOURCE_DIRECTORY or the "tests"
-#       directory, an error is thrown.
 #
-#   CTEST_CMAKE_GENERATOR
-#     - The CMake Generator to use (e.g. "Unix Makefiles", or "Ninja", see
-#       $ man cmake)
-#     - If unspecified the generator of a configured build directory will
-#       be used, otherwise "Unix Makefiles".
-#
-#   TRACK
-#     - 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)
-#       that will be used during the configuration stage (invokes
-#       # cmake -C ${CONFIG_FILE}). This only has an effect if
-#       CTEST_BINARY_DIRECTORY is empty.
-#
-# Furthermore, the following variables controlling the testsuite can be set
-# and will be automatically handed down to cmake:
-#
-#   TEST_DIFF
-#   TEST_TIME_LIMIT
-#   TEST_PICKUP_REGEX
-#   NUMDIFF_DIR
-#
-# For details, consult the ./README file.
-#
-
-
-CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8)
-MESSAGE("-- This is CTest ${CTEST_VERSION}")
-
-#
-# TRACK: Default to Experimental:
-#
-
-IF("${TRACK}" STREQUAL "")
-  SET(TRACK "Experimental")
-ENDIF()
-
-IF( NOT "${TRACK}" STREQUAL "Experimental"
-    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}")
-
-#
-# CTEST_SOURCE_DIRECTORY:
+# Try to find the source directory and invoke
+# ./cmake/scripts/run_testsuite.cmake from this location:
 #
 
 IF("${CTEST_SOURCE_DIRECTORY}" STREQUAL "")
-  #
   # If CTEST_SOURCE_DIRECTORY is not set we just assume that this script
   # was called residing under ../tests relative to the source directory.
-  #
   GET_FILENAME_COMPONENT(_path "${CMAKE_CURRENT_LIST_DIR}" PATH)
   SET(CTEST_SOURCE_DIRECTORY ${_path}/deal.II)
-
-  IF(NOT EXISTS ${CTEST_SOURCE_DIRECTORY}/CMakeLists.txt)
-    MESSAGE(FATAL_ERROR "
-Could not find a suitable source directory. Either the run_testsuite.cmake
-script was called residing outside of \"tests\", or there is no source
-directory \"../deal.II\" relative to the tests directory.
-Please, set CTEST_SOURCE_DIRECTORY manually to the appropriate source
-directory.
-"
-      )
-  ENDIF()
-ENDIF()
-
-MESSAGE("-- CTEST_SOURCE_DIRECTORY: ${CTEST_SOURCE_DIRECTORY}")
-
-#
-# Read in custom config files:
-#
-
-CTEST_READ_CUSTOM_FILES(${CTEST_SOURCE_DIRECTORY})
-
-#
-# CTEST_BINARY_DIRECTORY:
-#
-
-IF("${CTEST_BINARY_DIRECTORY}" STREQUAL "")
-  #
-  # If CTEST_BINARY_DIRECTORY is not set we just use the current directory
-  # except if it is equal to CTEST_SOURCE_DIRECTORY in which case we fail.
-  #
-  SET(CTEST_BINARY_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
-
-  IF( "${CTEST_BINARY_DIRECTORY}" STREQUAL "${CTEST_SOURCE_DIR}"
-      OR "${CTEST_BINARY_DIRECTORY}" STREQUAL "${CMAKE_CURRENT_LIST_DIR}" )
-    MESSAGE(FATAL_ERROR "
-ctest was invoked in the source directory (or test 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()
-
-#
-# Read in custom config files:
-#
-
-CTEST_READ_CUSTOM_FILES(${CTEST_BINARY_DIRECTORY})
-
-# Make sure that for a build test the directory is empty:
-FILE(GLOB _test ${CTEST_BINARY_DIRECTORY}/*)
-IF( "${TRACK}" STREQUAL "Build Tests"
-    AND NOT "${_test}" STREQUAL "" )
-      MESSAGE(FATAL_ERROR "
-TRACK was set to \"Build Tests\" which require an empty build directory.
-But files were found in \"${CTEST_BINARY_DIRECTORY}\"
-"
-        )
-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()
-    # default to "Unix Makefiles"
-    SET(CTEST_CMAKE_GENERATOR "Unix Makefiles")
-  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()
-
-#
-# CTEST_SITE:
-#
-
-FIND_PROGRAM(HOSTNAME_COMMAND NAMES hostname)
-EXEC_PROGRAM(${HOSTNAME_COMMAND} OUTPUT_VARIABLE _hostname)
-SET(CTEST_SITE "${_hostname}")
-
-MESSAGE("-- CTEST_SITE:             ${CTEST_SITE}")
-
-IF( "${TRACK}" STREQUAL "Regression Tests"
-    AND NOT CTEST_SITE MATCHES "c0541" )
-  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:
-#
-
-IF(NOT "${CONFIG_FILE}" STREQUAL "")
-  SET(_options "-C${CONFIG_FILE}")
-ENDIF()
-
-IF("${TRACK}" STREQUAL "Build Tests")
-  SET(TEST_PICKUP_REGEX "^build_tests")
-ENDIF()
-
-# Pass all relevant "TEST_" variables down to configure:
-GET_CMAKE_PROPERTY(_variables VARIABLES)
-FOREACH(_var ${_variables})
-  IF(_var MATCHES
-      "^(TEST_DIFF|TEST_TIME_LIMIT|TEST_PICKUP_REGEX|NUMDIFF_DIR)$"
-      )
-    LIST(APPEND _options "-D${_var}=${${_var}}")
-  ENDIF()
-ENDFOREACH()
-
-#
-# CTEST_BUILD_NAME:
-#
-
-# Append compiler information to CTEST_BUILD_NAME:
-IF(NOT EXISTS ${CTEST_BINARY_DIRECTORY}/detailed.log)
-  # Apparently, ${CTEST_BINARY_DIRECTORY} is not a configured build
-  # directory. In this case we need a trick: set up a dummy project and
-  # query it for the compiler information.
-  FILE(WRITE ${CTEST_BINARY_DIRECTORY}/query_for_compiler/CMakeLists.txt "
-FILE(WRITE ${CTEST_BINARY_DIRECTORY}/detailed.log
-  \"#        CMAKE_CXX_COMPILER:     \${CMAKE_CXX_COMPILER_ID} \${CMAKE_CXX_COMPILER_VERSION} on platform \${CMAKE_SYSTEM_NAME} \${CMAKE_SYSTEM_PROCESSOR}\"
-  )"
-    )
-  EXECUTE_PROCESS(
-    COMMAND ${CMAKE_COMMAND} ${_options} "-G${CTEST_CMAKE_GENERATOR}" .
-    OUTPUT_QUIET ERROR_QUIET
-    WORKING_DIRECTORY ${CTEST_BINARY_DIRECTORY}/query_for_compiler
-    )
-  FILE(REMOVE_RECURSE ${CTEST_BINARY_DIRECTORY}/query_for_compiler)
-ENDIF()
-
-IF(EXISTS ${CTEST_BINARY_DIRECTORY}/detailed.log)
-  FILE(STRINGS ${CTEST_BINARY_DIRECTORY}/detailed.log _compiler_id
-    REGEX "CMAKE_CXX_COMPILER:"
-    )
-  STRING(REGEX REPLACE
-    "^.*CMAKE_CXX_COMPILER:     \(.*\) on platform.*$" "\\1"
-    _compiler_id ${_compiler_id}
-    )
-  STRING(REGEX REPLACE "^\(.*\) .*$" "\\1" _compiler_name ${_compiler_id})
-  STRING(REGEX REPLACE "^.* " "" _compiler_version ${_compiler_id})
-  STRING(REGEX REPLACE " " "-" _compiler_id ${_compiler_id})
-  IF( NOT "${_compiler_id}" STREQUAL "" OR
-      _compiler_id MATCHES "CMAKE_CXX_COMPILER" )
-    SET(CTEST_BUILD_NAME "${_compiler_id}")
-  ENDIF()
 ENDIF()
 
-#
-# Append subversion branch to CTEST_BUILD_NAME:
-#
-FIND_PACKAGE(Subversion QUIET)
-EXECUTE_PROCESS(
-  COMMAND ${Subversion_SVN_EXECUTABLE} info ${CTEST_SOURCE_DIRECTORY}
-  OUTPUT_QUIET ERROR_QUIET
-  RESULT_VARIABLE _result
-  )
-IF(${_result} EQUAL 0)
-  Subversion_WC_INFO(${CTEST_SOURCE_DIRECTORY} _svn)
-  STRING(REGEX REPLACE "^${_svn_WC_ROOT}/" "" _branch ${_svn_WC_URL})
-  STRING(REGEX REPLACE "^branches/" "" _branch ${_branch})
-  STRING(REGEX REPLACE "/deal.II$" "" _branch ${_branch})
-  SET(CTEST_BUILD_NAME "${CTEST_BUILD_NAME}-${_branch}")
-ENDIF()
-
-#
-# Append config file name to CTEST_BUILD_NAME:
-#
-
-IF(NOT "${CONFIG_FILE}" STREQUAL "")
-  GET_FILENAME_COMPONENT(_conf ${CONFIG_FILE} NAME_WE)
-  STRING(REGEX REPLACE "#.*$" "" _conf ${_conf})
-  SET(CTEST_BUILD_NAME "${CTEST_BUILD_NAME}-${_conf}")
-ENDIF()
-
-MESSAGE("-- CTEST_BUILD_NAME:       ${CTEST_BUILD_NAME}")
-
-#
-# We require valid svn information for build tests:
-#
-
-IF( "${TRACK}" STREQUAL "Build Tests"
-    AND NOT DEFINED _svn_WC_REVISION )
+IF(NOT EXISTS ${CTEST_SOURCE_DIRECTORY}/cmake/scripts/run_testsuite.cmake)
   MESSAGE(FATAL_ERROR "
-TRACK was set to \"Build Tests\" which requires the source directory to be
-under Subversion version control.
+Could not find a suitable source directory.
+There is no source directory \"../deal.II\" relative to the location of this script.
+Please, set CTEST_SOURCE_DIRECTORY manually to the appropriate source directory.
 "
     )
 ENDIF()
 
-#
-# Write revision log:
-#
-
-IF(DEFINED _svn_WC_REVISION)
-  FILE(WRITE ${CTEST_BINARY_DIRECTORY}/revision.log
-"###
-#
-#  SVN information:
-#        SVN_WC_URL:               ${_svn_WC_URL}
-#        SVN_WC_REVISION:          ${_svn_WC_REVISION}
-#        SVN_WC_LAST_CHANGED_DATE: ${_svn_WC_LAST_CHANGED_DATE}
-#
-###"
-    )
-ELSE()
-  FILE(WRITE ${CTEST_BINARY_DIRECTORY}/revision.log
-"###
-#
-#  No SVN information available.
-#
-###"
-    )
-ENDIF()
-
-#
-# Declare files that should be submitted as notes:
-#
-
-SET(CTEST_NOTES_FILES
-  ${CTEST_BINARY_DIRECTORY}/revision.log
-  ${CTEST_BINARY_DIRECTORY}/summary.log
-  ${CTEST_BINARY_DIRECTORY}/detailed.log
-  ${CTEST_BINARY_DIRECTORY}/include/deal.II/base/config.h
-  )
-
-
-########################################################################
-#                                                                      #
-#                          Run the testsuite:                          #
-#                                                                      #
-########################################################################
-
-IF(NOT "${_branch}" STREQUAL "")
-  SET_PROPERTY(GLOBAL PROPERTY SubProject ${_branch})
-ENDIF()
-
-CTEST_START(Experimental TRACK ${TRACK})
-
-CTEST_CONFIGURE(OPTIONS "${_options}" RETURN_VALUE _res)
-
-IF("${_res}" STREQUAL "0")
-  # Only run the build stage if configure was successful:
-
-  CTEST_BUILD(TARGET NUMBER_ERRORS _res)
-
-  IF("${_res}" STREQUAL "0")
-    # Only run tests if the build was successful:
-
-    EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND}
-      --build ${CTEST_BINARY_DIRECTORY} --target setup_test
-      OUTPUT_QUIET RESULT_VARIABLE _res
-      )
-    IF(NOT "${_res}" STREQUAL "0")
-      MESSAGE(FATAL_ERROR "
-\"setup_test\" target exited with an error. Bailing out.
-"
-        )
-    ENDIF()
-
-    CTEST_TEST()
-  ENDIF()
-ENDIF()
-
-#
-# Inject compiler information and svn revision into xml files:
-#
-
-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.
-"
-    )
-ENDIF()
-FILE(GLOB _xml_files ${_path}/*.xml)
-EXECUTE_PROCESS(COMMAND sed -i -e
-  s/CompilerName=\"\"/CompilerName=\"${_compiler_name}\"\\n\\tCompilerVersion=\"${_compiler_version}\"/g
-  ${_xml_files}
-  OUTPUT_QUIET RESULT_VARIABLE  _res
-  )
-IF(NOT "${_res}" STREQUAL "0")
-  MESSAGE(FATAL_ERROR "
-\"sed\" failed. Bailing out.
-"
-    )
-ENDIF()
-
-IF(NOT "${_svn_WC_REVISION}" STREQUAL "")
-  FILE(WRITE ${_path}/Update.xml
-"<?xml version=\"1.0\" encoding=\"UTF-8\"?>
-<Update mode=\"Client\" Generator=\"ctest-${CTEST_VERSION}\">
-    <Site>${CTEST_SITE}</Site>
-      <BuildName>${CTEST_BUILD_NAME}</BuildName>
-        <BuildStamp>${_tag}-${TRACK}</BuildStamp>
-       <UpdateType>SVN</UpdateType>
-       <Revision>${_svn_WC_REVISION}</Revision>
-        <Path>${_branch}</Path>
-</Update>"
-    )
-ENDIF()
-
-#
-# And finally submit:
-#
-
-CTEST_SUBMIT()
-
-# .oO( This script is freaky 456 lines long... )
+MESSAGE("-- Redirect to: ${CTEST_SOURCE_DIRECTORY}/cmake/scripts/run_testsuite.cmake")
+INCLUDE(${CTEST_SOURCE_DIRECTORY}/cmake/scripts/run_testsuite.cmake)
index a51b880d4ffad7c62903fd19506a097d25728cbe..e39c51b85d2fa39981f342cb7b34ad9e3e6e2830 100644 (file)
@@ -1,5 +1,5 @@
 CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8)
-INCLUDE(${TEST_DIR}/cmake/setup_testsuite.cmake)
+INCLUDE(${DEAL_II_SOURCE_DIR}/cmake/setup_testsuite.cmake)
 PROJECT(testsuite CXX)
 INCLUDE(${DEAL_II_TARGET_CONFIG})
 DEAL_II_PICKUP_TESTS()
index a51b880d4ffad7c62903fd19506a097d25728cbe..d0e042634bf07adcacd0fbb489ce9bc4e3da168d 100644 (file)
@@ -1,5 +1,7 @@
 CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8)
-INCLUDE(${TEST_DIR}/cmake/setup_testsuite.cmake)
+INCLUDE(${DEAL_II_SOURCE_DIR}/cmake/setup_testsuite.cmake)
 PROJECT(testsuite CXX)
 INCLUDE(${DEAL_II_TARGET_CONFIG})
-DEAL_II_PICKUP_TESTS()
+IF(DEAL_II_WITH_SLEPC)
+  DEAL_II_PICKUP_TESTS()
+ENDIF()
index a51b880d4ffad7c62903fd19506a097d25728cbe..862d6a1f5ed228c7e94ee15ec8be77ec56376149 100644 (file)
@@ -1,5 +1,7 @@
 CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8)
-INCLUDE(${TEST_DIR}/cmake/setup_testsuite.cmake)
+INCLUDE(${DEAL_II_SOURCE_DIR}/cmake/setup_testsuite.cmake)
 PROJECT(testsuite CXX)
 INCLUDE(${DEAL_II_TARGET_CONFIG})
-DEAL_II_PICKUP_TESTS()
+IF(DEAL_II_WITH_TRILINOS)
+  DEAL_II_PICKUP_TESTS()
+ENDIF()
index a51b880d4ffad7c62903fd19506a097d25728cbe..70aca765fff7bb7027030deebbd636e7723d659a 100644 (file)
@@ -1,5 +1,7 @@
 CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8)
-INCLUDE(${TEST_DIR}/cmake/setup_testsuite.cmake)
+INCLUDE(${DEAL_II_SOURCE_DIR}/cmake/setup_testsuite.cmake)
 PROJECT(testsuite CXX)
 INCLUDE(${DEAL_II_TARGET_CONFIG})
-DEAL_II_PICKUP_TESTS()
+IF(DEAL_II_WITH_UMFPACK)
+  DEAL_II_PICKUP_TESTS()
+ENDIF()

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.