summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xutils/analyzer/SATestUpdateDiffs.py20
1 files changed, 16 insertions, 4 deletions
diff --git a/utils/analyzer/SATestUpdateDiffs.py b/utils/analyzer/SATestUpdateDiffs.py
index 9b5b7064ce..a60c625245 100755
--- a/utils/analyzer/SATestUpdateDiffs.py
+++ b/utils/analyzer/SATestUpdateDiffs.py
@@ -34,8 +34,11 @@ def updateReferenceResults(ProjName, ProjBuildMode):
"previously run?"
sys.exit(-1)
- # Remove reference results.
- runCmd('git rm -r "%s"' % (RefResultsPath,))
+ # 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,))
@@ -52,12 +55,21 @@ def updateReferenceResults(ProjName, ProjBuildMode):
SATestBuild.cleanupReferenceResults(RefResultsPath)
# Remove the created .diffs file before adding.
- runCmd('rm -f "%s/*/%s"' % (
- RefResultsPath, SATestBuild.DiffsSummaryFileName))
+ removeDiffsSummaryFiles(RefResultsPath)
runCmd('git add "%s"' % (RefResultsPath,))
+def removeDiffsSummaryFiles(RefResultsPath):
+ """
+ Remove all auto-generated .diffs files in reference data.
+ """
+ for (Dirpath, Dirnames, Filenames) in os.walk(RefResultsPath):
+ if SATestBuild.DiffsSummaryFileName in Filenames:
+ runCmd("rm '%s'" % os.path.join(
+ Dirpath, SATestBuild.DiffsSummaryFileName))
+
+
def main(argv):
if len(argv) == 2 and argv[1] in ('-h', '--help'):
print >> sys.stderr, "Update static analyzer reference results based "\