]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Testsuite: Some more refactoring and cleanup
authormaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 20 Nov 2013 21:08:30 +0000 (21:08 +0000)
committermaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 20 Nov 2013 21:08:30 +0000 (21:08 +0000)
git-svn-id: https://svn.dealii.org/trunk@31739 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/cmake/scripts/run_testsuite.cmake
deal.II/cmake/setup_testsuite.cmake
deal.II/tests/CMakeLists.txt
tests/CMakeLists.txt

index f835123a1c074e1f6aa8868a559de722352e92e6..2a46b37a46f9aae426ff0df8a5b8d57d29624965 100644 (file)
@@ -624,4 +624,4 @@ IF("${_res}" STREQUAL "0")
   MESSAGE("-- Submission successful. Goodbye!")
 ENDIF()
 
-# .oO( This script is freaky 593 lines long... )
+# .oO( This script is freaky 627 lines long... )
index 23b0de2f461fb29a576086561ef9fee986221642..a210f611c18a29ed0eef76b7498b06ea4ccd680d 100644 (file)
@@ -56,6 +56,9 @@ FILE(WRITE ${CMAKE_BINARY_DIR}/tests/CTestTestfile.cmake "")
 # Setup tests:
 ADD_CUSTOM_TARGET(setup_tests)
 
+# Remove all tests:
+ADD_CUSTOM_TARGET(prune_tests)
+
 # Regenerate tests (run "make rebuild_cache" in subprojects):
 ADD_CUSTOM_TARGET(regen_tests
   COMMAND ${CMAKE_COMMAND}
@@ -70,24 +73,14 @@ ADD_CUSTOM_TARGET(clean_tests
     -- ${MAKEOPTS}
   )
 
-# Remove all tests:
-ADD_CUSTOM_TARGET(prune_tests
-  COMMAND ${CMAKE_COMMAND}
-    --build ${CMAKE_BINARY_DIR}/tests --target prune_tests
-    -- ${MAKEOPTS}
-  )
-
 MESSAGE(STATUS "Setup testsuite")
 
 #
-# Setup the testsuite project: It is merely a wrapper around the individual
-# regen_tests_*, clean_tests_* and prune_tests_* targets.
-# down to it:
+# Provide custom targets to setup and prune the testsuite subproject:
 #
 
 EXECUTE_PROCESS(
   COMMAND ${CMAKE_COMMAND} -G${CMAKE_GENERATOR}
-    -DDEAL_II_BINARY_DIR=${CMAKE_BINARY_DIR}
     -DTEST_DIR=${TEST_DIR}
     ${CMAKE_SOURCE_DIR}/tests
   WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/tests
@@ -98,11 +91,7 @@ SET(_options)
 LIST(APPEND _options -DDEAL_II_SOURCE_DIR=${CMAKE_SOURCE_DIR})
 LIST(APPEND _options -DDEAL_II_BINARY_DIR=${CMAKE_BINARY_DIR})
 FOREACH(_var
-    DIFF_DIR
-    NUMDIFF_DIR
-    TEST_DIFF
-    TEST_OVERRIDE_LOCATION
-    TEST_PICKUP_REGEX
+    DIFF_DIR NUMDIFF_DIR TEST_DIFF TEST_OVERRIDE_LOCATION TEST_PICKUP_REGEX
     TEST_TIME_LIMIT
     )
   # always undefine:
@@ -145,6 +134,12 @@ FOREACH(_category ${_categories})
       )
     ADD_DEPENDENCIES(setup_tests setup_tests_${_category})
 
+    ADD_CUSTOM_TARGET(prune_tests_${_category}
+      COMMAND ${CMAKE_COMMAND} -E remove_directory
+        ${CMAKE_BINARY_DIR}/tests/${_category}
+      )
+    ADD_DEPENDENCIES(prune_tests prune_tests_${_category})
+
     FILE(APPEND ${CMAKE_BINARY_DIR}/tests/CTestTestfile.cmake
       "SUBDIRS(${_category})\n"
       )
index 14d41b5410209c8844a84e08b7ba7913a1dcf742..44787e72f4ea7b718f049ededa58bebda3d8a5e2 100644 (file)
 ##
 ## ---------------------------------------------------------------------
 
-IF(NOT DEFINED DEAL_II_BINARY_DIR)
+#
+# This is a small project that provides some custom targets that need a
+# working, independent subproject because they are called back during
+# configure phase.
+#
+
+IF(NOT DEFINED TEST_DIR)
   MESSAGE(FATAL_ERROR "\n
   The testsuite cannot be set up as an independent project.
   Please configure \"deal.II\" directly instead.\n\n"
@@ -24,39 +30,16 @@ ENDIF()
 CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8)
 PROJECT(testsuite NONE)
 
-#
-# This is a small project that provides some custom targets that need a
-# working, independent subproject because they are called back during
-# configure phase.
-#
-
-# Setup tests:
-ADD_CUSTOM_TARGET(setup_tests
-  COMMAND ${CMAKE_COMMAND}
-    --build ${DEAL_II_BINARY_DIR} --target setup_tests
-  )
-
 # Regenerate tests (run "make rebuild_cache" in subprojects):
 ADD_CUSTOM_TARGET(regen_tests)
 
 # Clean all tests
 ADD_CUSTOM_TARGET(clean_tests)
 
-# Remove all tests:
-ADD_CUSTOM_TARGET(prune_tests)
-
-#
-# Glob together a list of all subfolders to set up:
-#
-
 FILE(GLOB _categories RELATIVE ${TEST_DIR} ${TEST_DIR}/*)
 SET(_categories all-headers build_tests mesh_converter ${_categories})
 LIST(REMOVE_DUPLICATES _categories)
 
-#
-# Define a subproject for every enabled category:
-#
-
 FOREACH(_category ${_categories})
   IF( EXISTS ${CMAKE_SOURCE_DIR}/${_category}/CMakeLists.txt OR
       EXISTS ${TEST_DIR}/${_category}/CMakeLists.txt )
@@ -73,11 +56,5 @@ FOREACH(_category ${_categories})
       )
     ADD_DEPENDENCIES(clean_tests clean_tests_${_category})
 
-    ADD_CUSTOM_TARGET(prune_tests_${_category}
-      COMMAND ${CMAKE_COMMAND} -E remove_directory
-        ${CMAKE_BINARY_DIR}/${_category}
-      )
-    ADD_DEPENDENCIES(prune_tests prune_tests_${_category})
-
   ENDIF()
 ENDFOREACH()
index b1ad22bf6397a4180872fe7557e9e2e428fd2504..164fdebe42bdb57ca85240df1e5a413fe07ff28c 100644 (file)
@@ -1,5 +1,5 @@
 CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8)
-PROJECT(TESTSUITE NONE)
+PROJECT(testsuite NONE)
 
 MESSAGE(FATAL_ERROR "\n
 The testsuite cannot be set up as an independent project.

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.