[cfe-commits] r81018 - /cfe/trunk/utils/CmpDriver
Daniel Dunbar
daniel at zuster.org
Fri Sep 4 11:35:09 PDT 2009
Author: ddunbar
Date: Fri Sep 4 13:35:09 2009
New Revision: 81018
URL: http://llvm.org/viewvc/llvm-project?rev=81018&view=rev
Log:
Also compare stdout and stderr lines.
Modified:
cfe/trunk/utils/CmpDriver
Modified: cfe/trunk/utils/CmpDriver
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/utils/CmpDriver?rev=81018&r1=81017&r2=81018&view=diff
==============================================================================
--- cfe/trunk/utils/CmpDriver (original)
+++ cfe/trunk/utils/CmpDriver Fri Sep 4 13:35:09 2009
@@ -97,7 +97,7 @@
ln.startswith('Configured with: ') or
ln.startswith('Thread model: ') or
ln.startswith('gcc version') or
- ln.startswith('ccc version')):
+ ln.startswith('clang version')):
pass
elif ln.strip().startswith('"'):
self.commands.append(list(splitArgs(ln)))
@@ -131,15 +131,41 @@
# Compare stdout.
if infoA.stdout != infoB.stdout:
print '-- STDOUT DIFFERS -'
- print 'A: ',infoA.stdout
- print 'B: ',infoB.stdout
+ print 'A OUTPUT: ',infoA.stdout
+ print 'B OUTPUT: ',infoB.stdout
+ print
+
+ diff = ZipperDiff(infoA.stdout.split('\n'),
+ infoB.stdout.split('\n'))
+ for i,(aElt,bElt) in enumerate(diff.getDiffs()):
+ if aElt is None:
+ print 'A missing: %s' % bElt
+ elif bElt is None:
+ print 'B missing: %s' % aElt
+ else:
+ print 'mismatch: A: %s' % aElt
+ print ' B: %s' % bElt
+
differ = True
# Compare stderr.
if infoA.stderr != infoB.stderr:
print '-- STDERR DIFFERS -'
- print 'A: ',infoA.stderr
- print 'B: ',infoB.stderr
+ print 'A STDERR: ',infoA.stderr
+ print 'B STDERR: ',infoB.stderr
+ print
+
+ diff = ZipperDiff(infoA.stderr.split('\n'),
+ infoB.stderr.split('\n'))
+ for i,(aElt,bElt) in enumerate(diff.getDiffs()):
+ if aElt is None:
+ print 'A missing: %s' % bElt
+ elif bElt is None:
+ print 'B missing: %s' % aElt
+ else:
+ print 'mismatch: A: %s' % aElt
+ print ' B: %s' % bElt
+
differ = True
# Compare commands.
More information about the cfe-commits
mailing list