summaryrefslogtreecommitdiff
path: root/testsuite/driver
diff options
context:
space:
mode:
authorSimon Marlow <marlowsd@gmail.com>2011-07-19 13:37:37 +0100
committerSimon Marlow <marlowsd@gmail.com>2011-07-20 09:53:28 +0100
commit3019b1e409c129ef7af63e6a7408fb36ec44444b (patch)
tree7951fafd46088265bd12e4d41952e36f044d52ad /testsuite/driver
parentd6b1a57f91dfd159cd1397fb8af13b20d7abbee6 (diff)
downloadhaskell-3019b1e409c129ef7af63e6a7408fb36ec44444b.tar.gz
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).
Diffstat (limited to 'testsuite/driver')
-rw-r--r--testsuite/driver/testlib.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/testsuite/driver/testlib.py b/testsuite/driver/testlib.py
index 2ad5764e2a..75d641f2f6 100644
--- a/testsuite/driver/testlib.py
+++ b/testsuite/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 == '':