OLD | NEW |
1 # Copyright (C) 2011 Google Inc. All rights reserved. | 1 # Copyright (C) 2011 Google Inc. All rights reserved. |
2 # | 2 # |
3 # Redistribution and use in source and binary forms, with or without | 3 # Redistribution and use in source and binary forms, with or without |
4 # modification, are permitted provided that the following conditions are | 4 # modification, are permitted provided that the following conditions are |
5 # met: | 5 # met: |
6 # | 6 # |
7 # * Redistributions of source code must retain the above copyright | 7 # * Redistributions of source code must retain the above copyright |
8 # notice, this list of conditions and the following disclaimer. | 8 # notice, this list of conditions and the following disclaimer. |
9 # * Redistributions in binary form must reproduce the above | 9 # * Redistributions in binary form must reproduce the above |
10 # copyright notice, this list of conditions and the following disclaimer | 10 # copyright notice, this list of conditions and the following disclaimer |
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
268 self._caller.post('finished_test_list', test_list_name) | 268 self._caller.post('finished_test_list', test_list_name) |
269 | 269 |
270 def _update_test_input(self, test_input): | 270 def _update_test_input(self, test_input): |
271 if test_input.reference_files is None: | 271 if test_input.reference_files is None: |
272 # Lazy initialization. | 272 # Lazy initialization. |
273 test_input.reference_files = self._port.reference_files(test_input.t
est_name) | 273 test_input.reference_files = self._port.reference_files(test_input.t
est_name) |
274 if test_input.reference_files: | 274 if test_input.reference_files: |
275 test_input.should_run_pixel_test = True | 275 test_input.should_run_pixel_test = True |
276 else: | 276 else: |
277 test_input.should_run_pixel_test = self._port.should_run_as_pixel_te
st(test_input) | 277 test_input.should_run_pixel_test = self._port.should_run_as_pixel_te
st(test_input) |
| 278 test_input.should_run_pixel_test_first = ( |
| 279 self._port.should_run_pixel_test_first(test_input)) |
278 | 280 |
279 def _run_test(self, test_input, shard_name): | 281 def _run_test(self, test_input, shard_name): |
280 self._batch_count += 1 | 282 self._batch_count += 1 |
281 | 283 |
282 stop_when_done = False | 284 stop_when_done = False |
283 if self._batch_size > 0 and self._batch_count >= self._batch_size: | 285 if self._batch_size > 0 and self._batch_count >= self._batch_size: |
284 self._batch_count = 0 | 286 self._batch_count = 0 |
285 stop_when_done = True | 287 stop_when_done = True |
286 | 288 |
287 self._update_test_input(test_input) | 289 self._update_test_input(test_input) |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
500 def split_at(seq, index): | 502 def split_at(seq, index): |
501 return (seq[:index], seq[index:]) | 503 return (seq[:index], seq[index:]) |
502 | 504 |
503 num_old_per_new = divide_and_round_up(len(old_shards), max_new_shards) | 505 num_old_per_new = divide_and_round_up(len(old_shards), max_new_shards) |
504 new_shards = [] | 506 new_shards = [] |
505 remaining_shards = old_shards | 507 remaining_shards = old_shards |
506 while remaining_shards: | 508 while remaining_shards: |
507 some_shards, remaining_shards = split_at(remaining_shards, num_old_p
er_new) | 509 some_shards, remaining_shards = split_at(remaining_shards, num_old_p
er_new) |
508 new_shards.append(TestShard('%s_%d' % (shard_name_prefix, len(new_sh
ards) + 1), extract_and_flatten(some_shards))) | 510 new_shards.append(TestShard('%s_%d' % (shard_name_prefix, len(new_sh
ards) + 1), extract_and_flatten(some_shards))) |
509 return new_shards | 511 return new_shards |
OLD | NEW |