diff options
author | George Karpenkov <ekarpenkov@apple.com> | 2017-10-27 22:39:54 +0000 |
---|---|---|
committer | George Karpenkov <ekarpenkov@apple.com> | 2017-10-27 22:39:54 +0000 |
commit | 0d8450b358fac348761b11924a92e8d269389cb1 (patch) | |
tree | 6ffc9c56aafd2a666a0d775fe6df1761964e0e5d /utils | |
parent | d6689452f55d5a852bff083e2855e5abcde49997 (diff) |
[Analyzer] [Tests] Dump the output of scan-build to stdout on failure.
Eliminates extra lookup step during debugging.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316806 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils')
-rwxr-xr-x | utils/analyzer/SATestBuild.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/utils/analyzer/SATestBuild.py b/utils/analyzer/SATestBuild.py index 6f4ef2824b..ed700c0c8e 100755 --- a/utils/analyzer/SATestBuild.py +++ b/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) |