| 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 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 336 | 336 |
| 337 return test_run_results.OK_EXIT_STATUS if result else test_run_results.U
NEXPECTED_ERROR_EXIT_STATUS | 337 return test_run_results.OK_EXIT_STATUS if result else test_run_results.U
NEXPECTED_ERROR_EXIT_STATUS |
| 338 | 338 |
| 339 def _check_driver(self): | 339 def _check_driver(self): |
| 340 driver_path = self._path_to_driver() | 340 driver_path = self._path_to_driver() |
| 341 if not self._filesystem.exists(driver_path): | 341 if not self._filesystem.exists(driver_path): |
| 342 _log.error("%s was not found at %s", self.driver_name(), driver_path
) | 342 _log.error("%s was not found at %s", self.driver_name(), driver_path
) |
| 343 return False | 343 return False |
| 344 return True | 344 return True |
| 345 | 345 |
| 346 def _check_port_build(self): | |
| 347 # Ports can override this method to do additional checks. | |
| 348 return True | |
| 349 | |
| 350 def check_sys_deps(self, needs_http): | 346 def check_sys_deps(self, needs_http): |
| 351 """Checks whether the system is properly configured. | 347 """Checks whether the system is properly configured. |
| 352 | 348 |
| 353 If the port needs to do some runtime checks to ensure that the | 349 If the port needs to do some runtime checks to ensure that the |
| 354 tests can be run successfully, it should override this routine. | 350 tests can be run successfully, it should override this routine. |
| 355 This step can be skipped with --nocheck-sys-deps. | 351 This step can be skipped with --nocheck-sys-deps. |
| 356 | 352 |
| 357 Returns: | 353 Returns: |
| 358 An exit status code. | 354 An exit status code. |
| 359 """ | 355 """ |
| (...skipping 895 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1255 def _generate_all_test_configurations(self): | 1251 def _generate_all_test_configurations(self): |
| 1256 """Returns a sequence of the TestConfigurations the port supports.""" | 1252 """Returns a sequence of the TestConfigurations the port supports.""" |
| 1257 # By default, we assume we want to test every graphics type in | 1253 # By default, we assume we want to test every graphics type in |
| 1258 # every configuration on every system. | 1254 # every configuration on every system. |
| 1259 test_configurations = [] | 1255 test_configurations = [] |
| 1260 for version, architecture in self.ALL_SYSTEMS: | 1256 for version, architecture in self.ALL_SYSTEMS: |
| 1261 for build_type in self.ALL_BUILD_TYPES: | 1257 for build_type in self.ALL_BUILD_TYPES: |
| 1262 test_configurations.append(TestConfiguration(version, architectu
re, build_type)) | 1258 test_configurations.append(TestConfiguration(version, architectu
re, build_type)) |
| 1263 return test_configurations | 1259 return test_configurations |
| 1264 | 1260 |
| 1265 def warn_if_bug_missing_in_test_expectations(self): | |
| 1266 return True | |
| 1267 | |
| 1268 def _flag_specific_expectations_files(self): | 1261 def _flag_specific_expectations_files(self): |
| 1269 return [self._filesystem.join(self.layout_tests_dir(), 'FlagExpectations
', flag.lstrip('-')) | 1262 return [self._filesystem.join(self.layout_tests_dir(), 'FlagExpectations
', flag.lstrip('-')) |
| 1270 for flag in self.get_option('additional_driver_flag', [])] | 1263 for flag in self.get_option('additional_driver_flag', [])] |
| 1271 | 1264 |
| 1272 def _flag_specific_baseline_search_path(self): | 1265 def _flag_specific_baseline_search_path(self): |
| 1273 flag_dirs = [self._filesystem.join(self.layout_tests_dir(), 'flag-specif
ic', flag.lstrip('-')) | 1266 flag_dirs = [self._filesystem.join(self.layout_tests_dir(), 'flag-specif
ic', flag.lstrip('-')) |
| 1274 for flag in self.get_option('additional_driver_flag', [])] | 1267 for flag in self.get_option('additional_driver_flag', [])] |
| 1275 return [self._filesystem.join(flag_dir, 'platform', platform_dir) | 1268 return [self._filesystem.join(flag_dir, 'platform', platform_dir) |
| 1276 for platform_dir in self.FALLBACK_PATHS[self.version()] | 1269 for platform_dir in self.FALLBACK_PATHS[self.version()] |
| 1277 for flag_dir in flag_dirs] + flag_dirs | 1270 for flag_dir in flag_dirs] + flag_dirs |
| (...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1643 _log.warning('You are running the %s binary. However the %s bina
ry appears to be more recent. ' | 1636 _log.warning('You are running the %s binary. However the %s bina
ry appears to be more recent. ' |
| 1644 'Please pass --%s.', target, most_recent_binary, mo
st_recent_binary.lower()) | 1637 'Please pass --%s.', target, most_recent_binary, mo
st_recent_binary.lower()) |
| 1645 _log.warning('') | 1638 _log.warning('') |
| 1646 # This will fail if we don't have both a debug and release binary. | 1639 # This will fail if we don't have both a debug and release binary. |
| 1647 # That's fine because, in this case, we must already be running the | 1640 # That's fine because, in this case, we must already be running the |
| 1648 # most up-to-date one. | 1641 # most up-to-date one. |
| 1649 except OSError: | 1642 except OSError: |
| 1650 pass | 1643 pass |
| 1651 return True | 1644 return True |
| 1652 | 1645 |
| 1653 def _chromium_baseline_path(self, platform): | |
| 1654 if platform is None: | |
| 1655 platform = self.name() | |
| 1656 return self.path_from_webkit_base('LayoutTests', 'platform', platform) | |
| 1657 | |
| 1658 | 1646 |
| 1659 class VirtualTestSuite(object): | 1647 class VirtualTestSuite(object): |
| 1660 | 1648 |
| 1661 def __init__(self, prefix=None, base=None, args=None, references_use_default
_args=False): | 1649 def __init__(self, prefix=None, base=None, args=None, references_use_default
_args=False): |
| 1662 assert base | 1650 assert base |
| 1663 assert args | 1651 assert args |
| 1664 assert '/' not in prefix, "Virtual test suites prefixes cannot contain /
's: %s" % prefix | 1652 assert '/' not in prefix, "Virtual test suites prefixes cannot contain /
's: %s" % prefix |
| 1665 self.name = 'virtual/' + prefix + '/' + base | 1653 self.name = 'virtual/' + prefix + '/' + base |
| 1666 self.base = base | 1654 self.base = base |
| 1667 self.args = args | 1655 self.args = args |
| 1668 self.reference_args = [] if references_use_default_args else args | 1656 self.reference_args = [] if references_use_default_args else args |
| 1669 self.tests = {} | 1657 self.tests = {} |
| 1670 | 1658 |
| 1671 def __repr__(self): | 1659 def __repr__(self): |
| 1672 return "VirtualTestSuite('%s', '%s', %s, %s)" % (self.name, self.base, s
elf.args, self.reference_args) | 1660 return "VirtualTestSuite('%s', '%s', %s, %s)" % (self.name, self.base, s
elf.args, self.reference_args) |
| 1673 | 1661 |
| 1674 | 1662 |
| 1675 class PhysicalTestSuite(object): | 1663 class PhysicalTestSuite(object): |
| 1676 | 1664 |
| 1677 def __init__(self, base, args, reference_args=None): | 1665 def __init__(self, base, args, reference_args=None): |
| 1678 self.name = base | 1666 self.name = base |
| 1679 self.base = base | 1667 self.base = base |
| 1680 self.args = args | 1668 self.args = args |
| 1681 self.reference_args = args if reference_args is None else reference_args | 1669 self.reference_args = args if reference_args is None else reference_args |
| 1682 self.tests = set() | 1670 self.tests = set() |
| 1683 | 1671 |
| 1684 def __repr__(self): | 1672 def __repr__(self): |
| 1685 return "PhysicalTestSuite('%s', '%s', %s, %s)" % (self.name, self.base,
self.args, self.reference_args) | 1673 return "PhysicalTestSuite('%s', '%s', %s, %s)" % (self.name, self.base,
self.args, self.reference_args) |
| OLD | NEW |