[cfe-commits] r144113 - in /cfe/trunk/utils/analyzer: CmpRuns.py SATestBuild.py
Anna Zaks
ganna at apple.com
Tue Nov 8 11:56:31 PST 2011
Author: zaks
Date: Tue Nov 8 13:56:31 2011
New Revision: 144113
URL: http://llvm.org/viewvc/llvm-project?rev=144113&view=rev
Log:
[analyzer] Testing: Display the number of reported differences in the main log.
Modified:
cfe/trunk/utils/analyzer/CmpRuns.py
cfe/trunk/utils/analyzer/SATestBuild.py
Modified: cfe/trunk/utils/analyzer/CmpRuns.py
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/utils/analyzer/CmpRuns.py?rev=144113&r1=144112&r2=144113&view=diff
==============================================================================
--- cfe/trunk/utils/analyzer/CmpRuns.py (original)
+++ cfe/trunk/utils/analyzer/CmpRuns.py Tue Nov 8 13:56:31 2011
@@ -189,25 +189,25 @@
auxLog = None
diff = compareResults(resultsA, resultsB)
- foundDiffs = False
+ foundDiffs = 0
for res in diff:
a,b,confidence = res
if a is None:
print "ADDED: %r" % b.getReadableName()
- foundDiffs = True
+ foundDiffs += 1
if auxLog:
print >>auxLog, ("('ADDED', %r, %r)" % (b.getReadableName(),
b.getReportData()))
elif b is None:
print "REMOVED: %r" % a.getReadableName()
- foundDiffs = True
+ foundDiffs += 1
if auxLog:
print >>auxLog, ("('REMOVED', %r, %r)" % (a.getReadableName(),
a.getReportData()))
elif confidence:
print "CHANGED: %r to %r" % (a.getReadableName(),
b.getReadableName())
- foundDiffs = True
+ foundDiffs += 1
if auxLog:
print >>auxLog, ("('CHANGED', %r, %r, %r, %r)"
% (a.getReadableName(),
@@ -217,10 +217,13 @@
else:
pass
- print "TOTAL REPORTS: %r" % len(resultsB.diagnostics)
+ TotalReports = len(resultsB.diagnostics)
+ print "TOTAL REPORTS: %r" % TotalReports
+ print "TOTAL DIFFERENCES: %r" % foundDiffs
if auxLog:
- print >>auxLog, "('TOTAL REPORTS', %r)" % len(resultsB.diagnostics)
-
+ print >>auxLog, "('TOTAL NEW REPORTS', %r)" % TotalReports
+ print >>auxLog, "('TOTAL DIFFERENCES', %r)" % foundDiffs
+
return foundDiffs
def main():
Modified: cfe/trunk/utils/analyzer/SATestBuild.py
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/utils/analyzer/SATestBuild.py?rev=144113&r1=144112&r2=144113&view=diff
==============================================================================
--- cfe/trunk/utils/analyzer/SATestBuild.py (original)
+++ cfe/trunk/utils/analyzer/SATestBuild.py Tue Nov 8 13:56:31 2011
@@ -330,7 +330,7 @@
NewList.sort()
# Iterate and find the differences.
- HaveDiffs = False
+ NumDiffs = 0
PairList = zip(RefList, NewList)
for P in PairList:
RefDir = P[0]
@@ -346,14 +346,14 @@
OLD_STDOUT = sys.stdout
sys.stdout = Discarder()
# Scan the results, delete empty plist files.
- HaveDiffs = CmpRuns.cmpScanBuildResults(RefDir, NewDir, Opts, False)
+ NumDiffs = CmpRuns.cmpScanBuildResults(RefDir, NewDir, Opts, False)
sys.stdout = OLD_STDOUT
- if HaveDiffs:
- print "Warning: difference in diagnostics. See %s" % (DiffsPath,)
- HaveDiffs=True
+ if (NumDiffs > 0) :
+ print "Warning: %r differences in diagnostics. See %s" % \
+ (NumDiffs, DiffsPath,)
print "Diagnostic comparison complete (time: %.2f)." % (time.time()-TBegin)
- return HaveDiffs
+ return (NumDiffs > 0)
def testProject(ID, InIsReferenceBuild, IsScanBuild , Dir=None):
global IsReferenceBuild
More information about the cfe-commits
mailing list