summaryrefslogtreecommitdiffstats
path: root/utils
diff options
context:
space:
mode:
authorAnna Zaks <ganna@apple.com>2011-11-08 19:56:31 +0000
committerAnna Zaks <ganna@apple.com>2011-11-08 19:56:31 +0000
commita7a2564ff59a1917c5f27343923635bd231466d6 (patch)
tree1a830d0b601b26b49e22b3813ef31149a15327ed /utils
parent4219c6652b4b3d47c97659688184e5bafbfcefba (diff)
[analyzer] Testing: Display the number of reported differences in the main log.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144113 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils')
-rwxr-xr-xutils/analyzer/CmpRuns.py17
-rwxr-xr-xutils/analyzer/SATestBuild.py12
2 files changed, 16 insertions, 13 deletions
diff --git a/utils/analyzer/CmpRuns.py b/utils/analyzer/CmpRuns.py
index b37c002240..2072e4d0a1 100755
--- a/utils/analyzer/CmpRuns.py
+++ b/utils/analyzer/CmpRuns.py
@@ -189,25 +189,25 @@ def cmpScanBuildResults(dirA, dirB, opts, deleteEmpty=True):
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 @@ def cmpScanBuildResults(dirA, dirB, opts, deleteEmpty=True):
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():
diff --git a/utils/analyzer/SATestBuild.py b/utils/analyzer/SATestBuild.py
index 684051fcd5..f0eb0b3de4 100755
--- a/utils/analyzer/SATestBuild.py
+++ b/utils/analyzer/SATestBuild.py
@@ -330,7 +330,7 @@ def runCmpResults(Dir):
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 @@ def runCmpResults(Dir):
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