[cfe-commits] r143568 - /cfe/trunk/utils/analyzer/SATestBuild.py
Anna Zaks
ganna at apple.com
Wed Nov 2 13:46:51 PDT 2011
Author: zaks
Date: Wed Nov 2 15:46:50 2011
New Revision: 143568
URL: http://llvm.org/viewvc/llvm-project?rev=143568&view=rev
Log:
[analyzer] Tweak the test script
Rename the pre_run_static_analyzer script into cleanup_run_static_analyzer
and use it to clean up after the reference build - which is done as part of
adding a new project to the system.
Modified:
cfe/trunk/utils/analyzer/SATestBuild.py
Modified: cfe/trunk/utils/analyzer/SATestBuild.py
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/utils/analyzer/SATestBuild.py?rev=143568&r1=143567&r2=143568&view=diff
==============================================================================
--- cfe/trunk/utils/analyzer/SATestBuild.py (original)
+++ cfe/trunk/utils/analyzer/SATestBuild.py Wed Nov 2 15:46:50 2011
@@ -29,7 +29,7 @@
Assumptions (TODO: shouldn't need to assume these.):
The script is being run from the Repository Directory.
- The compiler for scan-build is in the PATH.
+ The compiler for scan-build and scan-build are in the PATH.
export PATH=/Users/zaks/workspace/c2llvm/build/Release+Asserts/bin:$PATH
For more logging, set the env variables:
@@ -52,7 +52,7 @@
# Names of the project specific scripts.
# The script that needs to be executed before the build can start.
-PreprocessScript = "pre_run_static_analyzer.sh"
+CleanupScript = "cleanup_run_static_analyzer.sh"
# This is a file containing commands for scan-build.
BuildScript = "run_static_analyzer.cmd"
@@ -84,8 +84,8 @@
return os.path.join(os.path.abspath(os.curdir), ID)
# Run pre-processing script if any.
-def runPreProcessingScript(Dir, PBuildLogFile):
- ScriptPath = os.path.join(Dir, PreprocessScript)
+def runCleanupScript(Dir, PBuildLogFile):
+ ScriptPath = os.path.join(Dir, CleanupScript)
if os.path.exists(ScriptPath):
try:
if Verbose == 1:
@@ -126,7 +126,7 @@
" for details."
sys.exit(-1)
-def buildProject(Dir, SBOutputDir):
+def buildProject(Dir, SBOutputDir, ClenupAfterBuild):
TBegin = time.time()
BuildLogPath = os.path.join(Dir, BuildLogName)
@@ -136,7 +136,7 @@
if (os.path.exists(BuildLogPath)) :
RmCommand = "rm " + BuildLogPath
if Verbose == 1:
- print " Executing: %s." % (RmCommand,)
+ print " Executing: %s" % (RmCommand,)
check_call(RmCommand, shell=True)
# Open the log file.
@@ -150,8 +150,12 @@
check_call(RmCommand, stderr=PBuildLogFile,
stdout=PBuildLogFile, shell=True)
- runPreProcessingScript(Dir, PBuildLogFile)
- runScanBuild(Dir, SBOutputDir, PBuildLogFile)
+ runCleanupScript(Dir, PBuildLogFile)
+ runScanBuild(Dir, SBOutputDir, PBuildLogFile)
+
+ if ClenupAfterBuild :
+ runCleanupScript(Dir, PBuildLogFile)
+
finally:
PBuildLogFile.close()
@@ -283,7 +287,7 @@
else :
SBOutputDir = os.path.join(Dir, SBOutputDirName)
- buildProject(Dir, SBOutputDir)
+ buildProject(Dir, SBOutputDir, IsReferenceBuild)
checkBuild(SBOutputDir)
More information about the cfe-commits
mailing list