From: Daniel Dunbar Date: Sat, 17 Jan 2009 00:50:45 +0000 (+0000) Subject: Return success indicator from CmpDriver. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c97c05f849e051afcd1f4a9d4dfa65c88a642b53;p=clang Return success indicator from CmpDriver. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62388 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/utils/CmpDriver b/utils/CmpDriver index 9301ed75a1..0412e4ba9d 100755 --- a/utils/CmpDriver +++ b/utils/CmpDriver @@ -135,17 +135,21 @@ def main(): infoA = captureDriverInfo(driverA, args) infoB = captureDriverInfo(driverB, args) + differ = False + # Compare stdout. if infoA.stdout != infoB.stdout: print '-- STDOUT DIFFERS -' print 'A: ',infoA.stdout print 'B: ',infoB.stdout + differ = True # Compare stderr. if infoA.stderr != infoB.stderr: print '-- STDERR DIFFERS -' print 'A: ',infoA.stderr print 'B: ',infoB.stderr + differ = True # Compare commands. for i,(a,b) in enumerate(zip(infoA.commands, infoB.commands)): @@ -164,12 +168,17 @@ def main(): else: print 'mismatch: A: %s' % aElt print ' B: %s' % bElt + differ = True # Compare result codes. if infoA.exitCode != infoB.exitCode: print '-- EXIT CODES DIFFER -' print 'A: ',infoA.exitCode print 'B: ',infoB.exitCode + differ = True + + if differ: + sys.exit(1) if __name__ == '__main__': main()