summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeorge Karpenkov <ekarpenkov@apple.com>2018-02-28 01:55:23 +0000
committerGeorge Karpenkov <ekarpenkov@apple.com>2018-02-28 01:55:23 +0000
commit4c51d85a8954184fd2ff922e8b3ddd23aeb04ae0 (patch)
tree6eb9d0ac158515ed5e70a223d024bfa35c7eaf65
parent43eac1f9d7d2c985831b485d9ccc807416d1cf29 (diff)
[analyzer] [tests] Write to logfile instead of stdout while updating
reference results git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@326295 91177308-0d34-0410-b5e6-96231b3b80d8
-rwxr-xr-xutils/analyzer/SATestUpdateDiffs.py35
1 files changed, 18 insertions, 17 deletions
diff --git a/utils/analyzer/SATestUpdateDiffs.py b/utils/analyzer/SATestUpdateDiffs.py
index 2282af15a5..8cda8d16b2 100755
--- a/utils/analyzer/SATestUpdateDiffs.py
+++ b/utils/analyzer/SATestUpdateDiffs.py
@@ -13,10 +13,10 @@ import sys
Verbose = 1
-def runCmd(Command):
+def runCmd(Command, **kwargs):
if Verbose:
print "Executing %s" % Command
- check_call(Command, shell=True)
+ check_call(Command, shell=True, **kwargs)
def updateReferenceResults(ProjName, ProjBuildMode):
@@ -34,27 +34,28 @@ def updateReferenceResults(ProjName, ProjBuildMode):
"previously run?"
sys.exit(1)
- # Remove reference results: in git, and then again for a good measure
- # with rm, as git might not remove things fully if there are empty
- # directories involved.
- runCmd('git rm -r -q "%s"' % (RefResultsPath,))
- runCmd('rm -rf "%s"' % (RefResultsPath,))
-
- # Replace reference results with a freshly computed once.
- runCmd('cp -r "%s" "%s"' % (CreatedResultsPath, RefResultsPath,))
-
- # Run cleanup script.
BuildLogPath = SATestBuild.getBuildLogPath(RefResultsPath)
with open(BuildLogPath, "wb+") as PBuildLogFile:
+ # Remove reference results: in git, and then again for a good measure
+ # with rm, as git might not remove things fully if there are empty
+ # directories involved.
+ runCmd('git rm -r -q "%s"' % (RefResultsPath,), stdout=PBuildLogFile)
+ runCmd('rm -rf "%s"' % (RefResultsPath,), stdout=PBuildLogFile)
+
+ # Replace reference results with a freshly computed once.
+ runCmd('cp -r "%s" "%s"' % (CreatedResultsPath, RefResultsPath,),
+ stdout=PBuildLogFile)
+
+ # Run cleanup script.
SATestBuild.runCleanupScript(ProjDir, PBuildLogFile)
- SATestBuild.normalizeReferenceResults(
- ProjDir, RefResultsPath, ProjBuildMode)
+ SATestBuild.normalizeReferenceResults(
+ ProjDir, RefResultsPath, ProjBuildMode)
- # Clean up the generated difference results.
- SATestBuild.cleanupReferenceResults(RefResultsPath)
+ # Clean up the generated difference results.
+ SATestBuild.cleanupReferenceResults(RefResultsPath)
- runCmd('git add "%s"' % (RefResultsPath,))
+ runCmd('git add "%s"' % (RefResultsPath,), stdout=PBuildLogFile)
def main(argv):