diff options
author | Devin Coughlin <dcoughlin@apple.com> | 2016-01-23 01:09:07 +0000 |
---|---|---|
committer | Devin Coughlin <dcoughlin@apple.com> | 2016-01-23 01:09:07 +0000 |
commit | 9ea8033d1bce7e29af3f8faaecca2cf5ebf96698 (patch) | |
tree | c3d428de160894c718c6206c2ac3ed3bc5ab11bf | |
parent | c38568f6608a47476bdf70346d1724aa6479e489 (diff) | |
download | bcm5719-llvm-9ea8033d1bce7e29af3f8faaecca2cf5ebf96698.tar.gz bcm5719-llvm-9ea8033d1bce7e29af3f8faaecca2cf5ebf96698.zip |
[analyzer] SATestBuild.py: Remove html and log when producing reference results.
The html reports are huge -- every issue in a given file results in a separate
copy of the source code, in HTML form, for the file. This gets very large
quickly and it doesn't make sense to check this into a reference repository.
Also remove the log when generating reference results because it can leak
absolute path names. We still keep both the html and the log around when
producing non-reference results.
llvm-svn: 258594
-rwxr-xr-x | clang/utils/analyzer/SATestBuild.py | 36 |
1 files changed, 29 insertions, 7 deletions
diff --git a/clang/utils/analyzer/SATestBuild.py b/clang/utils/analyzer/SATestBuild.py index 9c830933728..ab68518b5ac 100755 --- a/clang/utils/analyzer/SATestBuild.py +++ b/clang/utils/analyzer/SATestBuild.py @@ -397,19 +397,26 @@ def runAnalyzePreprocessed(Dir, SBOutputDir, Mode): if Failed == False: os.remove(LogFile.name); +def getBuildLogPath(SBOutputDir): + return os.path.join(SBOutputDir, LogFolderName, BuildLogName) + +def removeLogFile(SBOutputDir): + BuildLogPath = getBuildLogPath(SBOutputDir) + # Clean up the log file. + if (os.path.exists(BuildLogPath)) : + RmCommand = "rm '%s'" % BuildLogPath + if Verbose == 1: + print " Executing: %s" % (RmCommand,) + check_call(RmCommand, shell=True) + def buildProject(Dir, SBOutputDir, ProjectBuildMode, IsReferenceBuild): TBegin = time.time() - BuildLogPath = os.path.join(SBOutputDir, LogFolderName, BuildLogName) + BuildLogPath = getBuildLogPath(SBOutputDir) print "Log file: %s" % (BuildLogPath,) print "Output directory: %s" %(SBOutputDir, ) - # Clean up the log file. - if (os.path.exists(BuildLogPath)) : - RmCommand = "rm '%s'" % BuildLogPath - if Verbose == 1: - print " Executing: %s" % (RmCommand,) - check_call(RmCommand, shell=True) + removeLogFile(SBOutputDir) # Clean up scan build results. if (os.path.exists(SBOutputDir)) : @@ -585,6 +592,19 @@ def runCmpResults(Dir, Strictness = 0): print "Diagnostic comparison complete (time: %.2f)." % (time.time()-TBegin) return (NumDiffs > 0) +def cleanupReferenceResults(SBOutputDir): + # Delete html, css, and js files from reference results. These can + # include multiple copies of the benchmark source and so get very large. + Extensions = ["html", "css", "js"] + for E in Extensions: + for F in glob.glob("%s/*/*.%s" % (SBOutputDir, E)): + P = os.path.join(SBOutputDir, F) + RmCommand = "rm '%s'" % P + check_call(RmCommand, shell=True) + + # Remove the log file. It leaks absolute path names. + removeLogFile(SBOutputDir) + def updateSVN(Mode, ProjectsMap): try: ProjectsMap.seek(0) @@ -634,6 +654,8 @@ def testProject(ID, ProjectBuildMode, IsReferenceBuild=False, Dir=None, Strictne if IsReferenceBuild == False: runCmpResults(Dir, Strictness) + else: + cleanupReferenceResults(SBOutputDir) print "Completed tests for project %s (time: %.2f)." % \ (ID, (time.time()-TBegin)) |