From: Matthias Maier Date: Tue, 3 Sep 2013 02:32:34 +0000 (+0000) Subject: Merge the perviously introduced 3 top level targets for a test back to 1 top level... X-Git-Tag: v8.1.0~570^2~391 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=21229bf36af5010ae894f8685373d5d497181ca3;p=dealii.git Merge the perviously introduced 3 top level targets for a test back to 1 top level target The performance penalty by trippling the number of top level targets was just way too high. git-svn-id: https://svn.dealii.org/branches/branch_port_the_testsuite@30566 0785d39b-7218-0410-832d-ea1e28bc413d --- 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 dfbed27215..fa64f50966 100644 --- a/deal.II/cmake/macros/macro_deal_ii_add_test.cmake +++ b/deal.II/cmake/macros/macro_deal_ii_add_test.cmake @@ -79,40 +79,10 @@ MACRO(DEAL_II_ADD_TEST _category _test_name) ${DEAL_II_BASE_NAME}${DEAL_II_${_build}_SUFFIX} ) - ADD_CUSTOM_TARGET(${_full_test}.build - COMMAND ${CMAKE_COMMAND} -E echo "${_full_test}: BUILD successful -------------------" - DEPENDS ${_full_test} - ) - - # - # Add a top level target to run the test... + # Determine correct file for comparison: # - ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_test}/output - COMMAND - ${_full_test} - || (echo "Running the test failed with the following partial output:" - && cat output - && rm output - && exit 1) - COMMAND - ${PERL_EXECUTABLE} -pi - ${CMAKE_SOURCE_DIR}/cmake/scripts/normalize.pl - ${CMAKE_CURRENT_BINARY_DIR}/${_test}/output - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${_test} - DEPENDS ${_full_test} ${CMAKE_SOURCE_DIR}/cmake/scripts/normalize.pl - ) - - ADD_CUSTOM_TARGET(${_full_test}.run - COMMAND ${CMAKE_COMMAND} -E echo "${_full_test}: RUN successful -------------------" - DEPENDS ${_full_test}.build - ${CMAKE_CURRENT_BINARY_DIR}/${_test}/output - ) - - # - # and compare the output: - # SET(_comparison ${CMAKE_CURRENT_SOURCE_DIR}/${_test_name}) IF(EXISTS ${_comparison}.${_build_lowercase}.output) SET(_comparison ${_comparison}.${_build_lowercase}.output) @@ -120,7 +90,25 @@ MACRO(DEAL_II_ADD_TEST _category _test_name) SET(_comparison ${_comparison}.output) ENDIF() + # + # Add a top level target to run and compare the test: + # + ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_test}/diff + COMMAND + ${CMAKE_COMMAND} -E echo "${_full_test}: BUILD successful" + COMMAND + ${_full_test} + || (echo "${_full_test}: RUN failed. Output:" + && cat output + && rm output + && exit 1) + COMMAND + ${PERL_EXECUTABLE} -pi + ${CMAKE_SOURCE_DIR}/cmake/scripts/normalize.pl + ${CMAKE_CURRENT_BINARY_DIR}/${_test}/output + COMMAND + ${CMAKE_COMMAND} -E echo "${_full_test}: RUN successful" COMMAND ${TEST_DIFF} ${CMAKE_CURRENT_BINARY_DIR}/${_test}/output @@ -128,22 +116,26 @@ MACRO(DEAL_II_ADD_TEST _category _test_name) > ${CMAKE_CURRENT_BINARY_DIR}/${_test}/diff || (mv ${CMAKE_CURRENT_BINARY_DIR}/${_test}/diff ${CMAKE_CURRENT_BINARY_DIR}/${_test}/failing_diff - && echo ${CMAKE_CURRENT_BINARY_DIR}/${_test}/failing_diff + && echo "${_full_test}: DIFF failed. Output:" + && cat ${CMAKE_CURRENT_BINARY_DIR}/${_test}/failing_diff && exit 1) + COMMAND + ${CMAKE_COMMAND} -E echo "${_full_test}: DIFF successful" + WORKING_DIRECTORY + ${CMAKE_CURRENT_BINARY_DIR}/${_test} DEPENDS - ${CMAKE_CURRENT_BINARY_DIR}/${_test}/output + ${_full_test} + ${CMAKE_SOURCE_DIR}/cmake/scripts/normalize.pl ${_comparison} ) ADD_CUSTOM_TARGET(${_full_test}.diff - COMMAND ${CMAKE_COMMAND} -E echo "${_full_test}: DIFF successful -------------------" - DEPENDS ${_full_test}.run - ${CMAKE_CURRENT_BINARY_DIR}/${_test}/diff + DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${_test}/diff ) - # # And finally add the test: # + ADD_TEST(NAME ${_category}/${_test} COMMAND ${CMAKE_COMMAND} -DTEST=${_full_test}