aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnna Zaks <ganna@apple.com>2012-11-14 21:32:16 +0000
committerAnna Zaks <ganna@apple.com>2012-11-14 21:32:16 +0000
commit25691f67b22b3ad02a07e66209cad492357f532c (patch)
tree0e2b81785673dc5e15f69080ede74770effc7e2d
parentb6ad9b163d50827d4cd7eccadb20432cd3c089d5 (diff)
[analyzer] Ensure that CmpRuns recursively walks the output directory.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167981 91177308-0d34-0410-b5e6-96231b3b80d8
-rwxr-xr-xutils/analyzer/CmpRuns.py79
1 files changed, 40 insertions, 39 deletions
diff --git a/utils/analyzer/CmpRuns.py b/utils/analyzer/CmpRuns.py
index 3ca9b2bbe7..9b468bfefe 100755
--- a/utils/analyzer/CmpRuns.py
+++ b/utils/analyzer/CmpRuns.py
@@ -148,45 +148,46 @@ def loadResultsFromSingleRun(info, deleteEmpty=True):
path = info.path
run = AnalysisRun(info)
- for f in os.listdir(path):
- if (not f.endswith('plist')):
- continue
-
- p = os.path.join(path, f)
- data = plistlib.readPlist(p)
-
- # Ignore/delete empty reports.
- if not data['files']:
- if deleteEmpty == True:
- os.remove(p)
- continue
-
- # Extract the HTML reports, if they exists.
- if 'HTMLDiagnostics_files' in data['diagnostics'][0]:
- htmlFiles = []
- for d in data['diagnostics']:
- # FIXME: Why is this named files, when does it have multiple
- # files?
- assert len(d['HTMLDiagnostics_files']) == 1
- htmlFiles.append(d.pop('HTMLDiagnostics_files')[0])
- else:
- htmlFiles = [None] * len(data['diagnostics'])
-
- clang_version = ''
- if 'clang_version' in data:
- clang_version = data.pop('clang_version')
-
- report = AnalysisReport(run, data.pop('files'), clang_version)
- diagnostics = [AnalysisDiagnostic(d, report, h)
- for d,h in zip(data.pop('diagnostics'),
- htmlFiles)]
-
- assert not data
-
- report.diagnostics.extend(diagnostics)
- run.reports.append(report)
- run.diagnostics.extend(diagnostics)
-
+ for (dirpath, dirnames, filenames) in os.walk(path):
+ for f in filenames:
+ if (not f.endswith('plist')):
+ continue
+
+ p = os.path.join(dirpath, f)
+ data = plistlib.readPlist(p)
+
+ # Ignore/delete empty reports.
+ if not data['files']:
+ if deleteEmpty == True:
+ os.remove(p)
+ continue
+
+ # Extract the HTML reports, if they exists.
+ if 'HTMLDiagnostics_files' in data['diagnostics'][0]:
+ htmlFiles = []
+ for d in data['diagnostics']:
+ # FIXME: Why is this named files, when does it have multiple
+ # files?
+ assert len(d['HTMLDiagnostics_files']) == 1
+ htmlFiles.append(d.pop('HTMLDiagnostics_files')[0])
+ else:
+ htmlFiles = [None] * len(data['diagnostics'])
+
+ clang_version = ''
+ if 'clang_version' in data:
+ clang_version = data.pop('clang_version')
+
+ report = AnalysisReport(run, data.pop('files'), clang_version)
+ diagnostics = [AnalysisDiagnostic(d, report, h)
+ for d,h in zip(data.pop('diagnostics'),
+ htmlFiles)]
+
+ assert not data
+
+ report.diagnostics.extend(diagnostics)
+ run.reports.append(report)
+ run.diagnostics.extend(diagnostics)
+
return run
def cmpAnalysisDiagnostic(d) :