Raise an exception if we encountered an error.
This allows the caller to handle it if they wish. Test: Call with an error. Change-Id: Ia2e0d38e8e486a2b78e42d154654332e88909e9f
This commit is contained in:
@@ -130,8 +130,11 @@ class TestMapping(object):
|
|||||||
self.env = Env(path)
|
self.env = Env(path)
|
||||||
self.bazel = Bazel(self.env)
|
self.bazel = Bazel(self.env)
|
||||||
|
|
||||||
|
def is_setup(self):
|
||||||
|
return self.env.setup and self.bazel.setup
|
||||||
|
|
||||||
def create_test_mapping(self, path):
|
def create_test_mapping(self, path):
|
||||||
if self.env.setup == False or self.bazel.setup == False:
|
if not self.is_setup():
|
||||||
return
|
return
|
||||||
tests = self.get_tests(path)
|
tests = self.get_tests(path)
|
||||||
if not bool(tests):
|
if not bool(tests):
|
||||||
@@ -170,7 +173,10 @@ def main():
|
|||||||
path = sys.argv[1]
|
path = sys.argv[1]
|
||||||
else:
|
else:
|
||||||
path = None
|
path = None
|
||||||
TestMapping(path).create_test_mapping(None)
|
test_mapping = TestMapping(path)
|
||||||
|
test_mapping.create_test_mapping(None)
|
||||||
|
if not test_mapping.is_setup():
|
||||||
|
raise ValueError('Error getting crate tests.')
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
main()
|
main()
|
||||||
|
|||||||
Reference in New Issue
Block a user