[analyzer] SATestBuild: strip trailing newlines from command file.

When running a make-based command, SATestBuild tries to append a -jN flag
with an appropriate N to run the build in parallel. However, it failed
to take into account that each line read includes a trailing newline
(unless it is the last line of a file without a trailing newline), which
resulted in the "-jN" appearing on a line on its own.

llvm-svn: 190164
This commit is contained in:
Jordan Rose 2013-09-06 16:12:41 +00:00
parent 4e06e6e8c3
commit 7bd9186cdd
1 changed files with 1 additions and 0 deletions

View File

@ -215,6 +215,7 @@ def runScanBuild(Dir, SBOutputDir, PBuildLogFile):
SBCommandFile = open(BuildScriptPath, "r")
SBPrefix = "scan-build " + SBOptions + " "
for Command in SBCommandFile:
Command = Command.strip()
# If using 'make', auto imply a -jX argument
# to speed up analysis. xcodebuild will
# automatically use the maximum number of cores.