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

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

Issue 888043002: Use a python script to configure unit tests and app tests to run. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Follow review Created 5 years, 10 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/data/unittests ('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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 118
119 @property 119 @property
120 def sanitizer(self): 120 def sanitizer(self):
121 """Sanitizer to use, if any.""" 121 """Sanitizer to use, if any."""
122 return self.values["sanitizer"] 122 return self.values["sanitizer"]
123 123
124 @property 124 @property
125 def test_types(self): 125 def test_types(self):
126 """List of test types to run.""" 126 """List of test types to run."""
127 return self.values.get("test_types", [Config.TEST_TYPE_DEFAULT]) 127 return self.values.get("test_types", [Config.TEST_TYPE_DEFAULT])
128
129 # Utility methods ------------------------------------------------------------
130
131 def match_target_os(self, selector):
132 """Returns whether the current config matches the target os selector.
133
134 |selector| is a list of strings. Each string is either:
135 * : matches everything.
136 target_os : matches the given target os.
137 !* : rejects everything
138 !target_os : rejects the given target os.
139
140 The last matching selector is considered. If no selector match, the config
141 matches.
142 """
143 for match in reversed(selector):
144 invert = match[0] == "!"
145 if invert:
146 match = match[1:]
147 if match == "*" or self.target_os == match:
148 return not invert
149 return True
OLDNEW
« no previous file with comments | « mojo/tools/data/unittests ('k') | mojo/tools/test_runner.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698