summaryrefslogtreecommitdiffstats
path: root/clang/utils/analyzer/SATestBuild.py
diff options
context:
space:
mode:
authorGeorge Karpenkov <ekarpenkov@apple.com>2017-10-30 19:40:33 +0000
committerGeorge Karpenkov <ekarpenkov@apple.com>2017-10-30 19:40:33 +0000
commit3c128cb1e65b6419ab21a8cf9a948d84ce406e42 (patch)
treee82d001d5c33247a4935d2c6c1c2c3d7d733620e /clang/utils/analyzer/SATestBuild.py
parent017f896adb9d41702d0727e7e008917a8a8d5bc3 (diff)
downloadbcm5719-llvm-3c128cb1e65b6419ab21a8cf9a948d84ce406e42.tar.gz
bcm5719-llvm-3c128cb1e65b6419ab21a8cf9a948d84ce406e42.zip
[analyzer] [tests] Remove empty folders in reference results, do not store diffs.txt
Storing diffs.txt is now redundant, as we simply dump the CmpRuns output to stdout (it is saved in CI and tends to be small). Not generating those files enables us to remove empty folders, which confuse git, as it would not add them with reference results. llvm-svn: 316948
Diffstat (limited to 'clang/utils/analyzer/SATestBuild.py')
-rwxr-xr-xclang/utils/analyzer/SATestBuild.py16
1 files changed, 12 insertions, 4 deletions
diff --git a/clang/utils/analyzer/SATestBuild.py b/clang/utils/analyzer/SATestBuild.py
index 3c694fb0389..60c8796e338 100755
--- a/clang/utils/analyzer/SATestBuild.py
+++ b/clang/utils/analyzer/SATestBuild.py
@@ -120,8 +120,6 @@ BuildLogName = "run_static_analyzer.log"
# displayed when buildbot detects a build failure.
NumOfFailuresInSummary = 10
FailuresSummaryFileName = "failures.txt"
-# Summary of the result diffs.
-DiffsSummaryFileName = "diffs.txt"
# The scan-build result directory.
SBOutputDirName = "ScanBuildResults"
@@ -434,6 +432,16 @@ def CleanUpEmptyPlists(SBOutputDir):
continue
+def CleanUpEmptyFolders(SBOutputDir):
+ """
+ Remove empty folders from results, as git would not store them.
+ """
+ Subfolders = glob.glob(SBOutputDir + "/*")
+ for Folder in Subfolders:
+ if not os.listdir(Folder):
+ os.removedirs(Folder)
+
+
def checkBuild(SBOutputDir):
"""
Given the scan-build output directory, checks if the build failed
@@ -446,6 +454,7 @@ def checkBuild(SBOutputDir):
TotalFailed = len(Failures)
if TotalFailed == 0:
CleanUpEmptyPlists(SBOutputDir)
+ CleanUpEmptyFolders(SBOutputDir)
Plists = glob.glob(SBOutputDir + "/*/*.plist")
print "Number of bug reports (non-empty plist files) produced: %d" %\
len(Plists)
@@ -519,9 +528,8 @@ def runCmpResults(Dir, Strictness=0):
if Verbose == 1:
print " Comparing Results: %s %s" % (RefDir, NewDir)
- DiffsPath = os.path.join(NewDir, DiffsSummaryFileName)
PatchedSourceDirPath = os.path.join(Dir, PatchedSourceDirName)
- Opts = CmpRuns.CmpOptions(DiffsPath, "", PatchedSourceDirPath)
+ Opts = CmpRuns.CmpOptions(rootA="", rootB=PatchedSourceDirPath)
# Scan the results, delete empty plist files.
NumDiffs, ReportsInRef, ReportsInNew = \
CmpRuns.dumpScanBuildResultsDiff(RefDir, NewDir, Opts, False)
OpenPOWER on IntegriCloud