]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Finish testsuite sub project
authormaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 17 Sep 2013 09:49:51 +0000 (09:49 +0000)
committermaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 17 Sep 2013 09:49:51 +0000 (09:49 +0000)
git-svn-id: https://svn.dealii.org/branches/branch_port_the_testsuite@30758 0785d39b-7218-0410-832d-ea1e28bc413d

tests/CMakeLists.txt
tests/all-headers/CMakeLists.txt
tests/build_tests/CMakeLists.txt
tests/cmake/setup_testsuite.cmake

index b98d8db63378f3e8c40fbb175402f156253ca92d..2ed082c8be93ad93c57721f406b4af651b276a93 100644 (file)
 # of complexity :-(
 #
 
+CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8)
 MESSAGE(STATUS "Proceed to test definitions now.")
+PROJECT(deal.II-testsuite)
 ENABLE_TESTING()
 
+SET(_options)
+IF("${CMAKE_PROJECT_NAME}" STREQUAL "deal.II")
+  #
+  # Setup for the case that this folder is included as a subfolder in a
+  # deal.II project:
+  #
+
+  # Write a minimalistic CTestTestfile.cmake file to CMAKE_BINARY_DIR:
+  FILE(WRITE ${CMAKE_BINARY_DIR}/CTestTestfile.cmake
+    "SUBDIRS(tests)"
+    )
+
+  LIST(APPEND _options -DDEAL_II_SOURCE_DIR=${CMAKE_SOURCE_DIR})
+  LIST(APPEND _options -DDEAL_II_BINARY_DIR=${CMAKE_BINARY_DIR})
+
+ELSE()
+
+  #
+  # Set up a top level test suite project:
+  #
+
+  SET(TEST_DIR ${CMAKE_CURRENT_SOURCE_DIR})
+ENDIF()
+
 #
-# Write a minimalistic CTestTestfile.cmake file to CMAKE_BINARY_DIR:
+# Pass all relevant "TEST_" variables down to the subprojects:
 #
-FILE(WRITE ${CMAKE_BINARY_DIR}/CTestTestfile.cmake
-  "SUBDIRS(tests)"
-  )
+GET_CMAKE_PROPERTY(_variables VARIABLES)
+FOREACH(_var ${_variables})
+  IF(_var MATCHES
+      "^(TEST_DIR|TEST_DIFF|TEST_TIME_LIMIT|TEST_PICKUP_REGEX|NUMDIFF_DIR)$"
+      )
+    LIST(APPEND _options -D${_var}="${${_var}}")
+  ENDIF()
+ENDFOREACH()
 
 #
 # Two custom targets to setup and cleanup the testsuite:
@@ -72,20 +103,6 @@ IF(DEAL_II_WITH_UMFPACK)
   LIST(APPEND _categories umfpack)
 ENDIF()
 
-#
-# Pass all relevant "TEST_" variables down to the subprojects:
-#
-
-GET_CMAKE_PROPERTY(_variables VARIABLES)
-SET(_options)
-FOREACH(_var ${_variables})
-  IF(_var MATCHES
-      "^(TEST_DIR|TEST_DIFF|TEST_TIME_LIMIT|TEST_PICKUP_REGEX|NUMDIFF_DIR)$"
-      )
-    LIST(APPEND _options -D${_var}="${${_var}}")
-  ENDIF()
-ENDFOREACH()
-
 #
 # The hook into CTest so that the tests from the suprojects get picked up
 # by the main project:
@@ -106,8 +123,6 @@ FOREACH(_category ${_categories})
       ${CMAKE_CURRENT_BINARY_DIR}/${_category}
     COMMAND cd ${CMAKE_CURRENT_BINARY_DIR}/${_category} &&
       ${CMAKE_COMMAND} -G${CMAKE_GENERATOR}
-      -DDEAL_II_BINARY_DIR=${CMAKE_BINARY_DIR}
-      -DDEAL_II_SOURCE_DIR=${CMAKE_SOURCE_DIR}
       ${_options}
       ${CMAKE_CURRENT_SOURCE_DIR}/${_category}
       > /dev/null # Shoo!
