]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Output only the first few lines of numdiff output if a test fails. Then output
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 23 Apr 2014 12:11:32 +0000 (12:11 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 23 Apr 2014 12:11:32 +0000 (12:11 +0000)
the first 50 lines of regular diff since it's so much more readable.

git-svn-id: https://svn.dealii.org/trunk@32815 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/cmake/macros/macro_add_test.cmake

index ecbf75ec9506a9042cd52e62bf8ca6e4ee59f2ce..d2569ddde70280160a2f9d88dd4d96744f43cb28 100644 (file)
@@ -1,7 +1,7 @@
 ## ---------------------------------------------------------------------
 ## $Id$
 ##
-## Copyright (C) 2013 by the deal.II authors
+## Copyright (C) 2013, 2014 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
@@ -205,7 +205,12 @@ MACRO(DEAL_II_ADD_TEST _category _test_name _comparison_file)
         COMMAND rm -f ${_test_directory}/failing_diff
         COMMAND touch ${_test_directory}/diff
         COMMAND
-          ${${_test_diff_variable}} # see comment in line 72
+         # run diff or numdiff (if available) to determine
+         # whether files are the same. if they are not, output
+          # the first few lines of the output of numdiff, followed
+          # by the results of regular diff since the latter is just
+          # more readable
+          ${${_test_diff_variable}} # see comment above about redirection
             ${_comparison_file}
             ${_test_directory}/output
             > ${_test_directory}/diff
@@ -216,8 +221,10 @@ MACRO(DEAL_II_ADD_TEST _category _test_name _comparison_file)
               && echo "${_test_full}: DIFF failed. ------ Source: ${_comparison_file}"
               && echo "${_test_full}: DIFF failed. ------ Result: ${_test_directory}/output"
               && echo "${_test_full}: DIFF failed. ------ Diff:   ${_test_directory}/failing_diff"
-              && echo "${_test_full}: DIFF failed. ------ Diffs as follows:"
-              && cat ${_test_directory}/failing_diff
+              && echo "${_test_full}: DIFF failed. ------ First 8 lines of numdiff/diff output:"
+              && cat ${_test_directory}/failing_diff | head -n 8
+              && echo "${_test_full}: DIFF failed. ------ First 50 lines diff output:"
+              && ${DIFF_EXECUTABLE} -c ${_comparison_file} ${_test_directory}/output | head -n 50
               && exit 1)
         WORKING_DIRECTORY
           ${_test_directory}

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.