Changeset 124240 in webkit
- Timestamp:
- Jul 31, 2012, 12:42:55 PM (13 years ago)
- Location:
- trunk/Tools
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r124236 r124240 1 2012-07-31 Dirk Pranke <dpranke@chromium.org> 2 3 nrwt: clean up prepare_lists_and_print_output, run, set_up_run a bit 4 https://bugs.webkit.org/show_bug.cgi?id=92781 5 6 Reviewed by Ryosuke Niwa. 7 8 More refactoring ... rename prepare_lists_and_print_output to 9 just prepare_lists so that it only has a single purpose, and 10 clean up the surrounding code a bit as well. 11 12 * Scripts/webkitpy/layout_tests/controllers/manager.py: 13 (Manager._collect_tests): 14 (Manager._prepare_lists): 15 (Manager._set_up_run): 16 (Manager.run): 17 1 18 2012-07-31 Dirk Pranke <dpranke@chromium.org> 2 19 -
trunk/Tools/Scripts/webkitpy/layout_tests/controllers/manager.py
r124236 r124240 331 331 332 332 def _collect_tests(self, args): 333 self._paths, self._test_names =self._finder.find_tests(self._options, args)333 return self._finder.find_tests(self._options, args) 334 334 335 335 def _is_http_test(self, test): … … 345 345 return self.PERF_SUBDIR == test or (self.PERF_SUBDIR + self._port.TEST_PATH_SEPARATOR) in test 346 346 347 # FIXME: This method is way too long and needs to be broken into pieces. 348 def prepare_lists_and_print_output(self): 349 """Create appropriate subsets of test lists and returns a 350 ResultSummary object. Also prints expected test counts. 351 """ 352 num_all_test_files = len(self._test_names) 353 347 def _prepare_lists(self): 354 348 tests_to_skip = self._finder.skip_tests(self._paths, self._test_names, self._expectations, self._http_tests()) 355 if not self._test_names: 356 _log.critical('No tests to run.') 357 return None 349 self._test_names = list(set(self._test_names) - tests_to_skip) 358 350 359 351 # Create a sorted list of test files so the subset chunk, 360 352 # if used, contains alphabetically consecutive tests. 361 self._test_names = list(set(self._test_names) - tests_to_skip)362 353 if self._options.randomize_order: 363 354 random.shuffle(self._test_names) … … 379 370 380 371 iterations = self._options.repeat_each * self._options.iterations 381 result_summary = ResultSummary(self._expectations, set(self._test_names), iterations, tests_to_skip) 382 383 self._printer.print_found(num_all_test_files, len(self._test_names), self._options.repeat_each, self._options.iterations) 384 self._printer.print_expected(result_summary, self._expectations.get_tests_with_result_type) 385 386 return result_summary 372 return ResultSummary(self._expectations, set(self._test_names), iterations, tests_to_skip) 387 373 388 374 def _get_dir_for_test_file(self, test_file): … … 664 650 665 651 def _set_up_run(self): 666 """Configures the system to be ready to run tests. 667 668 Returns a ResultSummary object if we should continue to run tests, 669 or None if we should abort. 670 671 """ 652 self._printer.write_update("Checking build ...") 653 if not self._port.check_build(self.needs_servers()): 654 _log.error("Build check failed") 655 return False 656 672 657 # This must be started before we check the system dependencies, 673 658 # since the helper may do things to make the setup correct. … … 681 666 if not self._port.check_sys_deps(self.needs_servers()): 682 667 self._port.stop_helper() 683 return None668 return False 684 669 685 670 if self._options.clobber_old_results: … … 690 675 691 676 self._port.setup_test_run() 692 693 self._printer.write_update("Preparing tests ...") 694 result_summary = self.prepare_lists_and_print_output() 695 if not result_summary: 696 return None 697 698 return result_summary 677 return True 699 678 700 679 def run(self, args): … … 702 681 self._printer.write_update("Collecting tests ...") 703 682 try: 704 self._collect_tests(args) 705 except IOError as e: 706 # This is raised when the --test-list doesn't exist. 707 return -1 708 709 self._printer.write_update("Checking build ...") 710 if not self._port.check_build(self.needs_servers()): 711 _log.error("Build check failed") 683 self._paths, self._test_names = self._collect_tests(args) 684 except IOError as exception: 685 # This is raised if --test-list doesn't exist 712 686 return -1 713 687 … … 715 689 self._expectations = test_expectations.TestExpectations(self._port, self._test_names) 716 690 717 result_summary = self._set_up_run() 718 if not result_summary: 691 num_all_test_files_found = len(self._test_names) 692 result_summary = self._prepare_lists() 693 694 # Check to make sure we're not skipping every test. 695 if not self._test_names: 696 _log.critical('No tests to run.') 719 697 return -1 720 698 721 assert(self._test_names) 699 self._printer.print_found(num_all_test_files_found, len(self._test_names), self._options.repeat_each, self._options.iterations) 700 self._printer.print_expected(result_summary, self._expectations.get_tests_with_result_type) 701 702 if not self._set_up_run(): 703 return -1 722 704 723 705 start_time = time.time()
Note:
See TracChangeset
for help on using the changeset viewer.