summaryrefslogtreecommitdiffstats
path: root/clang/utils/analyzer/SATestBuild.py
diff options
context:
space:
mode:
authorGeorge Karpenkov <ekarpenkov@apple.com>2017-10-27 22:39:54 +0000
committerGeorge Karpenkov <ekarpenkov@apple.com>2017-10-27 22:39:54 +0000
commite58044d4324a3431be93685071643914baa886d6 (patch)
tree5d3f66756ef24a2bb57c1e39f6841d2b67db6715 /clang/utils/analyzer/SATestBuild.py
parent9d5a7c3b8c772f07dd3b41541e50eb303f2e7fd0 (diff)
downloadbcm5719-llvm-e58044d4324a3431be93685071643914baa886d6.tar.gz
bcm5719-llvm-e58044d4324a3431be93685071643914baa886d6.zip
[Analyzer] [Tests] Dump the output of scan-build to stdout on failure.
Eliminates extra lookup step during debugging. llvm-svn: 316806
Diffstat (limited to 'clang/utils/analyzer/SATestBuild.py')
-rwxr-xr-xclang/utils/analyzer/SATestBuild.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/clang/utils/analyzer/SATestBuild.py b/clang/utils/analyzer/SATestBuild.py
index 6f4ef2824b0..ed700c0c8eb 100755
--- a/clang/utils/analyzer/SATestBuild.py
+++ b/clang/utils/analyzer/SATestBuild.py
@@ -272,10 +272,11 @@ def runScanBuild(Dir, SBOutputDir, PBuildLogFile):
stderr=PBuildLogFile,
stdout=PBuildLogFile,
shell=True)
- except:
- print "Error: scan-build failed. See ", PBuildLogFile.name,\
- " for details."
- raise
+ except CalledProcessError:
+ print "Error: scan-build failed. Its output was: "
+ PBuildLogFile.seek(0)
+ shutil.copyfileobj(PBuildLogFile, sys.stdout)
+ sys.exit(1)
def runAnalyzePreprocessed(Dir, SBOutputDir, Mode):
@@ -373,7 +374,7 @@ def buildProject(Dir, SBOutputDir, ProjectBuildMode, IsReferenceBuild):
os.makedirs(os.path.join(SBOutputDir, LogFolderName))
# Build and analyze the project.
- with open(BuildLogPath, "wb+") as PBuildLogFile:
+ with open(BuildLogPath, "r+b") as PBuildLogFile:
if (ProjectBuildMode == 1):
downloadAndPatch(Dir, PBuildLogFile)
runCleanupScript(Dir, PBuildLogFile)
OpenPOWER on IntegriCloud