diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2017-12-13 10:06:38 -0800 |
---|---|---|
committer | Dylan Baker <dylan@pnwbakers.com> | 2017-12-15 14:20:16 -0800 |
commit | 7cd41ee8fb868285e96ccc4071ee945a1c6c3dfa (patch) | |
tree | d91c0a4dc39dfe07d9100957637158759b133fd3 | |
parent | 2b2ee68f9058bea603da426ab7914023ad1842c8 (diff) | |
download | meson-7cd41ee8fb868285e96ccc4071ee945a1c6c3dfa.tar.gz |
Use consistent mlog formatting with the ConfigTool dependency helpers
This just adds more consistent use of mlog.bold and mlog.red/green for
ConfigTool based dependencies.
-rw-r--r-- | mesonbuild/dependencies/base.py | 11 | ||||
-rwxr-xr-x | run_unittests.py | 2 |
2 files changed, 7 insertions, 6 deletions
diff --git a/mesonbuild/dependencies/base.py b/mesonbuild/dependencies/base.py index 0ef33722f..46cce4339 100644 --- a/mesonbuild/dependencies/base.py +++ b/mesonbuild/dependencies/base.py @@ -284,17 +284,18 @@ class ConfigToolDependency(ExternalDependency): """Helper method to print messages about the tool.""" if self.config is None: if version is not None: - mlog.log('found {} {!r} but need:'.format(self.tool_name, version), - req_version) + mlog.log('Found', mlog.bold(self.tool_name), repr(version), + mlog.red('NO'), '(needed', req_version, ')') else: - mlog.log("No {} found; can't detect dependency".format(self.tool_name)) - mlog.log('Dependency {} found:'.format(self.name), mlog.red('NO')) + mlog.log('Found', mlog.bold(self.tool_name), repr(req_version), + mlog.red('NO')) + mlog.log('Dependency', mlog.bold(self.name), 'found:', mlog.red('NO')) if self.required: raise DependencyException('Dependency {} not found'.format(self.name)) return False mlog.log('Found {}:'.format(self.tool_name), mlog.bold(shutil.which(self.config)), '({})'.format(version)) - mlog.log('Dependency {} found:'.format(self.name), mlog.green('YES')) + mlog.log('Dependency', mlog.bold(self.name), 'found:', mlog.green('YES')) return True def get_config_value(self, args, stage): diff --git a/run_unittests.py b/run_unittests.py index f717e6dd1..d7d5ed08f 100755 --- a/run_unittests.py +++ b/run_unittests.py @@ -1741,7 +1741,7 @@ class FailureTests(BasePlatformTests): raise unittest.SkipTest('wx-config or wx-config-3.0 found') self.assertMesonRaises("dependency('wxwidgets')", self.dnf) self.assertMesonOutputs("dependency('wxwidgets', required : false)", - "No wx-config found;") + "Dependency .*WxWidgets.* found: .*NO.*") def test_wx_dependency(self): if not shutil.which('wx-config-3.0') and not shutil.which('wx-config'): |