[cfe-commits] r162789 - /cfe/trunk/utils/analyzer/SATestBuild.py
Ted Kremenek
kremenek at apple.com
Tue Aug 28 13:40:02 PDT 2012
Author: kremenek
Date: Tue Aug 28 15:40:02 2012
New Revision: 162789
URL: http://llvm.org/viewvc/llvm-project?rev=162789&view=rev
Log:
Consolidate helper methods and configuration logic. No functionality change.
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=162789&r1=162788&r2=162789&view=diff
==============================================================================
--- cfe/trunk/utils/analyzer/SATestBuild.py (original)
+++ cfe/trunk/utils/analyzer/SATestBuild.py Tue Aug 28 15:40:02 2012
@@ -47,34 +47,9 @@
import plistlib
from subprocess import check_call, CalledProcessError
-# Project map stores info about all the "registered" projects.
-ProjectMapFile = "projectMap.csv"
-
-# Names of the project specific scripts.
-# The script that needs to be executed before the build can start.
-CleanupScript = "cleanup_run_static_analyzer.sh"
-# This is a file containing commands for scan-build.
-BuildScript = "run_static_analyzer.cmd"
-
-# The log file name.
-LogFolderName = "Logs"
-BuildLogName = "run_static_analyzer.log"
-# Summary file - contains the summary of the failures. Ex: This info can be be
-# 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"
-SBOutputDirReferencePrefix = "Ref"
-
-# The list of checkers used during analyzes.
-# Currently, consists of all the non experimental checkers.
-Checkers="alpha.security.taint,core,deadcode,security,unix,osx"
-
-Verbose = 1
+#------------------------------------------------------------------------------
+# Helper functions.
+#------------------------------------------------------------------------------
def which(command, paths = None):
"""which(command, [paths]) - Look up the given command in the paths string
@@ -107,12 +82,6 @@
return None
-# Find Clang for static analysis.
-Clang = which("clang", os.environ['PATH'])
-if not Clang:
- print "Error: cannot find 'clang' in PATH"
- sys.exit(-1)
-
# Make sure we flush the output after every print statement.
class flushfile(object):
def __init__(self, f):
@@ -141,6 +110,49 @@
else :
return SBOutputDirName
+#------------------------------------------------------------------------------
+# Configuration setup.
+#------------------------------------------------------------------------------
+
+# Find Clang for static analysis.
+Clang = which("clang", os.environ['PATH'])
+if not Clang:
+ print "Error: cannot find 'clang' in PATH"
+ sys.exit(-1)
+
+# Project map stores info about all the "registered" projects.
+ProjectMapFile = "projectMap.csv"
+
+# Names of the project specific scripts.
+# The script that needs to be executed before the build can start.
+CleanupScript = "cleanup_run_static_analyzer.sh"
+# This is a file containing commands for scan-build.
+BuildScript = "run_static_analyzer.cmd"
+
+# The log file name.
+LogFolderName = "Logs"
+BuildLogName = "run_static_analyzer.log"
+# Summary file - contains the summary of the failures. Ex: This info can be be
+# 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"
+SBOutputDirReferencePrefix = "Ref"
+
+# The list of checkers used during analyzes.
+# Currently, consists of all the non experimental checkers.
+Checkers="alpha.security.taint,core,deadcode,security,unix,osx"
+
+Verbose = 1
+
+#------------------------------------------------------------------------------
+# Test harness logic.
+#------------------------------------------------------------------------------
+
# Run pre-processing script if any.
def runCleanupScript(Dir, PBuildLogFile):
ScriptPath = os.path.join(Dir, CleanupScript)
More information about the cfe-commits
mailing list