1 # Copyright (C) 2011 Google Inc. All rights reserved.
3 # Redistribution and use in source and binary forms, with or without
4 # modification, are permitted provided that the following conditions are
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
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.
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.
31 from webkitpy.common.memoized import memoized
34 # In this dictionary, each item stores:
35 # * port_name -- a fully qualified port name
36 # * rebaseline_override_dir -- (optional) directory to put baselines in instead of where you would normally put them.
37 # This is useful when we don't have bots that cover particular configurations; so, e.g., you might
38 # support mac-mountainlion but not have a mac-mountainlion bot yet, so you'd want to put the mac-lion
39 # results into platform/mac temporarily.
40 # * specifiers -- TestExpectation specifiers for that config. Valid values are found in
41 # TestExpectationsParser._configuration_tokens_list
44 "WebKit XP": {"port_name": "win-xp", "specifiers": ['XP', 'Release']},
45 "WebKit Win7": {"port_name": "win-win7", "specifiers": ['Win7', 'Release']},
46 "WebKit Win7 (dbg)": {"port_name": "win-win7", "specifiers": ['Win7', 'Debug']},
47 "WebKit Linux": {"port_name": "linux-x86_64", "specifiers": ['Linux', 'Release']},
48 "WebKit Linux 32": {"port_name": "linux-x86", "specifiers": ['Linux', 'Release']},
49 "WebKit Linux (dbg)": {"port_name": "linux-x86_64", "specifiers": ['Linux', 'Debug']},
50 "WebKit Mac10.6": {"port_name": "mac-snowleopard", "specifiers": ['SnowLeopard', 'Release']},
51 "WebKit Mac10.6 (dbg)": {"port_name": "mac-snowleopard", "specifiers": ['SnowLeopard', 'Debug']},
52 "WebKit Mac10.7": {"port_name": "mac-lion", "specifiers": ['Lion', 'Release']},
53 "WebKit Mac10.7 (dbg)": {"port_name": "mac-lion", "specifiers": ['Lion', 'Debug']},
54 "WebKit Mac10.8": {"port_name": "mac-mountainlion", "specifiers": ['MountainLion', 'Release']},
55 "WebKit Mac10.8 (retina)": {"port_name": "mac-retina", "specifiers": ['Retina', 'Release']},
56 "WebKit Mac10.9": {"port_name": "mac-mavericks", "specifiers": ['Mavericks', 'Release']},
57 "WebKit Android (Nexus4)": {"port_name": "android", "specifiers": ['Android', 'Release']},
61 # Mapping from port name to the deps builder of the same os:
63 "linux-x86": "WebKit Linux (deps)",
64 "linux-x86_64": "WebKit Linux (deps)",
65 "win-xp": "WebKit XP (deps)",
66 "win-win7": "WebKit XP (deps)",
67 "mac-snowleopard": "WebKit Mac10.6 (deps)",
68 # The following port names are mapped to 10.6 bot since we don't have bots
70 "mac-lion": "WebKit Mac10.6 (deps)",
71 "mac-mountainlion": "WebKit Mac10.6 (deps)",
72 "mac-mavericks": "WebKit Mac10.6 (deps)",
73 "mac-retina": "WebKit Mac10.6 (deps)",
77 _ports_without_builders = [
81 def builder_path_from_name(builder_name):
82 return re.sub(r'[\s().]', '_', builder_name)
85 def all_builder_names():
86 return sorted(set(_exact_matches.keys()))
90 return sorted(set(map(lambda x: x["port_name"], _exact_matches.values()) + _ports_without_builders))
93 def rebaseline_override_dir(builder_name):
94 return _exact_matches[builder_name].get("rebaseline_override_dir", None)
97 def port_name_for_builder_name(builder_name):
98 return _exact_matches[builder_name]["port_name"]
101 def specifiers_for_builder(builder_name):
102 return _exact_matches[builder_name]["specifiers"]
105 def builder_name_for_port_name(target_port_name):
106 debug_builder_name = None
107 for builder_name, builder_info in _exact_matches.items():
108 if builder_info['port_name'] == target_port_name:
109 if 'dbg' in builder_name:
110 debug_builder_name = builder_name
113 return debug_builder_name
116 def builder_path_for_port_name(port_name):
117 builder_path_from_name(builder_name_for_port_name(port_name))
120 def deps_builder_name_for_port_name(target_port_name):
121 return _deps_builders.get(target_port_name, None)