From d2aa5224508061a848f31947de096311fea701b8 Mon Sep 17 00:00:00 2001 From: Matthias Maier Date: Wed, 21 Aug 2013 18:41:40 +0000 Subject: [PATCH] Intermediate git-svn-id: https://svn.dealii.org/branches/branch_port_the_testsuite@30378 0785d39b-7218-0410-832d-ea1e28bc413d --- .../cmake/macros/macro_deal_ii_add_test.cmake | 11 ++++- .../macros/macro_deal_ii_pickup_tests.cmake | 44 +++++++++++++++++++ tests/CMakeLists.txt | 2 + tests/TODO | 7 +++ tests/aniso/CMakeLists.txt | 9 +--- tests/base/CMakeLists.txt | 9 +--- 6 files changed, 64 insertions(+), 18 deletions(-) create mode 100644 deal.II/cmake/macros/macro_deal_ii_pickup_tests.cmake diff --git a/deal.II/cmake/macros/macro_deal_ii_add_test.cmake b/deal.II/cmake/macros/macro_deal_ii_add_test.cmake index 5c923717ef..182472015f 100644 --- a/deal.II/cmake/macros/macro_deal_ii_add_test.cmake +++ b/deal.II/cmake/macros/macro_deal_ii_add_test.cmake @@ -91,14 +91,21 @@ MACRO(DEAL_II_ADD_TEST _category _test_name) ) + SET(_comparison ${CMAKE_CURRENT_SOURCE_DIR}/${_test_name}) + IF(EXISTS ${_comparison}.${_build_lowercase}.output) + SET(_comparison ${_comparison}.${_build_lowercase}.output) + ELSE() + SET(_comparison ${_comparison}.output) + ENDIF() + ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_test}/diff COMMAND ${DEAL_II_TEST_DIFF} ${CMAKE_CURRENT_BINARY_DIR}/${_test}/output - ${CMAKE_CURRENT_SOURCE_DIR}/${_test_name}.output + ${_comparison} | tee ${CMAKE_CURRENT_BINARY_DIR}/${_test}/diff DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${_test}/output - ${CMAKE_CURRENT_SOURCE_DIR}/${_test_name}.output + ${_comparison} ) ADD_CUSTOM_TARGET(${_test}.diff DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${_test}/diff diff --git a/deal.II/cmake/macros/macro_deal_ii_pickup_tests.cmake b/deal.II/cmake/macros/macro_deal_ii_pickup_tests.cmake new file mode 100644 index 0000000000..e3b907ee95 --- /dev/null +++ b/deal.II/cmake/macros/macro_deal_ii_pickup_tests.cmake @@ -0,0 +1,44 @@ +## --------------------------------------------------------------------- +## $Id$ +## +## Copyright (C) 2013 by the deal.II authors +## +## This file is part of the deal.II library. +## +## The deal.II library is free software; you can use it, redistribute +## it, and/or modify it under the terms of the GNU Lesser General +## Public License as published by the Free Software Foundation; either +## version 2.1 of the License, or (at your option) any later version. +## The full text of the license can be found in the file LICENSE at +## the top level of the deal.II distribution. +## +## --------------------------------------------------------------------- + +# +# A Macro to pick up all tests in a test subdirectory +# +# Usage: +# DEAL_II_PICKUP_TESTS() +# + +MACRO(DEAL_II_PICKUP_TESTS) + GET_FILENAME_COMPONENT(_category ${CMAKE_CURRENT_SOURCE_DIR} NAME) + + FILE(GLOB _tests "*.output") + + FOREACH(_test ${_tests}) + + GET_FILENAME_COMPONENT(_test ${_test} NAME_WE) + + IF(_test MATCHES debug) + SET(_configuration DEBUG) + ELSEIF(_test MATCHES release) + SET(_configuration RELEASE) + ELSE() + SET(_configuration) + ENDIF() + + STRING(REGEX REPLACE "\\..*" "." _test ${_test}) + DEAL_II_ADD_TEST(${_category} ${_test} ${_configuration}) + ENDFOREACH() +ENDMACRO() diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 244bc326b1..2b177334d4 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -66,3 +66,5 @@ MESSAGE(STATUS "Proceed to test definitions") ADD_SUBDIRECTORY(aniso) ADD_SUBDIRECTORY(base) +#ADD_SUBDIRECTORY(bits) +ADD_SUBDIRECTORY(codim_one) diff --git a/tests/TODO b/tests/TODO index 58f158b47f..ebac033b99 100644 --- a/tests/TODO +++ b/tests/TODO @@ -2,3 +2,10 @@ DoFTools::count_dofs_per_block FiniteElement:: blocks MGTools::compute_row_length_vector MGTools::count_dofs_per_block + + +Porting: + +all-headers +benchmark +the readme diff --git a/tests/aniso/CMakeLists.txt b/tests/aniso/CMakeLists.txt index b901b9ed18..0efb828f2c 100644 --- a/tests/aniso/CMakeLists.txt +++ b/tests/aniso/CMakeLists.txt @@ -1,8 +1 @@ -GET_FILENAME_COMPONENT(_category ${CMAKE_CURRENT_SOURCE_DIR} NAME) - -FILE(GLOB _tests "*.output") - -FOREACH(_test ${_tests}) - GET_FILENAME_COMPONENT(_test ${_test} NAME_WE) - DEAL_II_ADD_TEST(${_category} ${_test}) -ENDFOREACH() +DEAL_II_PICKUP_TESTS() diff --git a/tests/base/CMakeLists.txt b/tests/base/CMakeLists.txt index b901b9ed18..0efb828f2c 100644 --- a/tests/base/CMakeLists.txt +++ b/tests/base/CMakeLists.txt @@ -1,8 +1 @@ -GET_FILENAME_COMPONENT(_category ${CMAKE_CURRENT_SOURCE_DIR} NAME) - -FILE(GLOB _tests "*.output") - -FOREACH(_test ${_tests}) - GET_FILENAME_COMPONENT(_test ${_test} NAME_WE) - DEAL_II_ADD_TEST(${_category} ${_test}) -ENDFOREACH() +DEAL_II_PICKUP_TESTS() -- 2.39.5