[commit: testsuite] master: When the output files differ, present the diffs between the *actual* (52e044c)
Simon Marlow
marlowsd at gmail.com
Wed Jul 20 10:53:34 CEST 2011
Repository : ssh://darcs.haskell.org//srv/darcs/testsuite
On branch : master
http://hackage.haskell.org/trac/ghc/changeset/52e044ca3b97d642e68a554e4546b607256449bf
>---------------------------------------------------------------
commit 52e044ca3b97d642e68a554e4546b607256449bf
Author: Simon Marlow <marlowsd at gmail.com>
Date: Tue Jul 19 13:37:37 2011 +0100
When the output files differ, present the diffs between the *actual*
output, not the normalised output. The latter may have newlines
removed, making the diff unreadable. I broke this recently, but it
was only working by accident, now it is working by design (and is
commented, to boot).
>---------------------------------------------------------------
driver/testlib.py | 14 ++++++++++----
1 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/driver/testlib.py b/driver/testlib.py
index 2ad5764..75d641f 100644
--- a/driver/testlib.py
+++ b/driver/testlib.py
@@ -1418,14 +1418,20 @@ def compare_outputs( kind, normaliser, extra_normaliser,
# Ignore whitespace when diffing. We should only get to this
# point if there are non-whitespace differences
- r = os.system( 'diff -uw ' + expected_normalised_file + \
- ' ' + actual_normalised_file )
+ #
+ # Note we are diffing the *actual* output, not the normalised
+ # output. The normalised output may have whitespace squashed
+ # (including newlines) so the diff would be hard to read.
+ # This does mean that the diff might contain changes that
+ # would be normalised away.
+ r = os.system( 'diff -uw ' + expected_file + \
+ ' ' + actual_file )
# If for some reason there were no non-whitespace differences,
# then do a full diff
if r == 0:
- r = os.system( 'diff -u ' + expected_normalised_file + \
- ' ' + actual_normalised_file )
+ r = os.system( 'diff -u ' + expected_file + \
+ ' ' + actual_file )
if config.accept:
if expected_file == '':
More information about the Cvs-ghc
mailing list