From: Matthias Maier Date: Mon, 2 Sep 2013 19:46:10 +0000 (+0000) Subject: Reorganize test runs, provide better output X-Git-Tag: v8.1.0~570^2~396 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=14cab27ad4ee98eeaeaa6b6db1db93dab0f7ba56;p=dealii.git Reorganize test runs, provide better output git-svn-id: https://svn.dealii.org/branches/branch_port_the_testsuite@30550 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 bb85118091..61c3fbf018 100644 --- a/deal.II/cmake/macros/macro_deal_ii_add_test.cmake +++ b/deal.II/cmake/macros/macro_deal_ii_add_test.cmake @@ -79,12 +79,22 @@ 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... # ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_test}/output - COMMAND ${_full_test} + 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 @@ -93,6 +103,13 @@ MACRO(DEAL_II_ADD_TEST _category _test_name) 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: # @@ -103,7 +120,6 @@ MACRO(DEAL_II_ADD_TEST _category _test_name) SET(_comparison ${_comparison}.output) ENDIF() - ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_test}/diff COMMAND # TODO: Refactor... @@ -111,19 +127,18 @@ MACRO(DEAL_II_ADD_TEST _category _test_name) ${CMAKE_CURRENT_BINARY_DIR}/${_test}/output ${_comparison} > ${CMAKE_CURRENT_BINARY_DIR}/${_test}/diff - || mv - ${CMAKE_CURRENT_BINARY_DIR}/${_test}/diff - ${CMAKE_CURRENT_BINARY_DIR}/${_test}/failing_diff - COMMAND - ${DEAL_II_TEST_DIFF} - ${CMAKE_CURRENT_BINARY_DIR}/${_test}/output - ${_comparison} + || (mv ${CMAKE_CURRENT_BINARY_DIR}/${_test}/diff + ${CMAKE_CURRENT_BINARY_DIR}/${_test}/failing_diff + && echo ${CMAKE_CURRENT_BINARY_DIR}/${_test}/failing_diff + && exit 1) DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${_test}/output ${_comparison} ) ADD_CUSTOM_TARGET(${_full_test}.diff - DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${_test}/diff + COMMAND ${CMAKE_COMMAND} -E echo "${_full_test}: DIFF successful -------------------" + DEPENDS ${_full_test}.run + ${CMAKE_CURRENT_BINARY_DIR}/${_test}/diff ) diff --git a/deal.II/cmake/scripts/run_test.cmake b/deal.II/cmake/scripts/run_test.cmake index 56943a46f4..cc13455227 100644 --- a/deal.II/cmake/scripts/run_test.cmake +++ b/deal.II/cmake/scripts/run_test.cmake @@ -12,16 +12,21 @@ EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} ) IF("${_result_code}" STREQUAL "0") + + MESSAGE("${TEST}: Test successful:") + MESSAGE("=============================== OUTPUT BEGIN ===============================") + # Do not output everything, just that we are successful: MESSAGE("${TEST}: BUILD successful") MESSAGE("${TEST}: RUN successful") MESSAGE("${TEST}: DIFF successful") + MESSAGE("=============================== OUTPUT END ===============================") ELSE() - MESSAGE("*** ***") + MESSAGE("${TEST}: Test failed:") + MESSAGE("=============================== OUTPUT BEGIN ===============================") MESSAGE(${_output}) - # TODO: Be a bit more verbose ;-) - MESSAGE("${TEST}: TEST failed") - MESSAGE("*** ***") - MESSAGE(FATAL_ERROR "*** Test aborted.") + MESSAGE("=============================== OUTPUT END ===============================") + MESSAGE(FATAL_ERROR "*** abort") + ENDIF()