| Index: scripts/slave/unittests/recipe_lint.py
|
| diff --git a/scripts/slave/unittests/recipe_lint.py b/scripts/slave/unittests/recipe_lint.py
|
| index ab8ca5dd58e8407877097338c73ab807c5255535..c787853b2ac2771874bc34c2210cb24c36921e50 100755
|
| --- a/scripts/slave/unittests/recipe_lint.py
|
| +++ b/scripts/slave/unittests/recipe_lint.py
|
| @@ -39,13 +39,13 @@ class TestFailure(Exception):
|
| pass
|
|
|
|
|
| -def ImportsTest(recipe_path, recipe_name):
|
| +def ImportsTest(recipe_path, recipe_name, universe):
|
| """Tests that recipe_name only uses allowed imports.
|
|
|
| Returns a list of errors, or an empty list if there are no errors (duh).
|
| """
|
|
|
| - recipe = recipe_loader.load_recipe(recipe_name)
|
| + recipe = universe.load_recipe(recipe_name)
|
| for attr in dir(recipe):
|
| val = getattr(recipe, attr)
|
| if isinstance(val, types.ModuleType):
|
| @@ -60,9 +60,11 @@ def ImportsTest(recipe_path, recipe_name):
|
|
|
|
|
| def MainTest():
|
| + universe = recipe_loader.RecipeUniverse()
|
| +
|
| errors = []
|
| for recipe_path, recipe_name in recipe_loader.loop_over_recipes():
|
| - errors.extend(ImportsTest(recipe_path, recipe_name))
|
| + errors.extend(ImportsTest(recipe_path, recipe_name, universe))
|
|
|
| if errors:
|
| raise TestFailure('\n'.join(map(str, errors)))
|
|
|