OLD | NEW |
1 # Copyright (C) 2010 Google Inc. All rights reserved. | 1 # Copyright (C) 2010 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 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 | 178 |
179 def pretty_patch_available(self): | 179 def pretty_patch_available(self): |
180 if self._pretty_patch_available is None: | 180 if self._pretty_patch_available is None: |
181 self._pretty_patch_available = self.check_pretty_patch(logging=False
) | 181 self._pretty_patch_available = self.check_pretty_patch(logging=False
) |
182 return self._pretty_patch_available | 182 return self._pretty_patch_available |
183 | 183 |
184 def should_retry_crashes(self): | 184 def should_retry_crashes(self): |
185 return self.get_option('retry_crashes', False) | 185 return self.get_option('retry_crashes', False) |
186 | 186 |
187 def default_child_processes(self): | 187 def default_child_processes(self): |
188 """Return the number of DumpRenderTree instances to use for this port.""
" | 188 """Return the number of drivers to use for this port.""" |
189 return self._executive.cpu_count() | 189 return self._executive.cpu_count() |
190 | 190 |
191 def default_max_locked_shards(self): | 191 def default_max_locked_shards(self): |
192 """Return the number of "locked" shards to run in parallel (like the htt
p tests).""" | 192 """Return the number of "locked" shards to run in parallel (like the htt
p tests).""" |
193 return 1 | 193 return 1 |
194 | 194 |
195 def worker_startup_delay_secs(self): | 195 def worker_startup_delay_secs(self): |
196 # FIXME: If we start workers up too quickly, DumpRenderTree appears | 196 # FIXME: If we start workers up too quickly, DumpRenderTree appears |
197 # to thrash on something and time out its first few tests. Until | 197 # to thrash on something and time out its first few tests. Until |
198 # we can figure out what's going on, sleep a bit in between | 198 # we can figure out what's going on, sleep a bit in between |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
373 actual_filename = to_raw_bytes(actual_filename) | 373 actual_filename = to_raw_bytes(actual_filename) |
374 diff = difflib.unified_diff(expected_text.splitlines(True), | 374 diff = difflib.unified_diff(expected_text.splitlines(True), |
375 actual_text.splitlines(True), | 375 actual_text.splitlines(True), |
376 expected_filename, | 376 expected_filename, |
377 actual_filename) | 377 actual_filename) |
378 return ''.join(diff) | 378 return ''.join(diff) |
379 | 379 |
380 def driver_name(self): | 380 def driver_name(self): |
381 if self.get_option('driver_name'): | 381 if self.get_option('driver_name'): |
382 return self.get_option('driver_name') | 382 return self.get_option('driver_name') |
383 if self.get_option('dump_render_tree'): | |
384 return 'DumpRenderTree' | |
385 return self.CONTENT_SHELL_NAME | 383 return self.CONTENT_SHELL_NAME |
386 | 384 |
387 def expected_baselines_by_extension(self, test_name): | 385 def expected_baselines_by_extension(self, test_name): |
388 """Returns a dict mapping baseline suffix to relative path for each base
line in | 386 """Returns a dict mapping baseline suffix to relative path for each base
line in |
389 a test. For reftests, it returns ".==" or ".!=" instead of the suffix.""
" | 387 a test. For reftests, it returns ".==" or ".!=" instead of the suffix.""
" |
390 # FIXME: The name similarity between this and expected_baselines() below
, is unfortunate. | 388 # FIXME: The name similarity between this and expected_baselines() below
, is unfortunate. |
391 # We should probably rename them both. | 389 # We should probably rename them both. |
392 baseline_dict = {} | 390 baseline_dict = {} |
393 reference_files = self.reference_files(test_name) | 391 reference_files = self.reference_files(test_name) |
394 if reference_files: | 392 if reference_files: |
(...skipping 819 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1214 | 1212 |
1215 def _build_path(self, *comps): | 1213 def _build_path(self, *comps): |
1216 build_directory = self.get_option('build_directory') | 1214 build_directory = self.get_option('build_directory') |
1217 if build_directory: | 1215 if build_directory: |
1218 root_directory = self._filesystem.join(build_directory, self.get_opt
ion('configuration')) | 1216 root_directory = self._filesystem.join(build_directory, self.get_opt
ion('configuration')) |
1219 else: | 1217 else: |
1220 root_directory = self._config.build_directory(self.get_option('confi
guration')) | 1218 root_directory = self._config.build_directory(self.get_option('confi
guration')) |
1221 return self._filesystem.join(self._filesystem.abspath(root_directory), *
comps) | 1219 return self._filesystem.join(self._filesystem.abspath(root_directory), *
comps) |
1222 | 1220 |
1223 def _path_to_driver(self, configuration=None): | 1221 def _path_to_driver(self, configuration=None): |
1224 """Returns the full path to the test driver (DumpRenderTree).""" | 1222 """Returns the full path to the test driver.""" |
1225 return self._build_path(self.driver_name()) | 1223 return self._build_path(self.driver_name()) |
1226 | 1224 |
1227 def _path_to_webcore_library(self): | 1225 def _path_to_webcore_library(self): |
1228 """Returns the full path to a built copy of WebCore.""" | 1226 """Returns the full path to a built copy of WebCore.""" |
1229 return None | 1227 return None |
1230 | 1228 |
1231 def _path_to_helper(self): | 1229 def _path_to_helper(self): |
1232 """Returns the full path to the layout_test_helper binary, which | 1230 """Returns the full path to the layout_test_helper binary, which |
1233 is used to help configure the system for the test run, or None | 1231 is used to help configure the system for the test run, or None |
1234 if no helper is needed. | 1232 if no helper is needed. |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1402 | 1400 |
1403 class VirtualTestSuite(object): | 1401 class VirtualTestSuite(object): |
1404 def __init__(self, name, base, args, tests=None): | 1402 def __init__(self, name, base, args, tests=None): |
1405 self.name = name | 1403 self.name = name |
1406 self.base = base | 1404 self.base = base |
1407 self.args = args | 1405 self.args = args |
1408 self.tests = tests or set() | 1406 self.tests = tests or set() |
1409 | 1407 |
1410 def __repr__(self): | 1408 def __repr__(self): |
1411 return "VirtualTestSuite('%s', '%s', %s)" % (self.name, self.base, self.
args) | 1409 return "VirtualTestSuite('%s', '%s', %s)" % (self.name, self.base, self.
args) |
OLD | NEW |