]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Testsuite: Remove seldomly used testsuite targets
authorMatthias Maier <tamiko@43-1.org>
Sun, 2 Aug 2015 22:33:42 +0000 (17:33 -0500)
committerMatthias Maier <tamiko@43-1.org>
Sun, 2 Aug 2015 22:33:42 +0000 (17:33 -0500)
This commit removes the seldomly used testsuite targets "clear_tests" and
"regen_rests".

Further, the remaining "setup_tests" and "prune_tests" are rewritten in
native CMake script

tests/CMakeLists.txt

index 737c1d010bb8f4220896acd448a30455b5e73b44..1d3804e6c712831f88af79a0e3d40edf8c18ad09 100644 (file)
@@ -18,8 +18,6 @@
 #
 # We define toplevel targets:
 #    setup_tests    - set up testsuite subprojects
-#    regen_tests    - rerun configure stage in every testsuite subproject
-#    clean_tests    - run the 'clean' target in every testsuite subproject
 #    prune_tests    - remove all testsuite subprojects
 #
 
@@ -63,7 +61,7 @@ ELSE()
 
   IF("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
     MESSAGE(FATAL_ERROR "The testsuite cannot be configured in-source. "
-      "Please create a separate build directory"
+      "Please create a separate build directory!"
       )
   ENDIF()
 
@@ -106,21 +104,20 @@ 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)
-
-# Regenerate tests (run "make clean" in subprojects):
-ADD_CUSTOM_TARGET(clean_tests)
-
 FOREACH(_category ${_categories})
   SET(_category_dir ${CMAKE_CURRENT_SOURCE_DIR}/${_category})
 
+  FILE(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${_category})
+
+  IF(DEAL_II_MSVC)
+    SET(_command ${CMAKE_COMMAND} -G${CMAKE_GENERATOR} ${_options} ${_category_dir})
+  ELSE()
+    SET(_command ${CMAKE_COMMAND} -G${CMAKE_GENERATOR} ${_options} ${_category_dir} > /dev/null)
+  ENDIF()
+
   ADD_CUSTOM_TARGET(setup_tests_${_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
+    COMMAND ${_command}
+    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${_category}
     COMMENT "Processing tests/${_category}"
     )
   ADD_DEPENDENCIES(setup_tests setup_tests_${_category})
@@ -128,27 +125,12 @@ FOREACH(_category ${_categories})
   ADD_CUSTOM_TARGET(prune_tests_${_category}
     COMMAND ${CMAKE_COMMAND} -E remove_directory
       ${CMAKE_CURRENT_BINARY_DIR}/${_category}
+    COMMAND ${CMAKE_COMMAND} -E make_directory
+      ${CMAKE_CURRENT_BINARY_DIR}/${_category}
     COMMENT "Processing tests/${_category}"
     )
   ADD_DEPENDENCIES(prune_tests prune_tests_${_category})
 
-  ADD_CUSTOM_TARGET(regen_tests_${_category}
-    COMMAND
-      test ! -d ${CMAKE_CURRENT_BINARY_DIR}/${_category} || ${CMAKE_COMMAND}
-      --build ${CMAKE_CURRENT_BINARY_DIR}/${_category} --target regenerate
-      > /dev/null
-    COMMENT "Processing tests/${_category}"
-    )
-  ADD_DEPENDENCIES(regen_tests regen_tests_${_category})
-
-  ADD_CUSTOM_TARGET(clean_tests_${_category}
-    COMMAND
-      test ! -d ${CMAKE_CURRENT_BINARY_DIR}/${_category} || ${CMAKE_COMMAND}
-      --build ${CMAKE_CURRENT_BINARY_DIR}/${_category} --target clean
-    COMMENT "Processing tests/${_category}"
-    )
-  ADD_DEPENDENCIES(clean_tests clean_tests_${_category})
-
   FILE(APPEND ${CMAKE_CURRENT_BINARY_DIR}/CTestTestfile.cmake
     "SUBDIRS(${_category})\n"
     )

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.