Improve debugging of missing elements.

Print the checked directory when cannot find an element.

Change-Id: I2c1f74e4975e66b6ec9d4122c02067bc2c473620
This commit is contained in:
Joe Gordon 2013-06-19 13:23:27 -07:00
parent 207aeced03
commit a98c0fe282
2 changed files with 6 additions and 1 deletions

View File

@ -50,7 +50,8 @@ def dependencies(element, elements_dir=None):
else: else:
raise raise
sys.stderr.write("ERROR: Element %s doesn't exists\n" % (element, )) sys.stderr.write("ERROR: Element '%s' not found in '%s'\n" %
(element, elements_dir))
exit(-1) exit(-1)

View File

@ -52,6 +52,10 @@ class TestElementDeps(TestCase):
elements_dir=self.element_dir) elements_dir=self.element_dir)
self.assertEquals(set(['requires-foo', 'foo']), result) self.assertEquals(set(['requires-foo', 'foo']), result)
def test_missing_deps(self):
self.assertRaises(SystemExit, expand_dependencies, ['fake'],
self.element_dir)
def test_transitive_deps(self): def test_transitive_deps(self):
result = expand_dependencies(['requires-requires-foo'], result = expand_dependencies(['requires-requires-foo'],
elements_dir=self.element_dir) elements_dir=self.element_dir)