[cfe-commits] r157816 - in /cfe/trunk/utils/analyzer: SATestAdd.py SATestBuild.py
Jordan Rose
jordan_rose at apple.com
Fri Jun 1 09:24:38 PDT 2012
Author: jrose
Date: Fri Jun 1 11:24:38 2012
New Revision: 157816
URL: http://llvm.org/viewvc/llvm-project?rev=157816&view=rev
Log:
[analyzer] Fix SATestAdd to work with SATestBuild.
Also, eliminate global 'IsReferenceBuild' in SATestBuild. It doesn't get
passed around that much.
Modified:
cfe/trunk/utils/analyzer/SATestAdd.py
cfe/trunk/utils/analyzer/SATestBuild.py
Modified: cfe/trunk/utils/analyzer/SATestAdd.py
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/utils/analyzer/SATestAdd.py?rev=157816&r1=157815&r2=157816&view=diff
==============================================================================
--- cfe/trunk/utils/analyzer/SATestAdd.py (original)
+++ cfe/trunk/utils/analyzer/SATestAdd.py Fri Jun 1 11:24:38 2012
@@ -41,7 +41,7 @@
sys.exit(-1)
# Build the project.
- SATestBuild.testProject(ID, True, IsScanBuild, Dir)
+ SATestBuild.testProject(ID, IsScanBuild, IsReferenceBuild=True, Dir=Dir)
# Add the project ID to the project map.
ProjectMapPath = os.path.join(CurDir, SATestBuild.ProjectMapFile)
Modified: cfe/trunk/utils/analyzer/SATestBuild.py
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/utils/analyzer/SATestBuild.py?rev=157816&r1=157815&r2=157816&view=diff
==============================================================================
--- cfe/trunk/utils/analyzer/SATestBuild.py (original)
+++ cfe/trunk/utils/analyzer/SATestBuild.py Fri Jun 1 11:24:38 2012
@@ -76,8 +76,6 @@
Verbose = 1
-IsReferenceBuild = False
-
# Make sure we flush the output after every print statement.
class flushfile(object):
def __init__(self, f):
@@ -100,7 +98,7 @@
def getProjectDir(ID):
return os.path.join(os.path.abspath(os.curdir), ID)
-def getSBOutputDirName() :
+def getSBOutputDirName(IsReferenceBuild) :
if IsReferenceBuild == True :
return SBOutputDirReferencePrefix + SBOutputDirName
else :
@@ -210,7 +208,7 @@
if Failed == False:
os.remove(LogFile.name);
-def buildProject(Dir, SBOutputDir, IsScanBuild):
+def buildProject(Dir, SBOutputDir, IsScanBuild, IsReferenceBuild):
TBegin = time.time()
BuildLogPath = os.path.join(SBOutputDir, LogFolderName, BuildLogName)
@@ -373,7 +371,7 @@
ProjectsMap.seek(0)
for I in csv.reader(ProjectsMap):
ProjName = I[0]
- Path = os.path.join(ProjName, getSBOutputDirName())
+ Path = os.path.join(ProjName, getSBOutputDirName(True))
if Mode == "delete":
Command = "svn delete %s" % (Path,)
@@ -397,7 +395,7 @@
print "Error: SVN update failed."
sys.exit(-1)
-def testProject(ID, IsScanBuild, Dir=None):
+def testProject(ID, IsScanBuild, IsReferenceBuild=False, Dir=None):
print " \n\n--- Building project %s" % (ID,)
TBegin = time.time()
@@ -408,10 +406,10 @@
print " Build directory: %s." % (Dir,)
# Set the build results directory.
- RelOutputDir = getSBOutputDirName()
+ RelOutputDir = getSBOutputDirName(IsReferenceBuild)
SBOutputDir = os.path.join(Dir, RelOutputDir)
- buildProject(Dir, SBOutputDir, IsScanBuild)
+ buildProject(Dir, SBOutputDir, IsScanBuild, IsReferenceBuild)
checkBuild(SBOutputDir)
@@ -421,10 +419,7 @@
print "Completed tests for project %s (time: %.2f)." % \
(ID, (time.time()-TBegin))
-def testAll(InIsReferenceBuild = False, UpdateSVN = False):
- global IsReferenceBuild
- IsReferenceBuild = InIsReferenceBuild
-
+def testAll(IsReferenceBuild = False, UpdateSVN = False):
PMapFile = open(getProjectMapPath(), "rb")
try:
# Validate the input.
@@ -439,13 +434,13 @@
# When we are regenerating the reference results, we might need to
# update svn. Remove reference results from SVN.
if UpdateSVN == True:
- assert(InIsReferenceBuild == True);
+ assert(IsReferenceBuild == True);
updateSVN("delete", PMapFile);
# Test the projects.
PMapFile.seek(0)
for I in csv.reader(PMapFile):
- testProject(I[0], int(I[1]))
+ testProject(I[0], int(I[1]), IsReferenceBuild)
# Add reference results to SVN.
if UpdateSVN == True:
More information about the cfe-commits
mailing list