| OLD | NEW |
| 1 # Copyright (C) 2010 Google Inc. All rights reserved. | 1 # Copyright (C) 2010 Google Inc. All rights reserved. |
| 2 # Copyright (C) 2010 Gabor Rapcsanyi (rgabor@inf.u-szeged.hu), University of Sze
ged | 2 # Copyright (C) 2010 Gabor Rapcsanyi (rgabor@inf.u-szeged.hu), University of Sze
ged |
| 3 # | 3 # |
| 4 # Redistribution and use in source and binary forms, with or without | 4 # Redistribution and use in source and binary forms, with or without |
| 5 # modification, are permitted provided that the following conditions are | 5 # modification, are permitted provided that the following conditions are |
| 6 # met: | 6 # met: |
| 7 # | 7 # |
| 8 # * Redistributions of source code must retain the above copyright | 8 # * Redistributions of source code must retain the above copyright |
| 9 # notice, this list of conditions and the following disclaimer. | 9 # notice, this list of conditions and the following disclaimer. |
| 10 # * Redistributions in binary form must reproduce the above | 10 # * Redistributions in binary form must reproduce the above |
| (...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 tests_to_run = [test for test in test_names if test not in tests_to_skip
] | 246 tests_to_run = [test for test in test_names if test not in tests_to_skip
] |
| 247 | 247 |
| 248 if not tests_to_run: | 248 if not tests_to_run: |
| 249 return tests_to_run, tests_to_skip | 249 return tests_to_run, tests_to_skip |
| 250 | 250 |
| 251 # Create a sorted list of test files so the subset chunk, | 251 # Create a sorted list of test files so the subset chunk, |
| 252 # if used, contains alphabetically consecutive tests. | 252 # if used, contains alphabetically consecutive tests. |
| 253 if self._options.order == 'natural': | 253 if self._options.order == 'natural': |
| 254 tests_to_run.sort(key=self._port.test_key) | 254 tests_to_run.sort(key=self._port.test_key) |
| 255 elif self._options.order == 'random': | 255 elif self._options.order == 'random': |
| 256 random.shuffle(tests_to_run) | 256 tests_to_run.sort() |
| 257 elif self._options.order == 'random-seeded': | 257 random.Random(self._options.seed).shuffle(tests_to_run) |
| 258 rnd = random.Random() | |
| 259 rnd.seed(4) # http://xkcd.com/221/ | |
| 260 rnd.shuffle(tests_to_run) | |
| 261 | 258 |
| 262 tests_to_run, tests_in_other_chunks = self._finder.split_into_chunks(tes
ts_to_run) | 259 tests_to_run, tests_in_other_chunks = self._finder.split_into_chunks(tes
ts_to_run) |
| 263 self._expectations.add_extra_skipped_tests(tests_in_other_chunks) | 260 self._expectations.add_extra_skipped_tests(tests_in_other_chunks) |
| 264 tests_to_skip.update(tests_in_other_chunks) | 261 tests_to_skip.update(tests_in_other_chunks) |
| 265 | 262 |
| 266 return tests_to_run, tests_to_skip | 263 return tests_to_run, tests_to_skip |
| 267 | 264 |
| 268 def _test_input_for_file(self, test_file): | 265 def _test_input_for_file(self, test_file): |
| 269 return TestInput(test_file, | 266 return TestInput(test_file, |
| 270 self._options.slow_time_out_ms if self._test_is_slow(te
st_file) else self._options.time_out_ms, | 267 self._options.slow_time_out_ms if self._test_is_slow(te
st_file) else self._options.time_out_ms, |
| (...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 553 | 550 |
| 554 stats = {} | 551 stats = {} |
| 555 for result in initial_results.results_by_name.values(): | 552 for result in initial_results.results_by_name.values(): |
| 556 if result.type != test_expectations.SKIP: | 553 if result.type != test_expectations.SKIP: |
| 557 stats[result.test_name] = {'results': (_worker_number(result.wor
ker_name), result.test_number, result.pid, int( | 554 stats[result.test_name] = {'results': (_worker_number(result.wor
ker_name), result.test_number, result.pid, int( |
| 558 result.test_run_time * 1000), int(result.total_run_time * 10
00))} | 555 result.test_run_time * 1000), int(result.total_run_time * 10
00))} |
| 559 stats_trie = {} | 556 stats_trie = {} |
| 560 for name, value in stats.iteritems(): | 557 for name, value in stats.iteritems(): |
| 561 json_results_generator.add_path_to_trie(name, value, stats_trie) | 558 json_results_generator.add_path_to_trie(name, value, stats_trie) |
| 562 return stats_trie | 559 return stats_trie |
| OLD | NEW |