Changeset 82972 in webkit
- Timestamp:
- Apr 5, 2011 1:03:18 PM (13 years ago)
- Location:
- trunk/Tools
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r82967 r82972 1 2011-04-05 Mihai Parparita <mihaip@chromium.org> 2 3 Reviewed by Tony Chang. 4 5 Add --baseline-search-path to NRWT 6 https://bugs.webkit.org/show_bug.cgi?id=56233 7 8 Add NRWT option to specify additional directories to look for baselines 9 (will be used by hardware GPU bots which will have local per-bot 10 expectations for some tests) 11 12 * Scripts/webkitpy/common/system/filesystem_mock.py: 13 * Scripts/webkitpy/layout_tests/port/base.py: 14 * Scripts/webkitpy/layout_tests/port/base_unittest.py: 15 * Scripts/webkitpy/layout_tests/run_webkit_tests.py: 16 1 17 2011-04-05 Adam Roben <aroben@apple.com> 2 18 -
trunk/Tools/Scripts/webkitpy/common/system/filesystem_mock.py
r82279 r82972 217 217 218 218 def normpath(self, path): 219 return path 219 # Like join(), relies on os.path functionality but normalizes the 220 # path separator to the mock one. 221 return re.sub(re.escape(os.path.sep), self.sep, os.path.normpath(path)) 220 222 221 223 def open_binary_tempfile(self, suffix=''): -
trunk/Tools/Scripts/webkitpy/layout_tests/port/base.py
r82705 r82972 283 283 baseline_filename = testname + '-expected' + suffix 284 284 285 baseline_search_path = self. baseline_search_path()285 baseline_search_path = self.get_option('baseline_search_path', []) + self.baseline_search_path() 286 286 287 287 baselines = [] -
trunk/Tools/Scripts/webkitpy/layout_tests/port/base_unittest.py
r82705 r82972 34 34 from webkitpy.common.system.executive import Executive, ScriptError 35 35 from webkitpy.common.system import executive_mock 36 from webkitpy.common.system import filesystem36 from webkitpy.common.system.filesystem_mock import MockFileSystem 37 37 from webkitpy.common.system import outputcapture 38 38 from webkitpy.common.system.path import abspath_to_uri … … 233 233 self.assertEqual(port.name(), 'foo') 234 234 235 def test_baseline_search_path(self): 236 filesystem = MockFileSystem() 237 options, args = optparse.OptionParser().parse_args([]) 238 port = base.Port(port_name='foo', filesystem=filesystem, options=options) 239 port.baseline_search_path = lambda: [] 240 layout_test_dir = port.layout_tests_dir() 241 test_file = filesystem.join(layout_test_dir, 'fast', 'test.html') 242 243 # No baseline search path 244 self.assertEqual( 245 port.expected_baselines(test_file, '.txt'), 246 [(None, 'fast/test-expected.txt')]) 247 248 # Simple search path 249 options.baseline_search_path = ['/tmp/local-baselines'] 250 filesystem.files = { 251 '/tmp/local-baselines/fast/test-expected.txt': 'foo', 252 } 253 self.assertEqual( 254 port.expected_baselines(test_file, '.txt'), 255 [('/tmp/local-baselines', 'fast/test-expected.txt')]) 256 257 # Multiple entries in search path 258 options.baseline_search_path = ['/foo', '/tmp/local-baselines'] 259 self.assertEqual( 260 port.expected_baselines(test_file, '.txt'), 261 [('/tmp/local-baselines', 'fast/test-expected.txt')]) 235 262 236 263 class VirtualTest(unittest.TestCase): -
trunk/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py
r82055 r82972 166 166 167 167 options.slow_time_out_ms = str(5 * int(options.time_out_ms)) 168 169 if options.baseline_search_path: 170 normalized_search_paths = [] 171 for path in options.baseline_search_path: 172 if not port_obj._filesystem.isabs(path): 173 warnings.append("--baseline-search-path=%s is ignored since it is not absolute" % path) 174 continue 175 normalized_search_paths.append(port_obj._filesystem.normpath(path)) 176 options.baseline_search_path = normalized_search_paths 177 168 178 return warnings 169 179 … … 289 299 default=False, help="Reset any existing baselines to the " 290 300 "generated results"), 301 optparse.make_option("--baseline-search-path", action="append", 302 default=[], help="Additional directory where to look for test " 303 "baselines (will take precendence over platform baselines). " 304 "Specify multiple times to add multiple search path entries."), 291 305 optparse.make_option("--no-show-results", action="store_false", 292 306 default=True, dest="show_results", -
trunk/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py
r82704 r82972 197 197 198 198 def test_child_process_1(self): 199 (res, buildbot_output, regular_output, user)= logging_run(199 res, buildbot_output, regular_output, user = logging_run( 200 200 ['--print', 'config', '--worker-model', 'threads', '--child-processes', '1']) 201 201 self.assertTrue('Running one DumpRenderTree\n' … … 203 203 204 204 def test_child_processes_2(self): 205 (res, buildbot_output, regular_output, user)= logging_run(205 res, buildbot_output, regular_output, user = logging_run( 206 206 ['--print', 'config', '--worker-model', 'threads', '--child-processes', '2']) 207 207 self.assertTrue('Running 2 DumpRenderTrees in parallel\n' … … 253 253 # We do a logging run here instead of a passing run in order to 254 254 # suppress the output from the json generator. 255 (res, buildbot_output, regular_output, user)= logging_run(['--clobber-old-results'], record_results=True, filesystem=fs)256 (res, buildbot_output, regular_output, user)= logging_run(255 res, buildbot_output, regular_output, user = logging_run(['--clobber-old-results'], record_results=True, filesystem=fs) 256 res, buildbot_output, regular_output, user = logging_run( 257 257 ['--print-last-failures'], filesystem=fs) 258 258 self.assertEqual(regular_output.get(), ['\n\n']) … … 372 372 def test_exit_after_n_failures_upload(self): 373 373 fs = port.unit_test_filesystem() 374 (res, buildbot_output, regular_output, user)= logging_run([374 res, buildbot_output, regular_output, user = logging_run([ 375 375 'failures/unexpected/text-image-checksum.html', 376 376 'passes/text.html', … … 572 572 include_reference_html=True) 573 573 self.assertEquals(['passes/mismatch.html', 'passes/mismatch-expected-mismatch.html'], tests_run) 574 575 def test_baseline_search_path(self): 576 self.assertTrue(passing_run(['--baseline-search-path', '/tmp/foo'])) 577 self.assertTrue(passing_run(['--baseline-search-path', '/tmp/../foo'])) 578 self.assertTrue(passing_run(['--baseline-search-path', '/tmp/foo', 579 '--baseline-search-path', '/tmp/bar'])) 580 581 res, buildbot_output, regular_output, user = logging_run( 582 ['--baseline-search-path', 'foo']) 583 self.assertTrue('--baseline-search-path=foo is ignored since it is not absolute\n' 584 in regular_output.get()) 574 585 575 586
Note: See TracChangeset
for help on using the changeset viewer.