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

Side by Side Diff: mojo/tools/mopy/config.py

Issue 881753002: Run App tests on Android. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Whitespace Created 5 years, 11 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 | « mojo/tools/get_test_list.py ('k') | mojo/tools/test_runner.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 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 """Build/test configurations, which are just dictionaries. This 5 """Build/test configurations, which are just dictionaries. This
6 "defines" the schema and provides some wrappers.""" 6 "defines" the schema and provides some wrappers."""
7 7
8 8
9 import json 9 import json
10 import os.path 10 import os.path
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 112
113 @property 113 @property
114 def sanitizer(self): 114 def sanitizer(self):
115 """Sanitizer to use, if any.""" 115 """Sanitizer to use, if any."""
116 return self.values["sanitizer"] 116 return self.values["sanitizer"]
117 117
118 @property 118 @property
119 def test_types(self): 119 def test_types(self):
120 """List of test types to run.""" 120 """List of test types to run."""
121 return self.values.get("test_types", [Config.TEST_TYPE_DEFAULT]) 121 return self.values.get("test_types", [Config.TEST_TYPE_DEFAULT])
122
123 # Utility methods ------------------------------------------------------------
124
125 def match_target_os(self, selector):
126 """Returns whether the current config matches the target os selector.
127
128 |selector| is a list of strings. Each string is either:
129 * : matches everything.
130 target_os : matches the given target os.
131 !* : rejects everything
132 !target_os : rejects the given target os.
133
134 The last matching selector is considered. If no selector match, the config
135 matches.
136 """
137 for match in reversed(selector):
138 invert = match[0] == "!"
139 if invert:
140 match = match[1:]
141 if match == "*" or self.target_os == match:
142 return not invert
143 return True
OLDNEW
« no previous file with comments | « mojo/tools/get_test_list.py ('k') | mojo/tools/test_runner.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698