| Index: scripts/slave/unittests/recipe_simulation_test.py
|
| diff --git a/scripts/slave/unittests/recipe_simulation_test.py b/scripts/slave/unittests/recipe_simulation_test.py
|
| index 5e82876977e62b3ec41207c82c0ed1bc5cb12f5c..c40422ad58111de87585e5f7242cc47da2fc7185 100755
|
| --- a/scripts/slave/unittests/recipe_simulation_test.py
|
| +++ b/scripts/slave/unittests/recipe_simulation_test.py
|
| @@ -55,10 +55,26 @@ def RunRecipe(test_data):
|
| return expect_tests.Result(ret)
|
|
|
|
|
| +def test_gen_coverage():
|
| + return (
|
| + [os.path.join(x, '*') for x in recipe_util.RECIPE_DIRS()] +
|
| + [os.path.join(x, '*', 'example.py') for x in recipe_util.MODULE_DIRS()] +
|
| + [os.path.join(x, '*', 'test_api.py') for x in recipe_util.MODULE_DIRS()]
|
| + )
|
| +
|
| +@expect_tests.covers(test_gen_coverage)
|
| def GenerateTests():
|
| + cover_mods = []
|
| + for mod_dir_base in recipe_util.MODULE_DIRS():
|
| + if os.path.isdir(mod_dir_base):
|
| + cover_mods.append(os.path.join(mod_dir_base, '*', '*api.py'))
|
| +
|
| for recipe_path, recipe_name in recipe_loader.loop_over_recipes():
|
| recipe = recipe_loader.load_recipe(recipe_name)
|
| test_api = recipe_loader.create_test_api(recipe.DEPS)
|
| +
|
| + covers = cover_mods + [recipe_path]
|
| +
|
| for test_data in recipe.GenTests(test_api):
|
| root, name = os.path.split(recipe_path)
|
| name = os.path.splitext(name)[0]
|
| @@ -70,6 +86,7 @@ def GenerateTests():
|
| expect_tests.FuncCall(RunRecipe, test_data),
|
| expect_dir=expect_path,
|
| expect_base=test_data.name,
|
| + covers=covers,
|
| break_funcs=(recipe.GenSteps,)
|
| )
|
|
|
| @@ -84,9 +101,4 @@ if __name__ == '__main__':
|
| logging.warn("Ignoring %s environment variable." % env_var)
|
| os.environ.pop(env_var)
|
|
|
| - expect_tests.main('recipe_simulation_test', GenerateTests, (
|
| - [os.path.join(x, '*') for x in recipe_util.RECIPE_DIRS()] +
|
| - [os.path.join(x, '*', '*api.py') for x in recipe_util.MODULE_DIRS()]
|
| - ), (
|
| - [os.path.join(x, '*', '*config.py') for x in recipe_util.MODULE_DIRS()]
|
| - ))
|
| + expect_tests.main('recipe_simulation_test', GenerateTests)
|
|
|