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

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: update TOTAL_TESTS 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
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 1488 matching lines...) Expand 10 before | Expand all | Expand 10 after
1499 def _all_virtual_tests(self, suites): 1499 def _all_virtual_tests(self, suites):
1500 tests = [] 1500 tests = []
1501 for suite in suites: 1501 for suite in suites:
1502 self._populate_virtual_suite(suite) 1502 self._populate_virtual_suite(suite)
1503 tests.extend(suite.tests.keys()) 1503 tests.extend(suite.tests.keys())
1504 return tests 1504 return tests
1505 1505
1506 def _virtual_tests_matching_paths(self, paths, suites): 1506 def _virtual_tests_matching_paths(self, paths, suites):
1507 tests = [] 1507 tests = []
1508 for suite in suites: 1508 for suite in suites:
1509 if any(p.startswith(suite.name) for p in paths): 1509 if any(p.startswith(suite.name) for p in paths) or any(suite.name.st artswith(p) for p in paths):
qyearsley 2017/04/05 22:47:07 This is a bit difficult to think about without thi
Gleb Lanbin 2017/04/06 17:27:32 Acknowledged.
1510 self._populate_virtual_suite(suite) 1510 self._populate_virtual_suite(suite)
1511 for test in suite.tests: 1511 for test in suite.tests:
1512 if any(test.startswith(p) for p in paths): 1512 if any(test.startswith(p) for p in paths):
1513 tests.append(test) 1513 tests.append(test)
qyearsley 2017/04/05 22:47:07 I *think* that we might want to change this bit as
Gleb Lanbin 2017/04/06 17:27:32 Done.
1514 return tests 1514 return tests
1515 1515
1516 def _populate_virtual_suite(self, suite): 1516 def _populate_virtual_suite(self, suite):
1517 if not suite.tests: 1517 if not suite.tests:
1518 base_tests = self.real_tests([suite.base]) 1518 base_tests = self.real_tests([suite.base])
1519 suite.tests = {} 1519 suite.tests = {}
1520 for test in base_tests: 1520 for test in base_tests:
1521 suite.tests[test.replace(suite.base, suite.name, 1)] = test 1521 suite.tests[test.replace(suite.base, suite.name, 1)] = test
1522 1522
1523 def is_virtual_test(self, test_name): 1523 def is_virtual_test(self, test_name):
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
1639 1639
1640 def __init__(self, base, args, reference_args=None): 1640 def __init__(self, base, args, reference_args=None):
1641 self.name = base 1641 self.name = base
1642 self.base = base 1642 self.base = base
1643 self.args = args 1643 self.args = args
1644 self.reference_args = args if reference_args is None else reference_args 1644 self.reference_args = args if reference_args is None else reference_args
1645 self.tests = set() 1645 self.tests = set()
1646 1646
1647 def __repr__(self): 1647 def __repr__(self):
1648 return "PhysicalTestSuite('%s', '%s', %s, %s)" % (self.name, self.base, self.args, self.reference_args) 1648 return "PhysicalTestSuite('%s', '%s', %s, %s)" % (self.name, self.base, self.args, self.reference_args)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698