Index: tools/testrunner/local/execution.py |
diff --git a/tools/testrunner/local/execution.py b/tools/testrunner/local/execution.py |
index 80a5989be2f255a672b872adca74b284ad2ef49c..ac69eab3c912c81f4a7eeb78ab727a0055e6503f 100644 |
--- a/tools/testrunner/local/execution.py |
+++ b/tools/testrunner/local/execution.py |
@@ -64,8 +64,10 @@ class Runner(object): |
self.perf_data_manager = perfdata.PerfDataManager(datapath) |
self.perfdata = self.perf_data_manager.GetStore(context.arch, context.mode) |
self.tests = [ t for s in suites for t in s.tests ] |
- for t in self.tests: |
- t.duration = self.perfdata.FetchPerfData(t) or 1.0 |
+ if not context.no_sorting: |
+ for t in self.tests: |
+ t.duration = self.perfdata.FetchPerfData(t) or 1.0 |
+ self.tests.sort(key=lambda t: t.duration, reverse=True) |
self._CommonInit(len(self.tests), progress_indicator, context) |
def _CommonInit(self, num_tests, progress_indicator, context): |
@@ -94,8 +96,6 @@ class Runner(object): |
# while the queue is filled. |
queue = [] |
queued_exception = None |
- if not self.context.no_sorting: |
- self.tests = sorted(self.tests, key=lambda t: t.duration, reverse=True) |
for test in self.tests: |
assert test.id >= 0 |
test_map[test.id] = test |