From 7edad46434c7f38b943e25b75717cd9723453000 Mon Sep 17 00:00:00 2001 From: maier Date: Wed, 20 Nov 2013 21:08:30 +0000 Subject: [PATCH] Testsuite: Some more refactoring and cleanup git-svn-id: https://svn.dealii.org/trunk@31739 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/cmake/scripts/run_testsuite.cmake | 2 +- deal.II/cmake/setup_testsuite.cmake | 27 +++++++---------- deal.II/tests/CMakeLists.txt | 37 +++++------------------ tests/CMakeLists.txt | 2 +- 4 files changed, 20 insertions(+), 48 deletions(-) diff --git a/deal.II/cmake/scripts/run_testsuite.cmake b/deal.II/cmake/scripts/run_testsuite.cmake index f835123a1c..2a46b37a46 100644 --- a/deal.II/cmake/scripts/run_testsuite.cmake +++ b/deal.II/cmake/scripts/run_testsuite.cmake @@ -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... ) diff --git a/deal.II/cmake/setup_testsuite.cmake b/deal.II/cmake/setup_testsuite.cmake index 23b0de2f46..a210f611c1 100644 --- a/deal.II/cmake/setup_testsuite.cmake +++ b/deal.II/cmake/setup_testsuite.cmake @@ -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" ) diff --git a/deal.II/tests/CMakeLists.txt b/deal.II/tests/CMakeLists.txt index 14d41b5410..44787e72f4 100644 --- a/deal.II/tests/CMakeLists.txt +++ b/deal.II/tests/CMakeLists.txt @@ -14,7 +14,13 @@ ## ## --------------------------------------------------------------------- -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() diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index b1ad22bf63..164fdebe42 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -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. -- 2.39.5