Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(57)

Side by Side Diff: third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/base.py

Issue 2795793003: Make run-webkit-tests work with virtual parent LayoutTest directories (Closed)
Patch Set: fix test for win_chromium_rel_ng Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/base_unittest.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 20 matching lines...) Expand all
31 The Port classes encapsulate Port-specific (platform-specific) behavior 31 The Port classes encapsulate Port-specific (platform-specific) behavior
32 in the layout test infrastructure. 32 in the layout test infrastructure.
33 """ 33 """
34 34
35 import collections 35 import collections
36 import errno 36 import errno
37 import functools 37 import functools
38 import json 38 import json
39 import logging 39 import logging
40 import optparse 40 import optparse
41 import os
41 import re 42 import re
42 import sys 43 import sys
43 44
44 from webkitpy.common import find_files 45 from webkitpy.common import find_files
45 from webkitpy.common import read_checksum_from_png 46 from webkitpy.common import read_checksum_from_png
46 from webkitpy.common.memoized import memoized 47 from webkitpy.common.memoized import memoized
47 from webkitpy.common.system.executive import ScriptError 48 from webkitpy.common.system.executive import ScriptError
48 from webkitpy.common.system.path import cygpath, abspath_to_uri 49 from webkitpy.common.system.path import cygpath, abspath_to_uri
49 from webkitpy.common.webkit_finder import WebKitFinder 50 from webkitpy.common.webkit_finder import WebKitFinder
50 from webkitpy.layout_tests.layout_package.bot_test_expectations import BotTestEx pectationsFactory 51 from webkitpy.layout_tests.layout_package.bot_test_expectations import BotTestEx pectationsFactory
(...skipping 1448 matching lines...) Expand 10 before | Expand all | Expand 10 after
1499 def _all_virtual_tests(self, suites): 1500 def _all_virtual_tests(self, suites):
1500 tests = [] 1501 tests = []
1501 for suite in suites: 1502 for suite in suites:
1502 self._populate_virtual_suite(suite) 1503 self._populate_virtual_suite(suite)
1503 tests.extend(suite.tests.keys()) 1504 tests.extend(suite.tests.keys())
1504 return tests 1505 return tests
1505 1506
1506 def _virtual_tests_matching_paths(self, paths, suites): 1507 def _virtual_tests_matching_paths(self, paths, suites):
1507 tests = [] 1508 tests = []
1508 for suite in suites: 1509 for suite in suites:
1509 if any(p.startswith(suite.name) for p in paths): 1510 if any(p.startswith(suite.name) for p in paths) or any(suite.name.st artswith(os.path.join(p, '')) for p in paths):
1510 self._populate_virtual_suite(suite) 1511 self._populate_virtual_suite(suite)
1511 for test in suite.tests: 1512 for test in suite.tests:
1512 if any(test.startswith(p) for p in paths): 1513 if any(test.startswith(p) for p in paths):
1513 tests.append(test) 1514 tests.append(test)
1514 return tests 1515 return tests
1515 1516
1516 def _populate_virtual_suite(self, suite): 1517 def _populate_virtual_suite(self, suite):
1517 if not suite.tests: 1518 if not suite.tests:
1518 base_tests = self.real_tests([suite.base]) 1519 base_tests = self.real_tests([suite.base])
1519 suite.tests = {} 1520 suite.tests = {}
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
1639 1640
1640 def __init__(self, base, args, reference_args=None): 1641 def __init__(self, base, args, reference_args=None):
1641 self.name = base 1642 self.name = base
1642 self.base = base 1643 self.base = base
1643 self.args = args 1644 self.args = args
1644 self.reference_args = args if reference_args is None else reference_args 1645 self.reference_args = args if reference_args is None else reference_args
1645 self.tests = set() 1646 self.tests = set()
1646 1647
1647 def __repr__(self): 1648 def __repr__(self):
1648 return "PhysicalTestSuite('%s', '%s', %s, %s)" % (self.name, self.base, self.args, self.reference_args) 1649 return "PhysicalTestSuite('%s', '%s', %s, %s)" % (self.name, self.base, self.args, self.reference_args)
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/base_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698