From 2b55bcc4e4014a83307dca5dfde8288f9bfe74cb Mon Sep 17 00:00:00 2001 From: Matthias Maier Date: Sun, 2 Aug 2015 17:33:42 -0500 Subject: [PATCH] Testsuite: Remove seldomly used testsuite targets 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 | 44 +++++++++++++------------------------------- 1 file changed, 13 insertions(+), 31 deletions(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 737c1d010b..1d3804e6c7 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -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" ) -- 2.39.5