[llvm-commits] [LNT] r163768 - /lnt/trunk/lnt/server/reporting/analysis.py
Daniel Dunbar
daniel at zuster.org
Wed Sep 12 18:39:33 PDT 2012
Author: ddunbar
Date: Wed Sep 12 20:39:33 2012
New Revision: 163768
URL: http://llvm.org/viewvc/llvm-project?rev=163768&view=rev
Log:
[analysis] Add RunInfo.get_comparison_result() which supports multiple runs.
Modified:
lnt/trunk/lnt/server/reporting/analysis.py
Modified: lnt/trunk/lnt/server/reporting/analysis.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/reporting/analysis.py?rev=163768&r1=163767&r2=163768&view=diff
==============================================================================
--- lnt/trunk/lnt/server/reporting/analysis.py (original)
+++ lnt/trunk/lnt/server/reporting/analysis.py Wed Sep 12 20:39:33 2012
@@ -123,19 +123,30 @@
def get_run_comparison_result(self, run, compare_to, test_id, field,
comparison_window=[]):
+ if compare_to is not None:
+ compare_to = [compare_to]
+ else:
+ compare_to = []
+ return self.get_comparison_result([run], compare_to, test_id, field,
+ comparison_window)
+
+ def get_comparison_result(self, runs, compare_runs, test_id, field,
+ comparison_window=[]):
# Get the field which indicates the requested field's status.
status_field = field.status_field
# Load the sample data for the current and previous runs and the
# comparison window.
- if compare_to is None:
- compare_id = None
- else:
- compare_id = compare_to.id
-
- # Lookup the current and previous samples.
- run_samples = self.sample_map.get((run.id, test_id), ())
- prev_samples = self.sample_map.get((compare_id, test_id), ())
+ run_samples = []
+ prev_samples = []
+ for run in runs:
+ samples = self.sample_map.get((run.id, test_id))
+ if samples is not None:
+ run_samples.extend(samples)
+ for run in compare_runs:
+ samples = self.sample_map.get((run.id, test_id))
+ if samples is not None:
+ prev_samples.extend(samples)
# Determine whether this (test,pset) passed or failed in the current and
# previous runs.
More information about the llvm-commits
mailing list