summaryrefslogtreecommitdiff
path: root/utils/analyzer/SATestUpdateDiffs.py
diff options
context:
space:
mode:
Diffstat (limited to 'utils/analyzer/SATestUpdateDiffs.py')
-rwxr-xr-xutils/analyzer/SATestUpdateDiffs.py37
1 files changed, 20 insertions, 17 deletions
diff --git a/utils/analyzer/SATestUpdateDiffs.py b/utils/analyzer/SATestUpdateDiffs.py
index 2282af15a5238..92bbd83172efb 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,30 @@ 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)
+ Dirname = os.path.dirname(os.path.abspath(BuildLogPath))
+ runCmd("mkdir -p '%s'" % Dirname)
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):