[zorg] r323939 - When you can't find brew, issue a dependency error
Chris Matthews via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 31 17:21:23 PST 2018
Author: cmatthews
Date: Wed Jan 31 17:21:23 2018
New Revision: 323939
URL: http://llvm.org/viewvc/llvm-project?rev=323939&view=rev
Log:
When you can't find brew, issue a dependency error
If you ask for a brew dependency, and it can't be found. Issue a dependency error
because it is another way the dependency is not met.
Modified:
zorg/trunk/dep/dep.py
zorg/trunk/dep/tests/test_dep.py
Modified: zorg/trunk/dep/dep.py
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/dep/dep.py?rev=323939&r1=323938&r2=323939&view=diff
==============================================================================
--- zorg/trunk/dep/dep.py (original)
+++ zorg/trunk/dep/dep.py Wed Jan 31 17:21:23 2018
@@ -347,7 +347,10 @@ class Brew(Dependency):
def verify(self):
"""Verify the packages in brew match this dependency."""
- brew_package_config = brew_cmd(['/usr/local/bin/brew', 'info', self.package, "--json=v1"])
+ try:
+ brew_package_config = brew_cmd(['/usr/local/bin/brew', 'info', self.package, "--json=v1"])
+ except OSError:
+ raise MissingDependencyError(self, "Can't find brew command")
version = None
for brew_package in brew_package_config:
name = brew_package['name']
Modified: zorg/trunk/dep/tests/test_dep.py
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/dep/tests/test_dep.py?rev=323939&r1=323938&r2=323939&view=diff
==============================================================================
--- zorg/trunk/dep/tests/test_dep.py (original)
+++ zorg/trunk/dep/tests/test_dep.py Wed Jan 31 17:21:23 2018
@@ -42,6 +42,11 @@ def test_brew_cmake_requirement(mocker):
b.verify_and_act()
assert dep.brew_cmd.called
+ mocker.patch('dep.brew_cmd')
+ dep.brew_cmd.side_effect = OSError()
+ with pytest.raises(MissingDependencyError):
+ b.verify_and_act()
+
def test_brew_ninja_not_installed_requirement(mocker):
"""Detailed check of a unmatched brew requirement."""
More information about the llvm-commits
mailing list