]> granicus.if.org Git - clang/commitdiff
Also compare stdout and stderr lines.
authorDaniel Dunbar <daniel@zuster.org>
Fri, 4 Sep 2009 18:35:09 +0000 (18:35 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Fri, 4 Sep 2009 18:35:09 +0000 (18:35 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81018 91177308-0d34-0410-b5e6-96231b3b80d8

utils/CmpDriver

index ad75809d754c5082aeb431abcb97aa9f6f5b9b67..16b108117d3e933e75cb1f14491c7823789f2e0d 100755 (executable)
@@ -97,7 +97,7 @@ class CompileInfo:
                 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 @@ def main():
     # 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.