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

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

Issue 1939843002: Replace webkitpy standalone builders functions with instantiable class. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Moved builders out of port, updated comment Created 4 years, 7 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
(Empty)
1 # Copyright (C) 2011 Google Inc. All rights reserved.
2 #
3 # Redistribution and use in source and binary forms, with or without
4 # modification, are permitted provided that the following conditions are
5 # met:
6 #
7 # * Redistributions of source code must retain the above copyright
8 # notice, this list of conditions and the following disclaimer.
9 # * Redistributions in binary form must reproduce the above
10 # copyright notice, this list of conditions and the following disclaimer
11 # in the documentation and/or other materials provided with the
12 # distribution.
13 # * Neither the name of Google Inc. nor the names of its
14 # contributors may be used to endorse or promote products derived from
15 # this software without specific prior written permission.
16 #
17 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20 # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21 # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28
29 import re
30
31 # In this dictionary, each item stores:
32 # * port_name -- a fully qualified port name
33 # * rebaseline_override_dir -- (optional) directory to put baselines in instead of where you would normally put them.
34 # This is useful when we don't have bots that cover particular configuratio ns; so, e.g., you might
35 # support mac-mountainlion but not have a mac-mountainlion bot yet, so you' d want to put the mac-lion
36 # results into platform/mac temporarily.
37 # * specifiers -- TestExpectation specifiers for that config. Valid values are f ound in
38 # TestExpectationsParser._configuration_tokens_list
39
40 _exact_matches = {
41 "WebKit Win7": {"port_name": "win-win7", "specifiers": ['Win7', 'Release']},
42 "WebKit Win7 (dbg)": {"port_name": "win-win7", "specifiers": ['Win7', 'Debug ']},
43 "WebKit Win10": {"port_name": "win-win10", "specifiers": ['Win10', 'Release' ]},
44 # FIXME: Rename this to 'WebKit Linux Precise'
45 "WebKit Linux": {"port_name": "linux-precise", "specifiers": ['Precise', 'Re lease']},
46 "WebKit Linux Trusty": {"port_name": "linux-trusty", "specifiers": ['Trusty' , 'Release']},
47 "WebKit Linux (dbg)": {"port_name": "linux-precise", "specifiers": ['Precise ', 'Debug']},
48 "WebKit Mac10.9": {"port_name": "mac-mac10.9", "specifiers": ['Mac10.9', 'Re lease']},
49 "WebKit Mac10.10": {"port_name": "mac-mac10.10", "specifiers": ['Mac10.10', 'Release']},
50 "WebKit Mac10.11": {"port_name": "mac-mac10.11", "specifiers": ['10.11', 'Re lease']},
51 "WebKit Mac10.11 (dbg)": {"port_name": "mac-mac10.11", "specifiers": ['10.11 ', 'Debug']},
52 "WebKit Mac10.11 (retina)": {"port_name": "mac-retina", "specifiers": ['Reti na', 'Release']},
53 "WebKit Android (Nexus4)": {"port_name": "android", "specifiers": ['Android' , 'Release']},
54 }
55
56
57 _ports_without_builders = [
58 ]
59
60
61 def builder_path_from_name(builder_name):
62 return re.sub(r'[\s().]', '_', builder_name)
63
64
65 def all_builder_names():
66 return sorted(set(_exact_matches.keys()))
67
68
69 def all_port_names():
70 return sorted(set(map(lambda x: x["port_name"], _exact_matches.values()) + _ ports_without_builders))
71
72
73 def rebaseline_override_dir(builder_name):
74 return _exact_matches[builder_name].get("rebaseline_override_dir", None)
75
76
77 def port_name_for_builder_name(builder_name):
78 return _exact_matches[builder_name]["port_name"]
79
80
81 def specifiers_for_builder(builder_name):
82 return _exact_matches[builder_name]["specifiers"]
83
84
85 def builder_name_for_port_name(target_port_name):
86 debug_builder_name = None
87 for builder_name, builder_info in _exact_matches.items():
88 if builder_info['port_name'] == target_port_name:
89 if 'dbg' in builder_name:
90 debug_builder_name = builder_name
91 else:
92 return builder_name
93 return debug_builder_name
94
95
96 def builder_path_for_port_name(port_name):
97 builder_path_from_name(builder_name_for_port_name(port_name))
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698