Changeset 77606 in webkit
- Timestamp:
- Feb 3, 2011 10:26:26 PM (13 years ago)
- Location:
- trunk/Tools
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r77605 r77606 1 2011-02-03 Hayato Ito <hayato@chromium.org> 2 3 Reviewed by Eric Seidel. 4 5 [NRWT] Remove TestArgs class, which is wrongly used. 6 7 https://bugs.webkit.org/show_bug.cgi?id=53063 8 9 * Scripts/webkitpy/layout_tests/layout_package/dump_render_tree_thread.py: 10 * Scripts/webkitpy/layout_tests/layout_package/single_test_runner.py: 11 * Scripts/webkitpy/layout_tests/test_types/image_diff.py: 12 * Scripts/webkitpy/layout_tests/test_types/test_type_base.py: 13 * Scripts/webkitpy/layout_tests/test_types/test_type_base_unittest.py: 14 * Scripts/webkitpy/layout_tests/test_types/text_diff.py: 15 1 16 2011-02-03 Andrew Wason <rectalogic@rectalogic.com> 2 17 -
trunk/Tools/Scripts/webkitpy/layout_tests/layout_package/dump_render_tree_thread.py
r77603 r77606 83 83 84 84 def __init__(self, port, options, worker_number, worker_name, 85 test_input, test_types , test_args):85 test_input, test_types): 86 86 """ 87 87 Args: … … 93 93 test_types: A list of TestType objects to run the test output 94 94 against. 95 test_args: A TestArguments object to pass to each TestType.96 95 """ 97 96 … … 101 100 self._test_input = test_input 102 101 self._test_types = test_types 103 self._test_args = test_args104 102 self._driver = None 105 103 self._worker_number = worker_number … … 116 114 self._test_result = single_test_runner.run_single_test( 117 115 self._port, self._options, self._test_input, self._driver, 118 self._name, self._test_type s, self._test_args)116 self._name, self._test_type) 119 117 self._driver.stop() 120 118 … … 195 193 self._test_types.append(cls(self._port, 196 194 self._options.results_directory)) 197 self._test_args = self._get_test_args(worker_number)198 195 199 196 # Current group of tests we're running. … … 203 200 # Time at which we started running tests from self._current_group. 204 201 self._current_group_start_time = None 205 206 def _get_test_args(self, worker_number):207 """Returns the tuple of arguments for tests and for DumpRenderTree."""208 test_args = test_type_base.TestArguments()209 test_args.new_baseline = self._options.new_baseline210 test_args.reset_results = self._options.reset_results211 212 return test_args213 202 214 203 def _get_test_type_classes(self): … … 390 379 self._name, 391 380 test_input, 392 self._test_types, 393 self._test_args) 381 self._test_types) 394 382 395 383 worker.start() … … 436 424 test_result = single_test_runner.run_single_test( 437 425 self._port, self._options, test_input, self._driver, self._name, 438 self._test_types , self._test_args)426 self._test_types) 439 427 self._test_results.append(test_result) 440 428 return test_result -
trunk/Tools/Scripts/webkitpy/layout_tests/layout_package/single_test_runner.py
r77603 r77606 40 40 41 41 42 def run_single_test(port, options, test_input, driver, worker_name, test_types , test_args):42 def run_single_test(port, options, test_input, driver, worker_name, test_types): 43 43 # FIXME: Pull this into TestShellThread._run(). 44 runner = SingleTestRunner(options, port, driver, test_input, worker_name, test_types , test_args)44 runner = SingleTestRunner(options, port, driver, test_input, worker_name, test_types) 45 45 return runner.run() 46 46 … … 56 56 class SingleTestRunner: 57 57 58 def __init__(self, options, port, driver, test_input, worker_name, test_types , test_args):58 def __init__(self, options, port, driver, test_input, worker_name, test_types): 59 59 self._options = options 60 60 self._port = port … … 64 64 self._worker_name = worker_name 65 65 self._test_types = test_types 66 self._test_args = test_args67 66 self._testname = port.relative_test_filename(test_input.filename) 68 67 … … 124 123 for test_type in self._test_types: 125 124 start_diff_time = time.time() 126 new_failures = test_type.compare_output( self._port, self._filename,127 self._test_args, driver_output,128 125 new_failures = test_type.compare_output( 126 self._port, self._filename, self._options, driver_output, 127 expected_driver_output) 129 128 # Don't add any more failures if we already have a crash, so we don't 130 129 # double-report those tests. We do double-report for timeouts since -
trunk/Tools/Scripts/webkitpy/layout_tests/test_types/image_diff.py
r77603 r77606 86 86 return port.diff_image(actual_image, expected_image, diff_filename) 87 87 88 def compare_output(self, port, filename, test_args, actual_driver_output,88 def compare_output(self, port, filename, options, actual_driver_output, 89 89 expected_driver_output): 90 90 """Implementation of CompareOutput that checks the output image and … … 98 98 99 99 # If we're generating a new baseline, we pass. 100 if test_args.new_baseline or test_args.reset_results:100 if options.new_baseline or options.reset_results: 101 101 self._save_baseline_files(filename, actual_driver_output.image, 102 102 actual_driver_output.image_hash, 103 test_args.new_baseline)103 options.new_baseline) 104 104 return failures 105 105 -
trunk/Tools/Scripts/webkitpy/layout_tests/test_types/test_type_base.py
r77603 r77606 29 29 30 30 """Defines the interface TestTypeBase which other test types inherit from. 31 32 Also defines the TestArguments "struct" to pass them additional arguments.33 31 """ 34 32 … … 39 37 _log = logging.getLogger("webkitpy.layout_tests.test_types.test_type_base") 40 38 41 42 class TestArguments(object):43 """Struct-like wrapper for additional arguments needed by44 specific tests."""45 # Whether to save new baseline results.46 new_baseline = False47 48 # Path to the actual PNG file generated by pixel tests49 png_path = None50 51 # Value of checksum generated by pixel tests.52 hash = None53 54 # Whether to use wdiff to generate by-word diffs.55 wdiff = False56 39 57 40 # Python bug workaround. See the wdiff code in WriteOutputFiles for an … … 140 123 return fs.splitext(output_filename)[0] + modifier 141 124 142 def compare_output(self, port, filename, test_args, actual_driver_output,125 def compare_output(self, port, filename, options, actual_driver_output, 143 126 expected_driver_output): 144 127 """Method that compares the output from the test with the … … 150 133 port: object implementing port-specific information and methods 151 134 filename: absolute filename to test file 152 test_args: a TestArguments object holding optional additional 153 arguments 135 options: command line argument object from optparse 154 136 actual_driver_output: a DriverOutput object which represents actual test 155 137 output -
trunk/Tools/Scripts/webkitpy/layout_tests/test_types/test_type_base_unittest.py
r73256 r77606 41 41 self.assertRaises(NotImplementedError, test_type.compare_output, 42 42 None, "foo.txt", '', 43 test_type_base.TestArguments(), 'Debug')43 {}, 'Debug') 44 44 45 45 -
trunk/Tools/Scripts/webkitpy/layout_tests/test_types/text_diff.py
r77603 r77606 54 54 return output.replace("\r\r\n", "\r\n").replace("\r\n", "\n") 55 55 56 def compare_output(self, port, filename, test_args, actual_driver_output,56 def compare_output(self, port, filename, options, actual_driver_output, 57 57 expected_driver_output): 58 58 """Implementation of CompareOutput that checks the output text against … … 61 61 62 62 # If we're generating a new baseline, we pass. 63 if test_args.new_baseline or test_args.reset_results:63 if options.new_baseline or options.reset_results: 64 64 # Although all DumpRenderTree output should be utf-8, we do not 65 65 # ever decode it inside run-webkit-tests. For some tests … … 67 67 self._save_baseline_data(filename, actual_driver_output.text, 68 68 ".txt", encoding=None, 69 generate_new_baseline= test_args.new_baseline)69 generate_new_baseline=options.new_baseline) 70 70 return failures 71 71
Note: See TracChangeset
for help on using the changeset viewer.