index ce2e06f898fb58aec81d3ccae9412d233e4d5b07..d3c7db8d884185a665980c13cbd985a2819093d6 100644 (file)
@@ -28,7 +28,22 @@ INCLUDE(${TEST_DIR}/cmake/setup_testsuite.cmake)
 SET(_category all-headers)
 
 SET(_count "0")
-FILE(GLOB_RECURSE _header ${DEAL_II_SOURCE_DIR}/include/*.h)
+
+IF(NOT"${DEAL_II_SOURCE_DIR}" STREQUAL "")
+  # The testsuite was configured as part of a deal.II project, so pick up
+  # the headers from the corresponding source directory:
+  FILE(GLOB_RECURSE _header ${DEAL_II_SOURCE_DIR}/include/deal.II/*.h)
+ELSE()
+  # The testsuite was configured as an independent project, so pick up
+  # headers from an external deal.II build directory, or installation:
+  IF(DEAL_II_BUILD_DIR)
+    LIST(GET DEAL_II_INCLUDE_DIRS 2 _header_dir)
+  ELSE()
+    LIST(GET DEAL_II_INCLUDE_DIRS 0 _header_dir)
+  ENDIF()
+  FILE(GLOB_RECURSE _header ${_header_dir}/deal.II/*.h)
+  MESSAGE(FATAL_ERROR ${_header_dir})
+ENDIF()
 
 FOREACH(_full_file ${_header})
   GET_FILENAME_COMPONENT(_file ${_full_file} NAME)
index 8be854afe6c0ad17e0fcf15779c14e2469929833..4be07058422e4e559dee23e101b47a416691fe49 100644 (file)
@@ -46,8 +46,18 @@ SET(_release_steps
   step-47 step-48 step-49
   )
 
+IF(NOT"${DEAL_II_SOURCE_DIR}" STREQUAL "")
+  # The testsuite was configured as part of a deal.II project, so pick up
+  # the steps rom the corresponding source directory:
+  FILE(GLOB _steps ${DEAL_II_SOURCE_DIR}/examples/step-*)
+ELSE()
+  # The testsuite was configured as an independent project, so pick up
+  # headers from an external deal.II build directory, or installation:
+  FILE(GLOB _steps ${DEAL_II_PATH}/${DEAL_II_EXAMPLES_RELDIR}/step-*)
+  # TODO: What do in case of a build dir?
+ENDIF()
+
 SET(_count "0")
-FILE(GLOB _steps ${DEAL_II_SOURCE_DIR}/examples/step-*)
 FOREACH(_step_full ${_steps})
   GET_FILENAME_COMPONENT(_step ${_step_full} NAME)
 
index 88a7a2e5dcb5299f4a2a0588dbb4efab15e4745c..afb68b6feed4e21c0d685ad357a7031645c98437 100644 (file)
@@ -52,18 +52,11 @@ SET_IF_EMPTY(TEST_DIFF $ENV{TEST_DIFF})
 SET_IF_EMPTY(TEST_TIME_LIMIT $ENV{TEST_TIME_LIMIT})
 SET_IF_EMPTY(TEST_PICKUP_REGEX $ENV{TEST_PICKUP_REGEX})
 
-IF("${DEAL_II_BINARY_DIR}" STREQUAL "")
-  MESSAGE(FATAL_ERROR "DEAL_II_BINARY_DIR must be set for this test subproject to configure correctly")
-ENDIF()
-IF("${DEAL_II_SOURCE_DIR}" STREQUAL "")
-  MESSAGE(FATAL_ERROR "DEAL_II_SOURCE_DIR must be set for this test subproject to configure correctly")
-ENDIF()
-
 #
 # We need deal.II and Perl as external packages:
 #
 
-FIND_PACKAGE(deal.II 8.1 REQUIRED
+FIND_PACKAGE(deal.II 8.0 REQUIRED
   HINTS ${DEAL_II_BINARY_DIR} ${DEAL_II_DIR}
   )
 INCLUDE(${DEAL_II_TARGET_CONFIG})

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.