From 8cf9bc763bd8037c5caec0714ea14079da7a2c78 Mon Sep 17 00:00:00 2001 From: maier Date: Thu, 5 Sep 2013 16:23:07 +0000 Subject: [PATCH] Restructure a bit git-svn-id: https://svn.dealii.org/branches/branch_port_the_testsuite@30611 0785d39b-7218-0410-832d-ea1e28bc413d --- .../cmake/macros/macro_deal_ii_add_test.cmake | 45 ++++++++----------- .../macros/macro_deal_ii_pickup_tests.cmake | 7 ++- 2 files changed, 24 insertions(+), 28 deletions(-) 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 0e947df9c0..714eb27d65 100644 --- a/deal.II/cmake/macros/macro_deal_ii_add_test.cmake +++ b/deal.II/cmake/macros/macro_deal_ii_add_test.cmake @@ -17,17 +17,6 @@ # # A Macro to set up tests for thes testsuite # -# This macro assumes that a test -# -# ./tests/category/test_name.cc -# ./tests/category/test_name.*.output -# -# is available in the testsuite. -# -# [configurations] is a list of configurations against this test should be -# run. Possible values are an empty list, DEBUG, RELEASE or -# "DEBUG;RELEASE". -# # The following variables must be set: # # TEST_DIFF @@ -37,11 +26,25 @@ # - specifying the maximal wall clock time in seconds a test is allowed # to run # +# # Usage: -# DEAL_II_ADD_TEST(category test_name [configurations]) +# DEAL_II_ADD_TEST(category test_name comparison_file [configurations]) +# +# This macro assumes that a source file +# +# ./tests/category/.cc +# +# is available in the testsuite. +# +# [configurations] is a list of configurations against this test should be +# run. Possible values are an empty list, DEBUG, RELEASE or +# "DEBUG;RELEASE". +# +# The output of .cc is compared against the file +# . # -MACRO(DEAL_II_ADD_TEST _category _test_name) +MACRO(DEAL_II_ADD_TEST _category _test_name _comparison_file) FOREACH(_build ${DEAL_II_BUILD_TYPES}) @@ -80,18 +83,6 @@ MACRO(DEAL_II_ADD_TEST _category _test_name) ) - # - # Determine correct file for comparison: - # - - 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 a top level target to run and compare the test: # @@ -123,7 +114,7 @@ MACRO(DEAL_II_ADD_TEST _category _test_name) COMMAND ${TEST_DIFF} ${CMAKE_CURRENT_BINARY_DIR}/${_test}/output - ${_comparison} + ${_comparison_file} > ${CMAKE_CURRENT_BINARY_DIR}/${_test}/diff || (mv ${CMAKE_CURRENT_BINARY_DIR}/${_test}/diff ${CMAKE_CURRENT_BINARY_DIR}/${_test}/failing_diff @@ -136,7 +127,7 @@ MACRO(DEAL_II_ADD_TEST _category _test_name) ${CMAKE_CURRENT_BINARY_DIR}/${_test} DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${_test}/output - ${_comparison} + ${_comparison_file} ) ADD_CUSTOM_TARGET(${_full_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 index 4312788229..401b415a2b 100644 --- a/deal.II/cmake/macros/macro_deal_ii_pickup_tests.cmake +++ b/deal.II/cmake/macros/macro_deal_ii_pickup_tests.cmake @@ -35,6 +35,10 @@ MACRO(DEAL_II_PICKUP_TESTS) _test MATCHES "${TEST_PICKUP_REGEX}" ) GET_FILENAME_COMPONENT(_test ${_test} NAME) + # + # TODO: mpirun support + # + IF(_test MATCHES debug) SET(_configuration DEBUG) ELSEIF(_test MATCHES release) @@ -43,8 +47,9 @@ MACRO(DEAL_II_PICKUP_TESTS) SET(_configuration) ENDIF() + SET(_comparison ${_test}) STRING(REGEX REPLACE "\\..*" "" _test ${_test}) - DEAL_II_ADD_TEST(${_category} ${_test} ${_configuration}) + DEAL_II_ADD_TEST(${_category} ${_test} ${_comparison} ${_configuration}) ENDIF() ENDFOREACH() -- 2.39.5