Index: third_party/recipe_engine/simulation_test.py |
diff --git a/third_party/recipe_engine/simulation_test.py b/third_party/recipe_engine/simulation_test.py |
index 4a9b2cd1869c79bab82d14d01c722c7fd5028d22..833184af33321f7679c1ba7c4eecff6fa2ac8de7 100644 |
--- a/third_party/recipe_engine/simulation_test.py |
+++ b/third_party/recipe_engine/simulation_test.py |
@@ -74,14 +74,18 @@ def GenerateTests(): |
) |
-def main(universe): |
+def main(package_pyl, args=None): |
"""Runs simulation tests on a given repo of recipes. |
Args: |
- universe: a RecipeUniverse to operate on. |
+ package_pyl: the path to a recipe_package.pyl to operate on, or |
+ an existing PackageDeps object |
+ args: command line arguments to expect_tests |
Returns: |
Doesn't -- exits with a status code |
""" |
+ from . import loader |
+ from . import package |
# annotated_run has different behavior when these environment variables |
# are set, so unset to make simulation tests environment-invariant. |
@@ -93,6 +97,11 @@ def main(universe): |
os.environ.pop(env_var) |
global _UNIVERSE |
- _UNIVERSE = universe |
+ if isinstance(package_pyl, package.PackageDeps): |
+ package_deps = package_pyl |
+ else: |
+ package_deps = package.PackageDeps.create(package_pyl) |
+ _UNIVERSE = loader.RecipeUniverse(package_deps) |
+ |
expect_tests.main('recipe_simulation_test', GenerateTests, |
- cover_omit=cover_omit()) |
+ cover_omit=cover_omit(), args=args) |