forked from OSchip/llvm-project
[Analyzer] Remove dead code from testing scripts
Differential Revision: https://reviews.llvm.org/D38488 llvm-svn: 315489
This commit is contained in:
parent
ead0162801
commit
7d36cd7223
|
@ -653,40 +653,6 @@ def cleanupReferenceResults(SBOutputDir):
|
||||||
removeLogFile(SBOutputDir)
|
removeLogFile(SBOutputDir)
|
||||||
|
|
||||||
|
|
||||||
def updateSVN(Mode, PMapFile):
|
|
||||||
"""
|
|
||||||
svn delete or svn add (depending on `Mode`) all folders defined in the file
|
|
||||||
handler `PMapFile`.
|
|
||||||
Commit the result to SVN.
|
|
||||||
"""
|
|
||||||
try:
|
|
||||||
for I in iterateOverProjects(PMapFile):
|
|
||||||
ProjName = I[0]
|
|
||||||
Path = os.path.join(ProjName, getSBOutputDirName(True))
|
|
||||||
|
|
||||||
if Mode == "delete":
|
|
||||||
Command = "svn delete '%s'" % (Path,)
|
|
||||||
else:
|
|
||||||
Command = "svn add '%s'" % (Path,)
|
|
||||||
|
|
||||||
if Verbose == 1:
|
|
||||||
print " Executing: %s" % (Command,)
|
|
||||||
check_call(Command, shell=True)
|
|
||||||
|
|
||||||
if Mode == "delete":
|
|
||||||
CommitCommand = "svn commit -m \"[analyzer tests] Remove " \
|
|
||||||
"reference results.\""
|
|
||||||
else:
|
|
||||||
CommitCommand = "svn commit -m \"[analyzer tests] Add new " \
|
|
||||||
"reference results.\""
|
|
||||||
if Verbose == 1:
|
|
||||||
print " Executing: %s" % (CommitCommand,)
|
|
||||||
check_call(CommitCommand, shell=True)
|
|
||||||
except:
|
|
||||||
print "Error: SVN update failed."
|
|
||||||
sys.exit(-1)
|
|
||||||
|
|
||||||
|
|
||||||
def testProject(ID, ProjectBuildMode, IsReferenceBuild=False, Strictness=0):
|
def testProject(ID, ProjectBuildMode, IsReferenceBuild=False, Strictness=0):
|
||||||
"""
|
"""
|
||||||
Test a given project.
|
Test a given project.
|
||||||
|
@ -757,26 +723,16 @@ def validateProjectFile(PMapFile):
|
||||||
raise Exception()
|
raise Exception()
|
||||||
|
|
||||||
|
|
||||||
def testAll(IsReferenceBuild=False, UpdateSVN=False, Strictness=0):
|
def testAll(IsReferenceBuild=False, Strictness=0):
|
||||||
TestsPassed = True
|
TestsPassed = True
|
||||||
with projectFileHandler() as PMapFile:
|
with projectFileHandler() as PMapFile:
|
||||||
validateProjectFile(PMapFile)
|
validateProjectFile(PMapFile)
|
||||||
|
|
||||||
# When we are regenerating the reference results, we might need to
|
|
||||||
# update svn. Remove reference results from SVN.
|
|
||||||
if UpdateSVN:
|
|
||||||
assert(IsReferenceBuild)
|
|
||||||
updateSVN("delete", PMapFile)
|
|
||||||
|
|
||||||
# Test the projects.
|
# Test the projects.
|
||||||
for (ProjName, ProjBuildMode) in iterateOverProjects(PMapFile):
|
for (ProjName, ProjBuildMode) in iterateOverProjects(PMapFile):
|
||||||
TestsPassed &= testProject(
|
TestsPassed &= testProject(
|
||||||
ProjName, int(ProjBuildMode), IsReferenceBuild, Strictness)
|
ProjName, int(ProjBuildMode), IsReferenceBuild, Strictness)
|
||||||
|
|
||||||
# Re-add reference results to SVN.
|
|
||||||
if UpdateSVN:
|
|
||||||
updateSVN("add", PMapFile)
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
# Parse command line arguments.
|
# Parse command line arguments.
|
||||||
|
@ -789,20 +745,13 @@ if __name__ == '__main__':
|
||||||
reference. Default is 0.')
|
reference. Default is 0.')
|
||||||
Parser.add_argument('-r', dest='regenerate', action='store_true',
|
Parser.add_argument('-r', dest='regenerate', action='store_true',
|
||||||
default=False, help='Regenerate reference output.')
|
default=False, help='Regenerate reference output.')
|
||||||
Parser.add_argument('-rs', dest='update_reference', action='store_true',
|
|
||||||
default=False,
|
|
||||||
help='Regenerate reference output and update svn.')
|
|
||||||
Args = Parser.parse_args()
|
Args = Parser.parse_args()
|
||||||
|
|
||||||
IsReference = False
|
IsReference = False
|
||||||
UpdateSVN = False
|
|
||||||
Strictness = Args.strictness
|
Strictness = Args.strictness
|
||||||
if Args.regenerate:
|
if Args.regenerate:
|
||||||
IsReference = True
|
IsReference = True
|
||||||
elif Args.update_reference:
|
|
||||||
IsReference = True
|
|
||||||
UpdateSVN = True
|
|
||||||
|
|
||||||
TestsPassed = testAll(IsReference, UpdateSVN, Strictness)
|
TestsPassed = testAll(IsReference, Strictness)
|
||||||
if not TestsPassed:
|
if not TestsPassed:
|
||||||
sys.exit(-1)
|
sys.exit(-1)
|
||||||
|
|
Loading…
Reference in New Issue