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

Unified Diff: mojo/tools/mopy/config.py

Issue 761573002: Make mojob.py use mopy.config.Config. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: delete _GetIsClang Created 6 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/tools/mojob.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/tools/mopy/config.py
diff --git a/mojo/tools/mopy/config.py b/mojo/tools/mopy/config.py
index 2ecb0cab745389ef63e5fbd53f8314a943f75896..37e0f6e643149ec79d8cc21614671d55fefa1c76 100644
--- a/mojo/tools/mopy/config.py
+++ b/mojo/tools/mopy/config.py
@@ -26,27 +26,32 @@ class Config(object):
build/test configuration. The dictionary is accessible through the values
member."""
- # Valid values for target_os:
+ # Valid values for target_os (None is also valid):
OS_ANDROID = "android"
OS_CHROMEOS = "chromeos"
OS_LINUX = "linux"
OS_MAC = "mac"
OS_WINDOWS = "windows"
- # TODO(vtl): Add clang vs gcc.
- # TODO(vtl): Add ASan/TSan/etc.
+ # Valid values for sanitizer (None is also valid):
+ SANITIZER_ASAN = "asan"
- def __init__(self, target_os=None, is_debug=True, **kwargs):
+ def __init__(self, target_os=None, is_debug=True, is_clang=None,
+ sanitizer=None, **kwargs):
"""Constructs a Config with key-value pairs specified via keyword arguments.
If target_os is not specified, it will be set to the host OS."""
assert target_os in (None, Config.OS_ANDROID, Config.OS_CHROMEOS,
Config.OS_LINUX, Config.OS_MAC, Config.OS_WINDOWS)
assert isinstance(is_debug, bool)
+ assert is_clang is None or isinstance(is_clang, bool)
+ assert sanitizer in (None, Config.SANITIZER_ASAN)
self.values = {}
self.values["target_os"] = _GetHostOS() if target_os is None else target_os
self.values["is_debug"] = is_debug
+ self.values["is_clang"] = is_clang
+ self.values["sanitizer"] = sanitizer
self.values.update(kwargs)
@@ -60,4 +65,14 @@ class Config(object):
@property
def is_debug(self):
"""Is Debug build?"""
- return self.values.get("is_debug")
+ return self.values["is_debug"]
+
+ @property
+ def is_clang(self):
+ """Should use clang?"""
+ return self.values["is_clang"]
+
+ @property
+ def sanitizer(self):
+ """Sanitizer to use, if any."""
+ return self.values["sanitizer"]
« no previous file with comments | « mojo/tools/mojob.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698