enable generator to locate configurations

This commit is contained in:
protolambda 2019-04-07 16:32:48 +10:00
parent 69af7f733e
commit 9f32995693
No known key found for this signature in database
GPG Key ID: EC89FDBB2B4C7623
2 changed files with 11 additions and 2 deletions

View File

@ -55,6 +55,13 @@ def run_generator(generator_name, suite_creators: List[TestSuiteCreator]):
default=False,
help="if set overwrite test files if they exist",
)
parser.add_argument(
"-c",
"--configs-path",
dest="configs_path",
default=True,
help="specify the path of the configs directory (containing constants_presets and fork_timelines)",
)
args = parser.parse_args()
output_dir = args.output_dir
@ -66,8 +73,9 @@ def run_generator(generator_name, suite_creators: List[TestSuiteCreator]):
yaml = YAML(pure=True)
print(f"Generating tests for {generator_name}, creating {len(suite_creators)} test suite files...")
print(f"Reading config presets and fork timelines from {args.configs_path}")
for suite_creator in suite_creators:
suite = suite_creator()
suite = suite_creator(args.configs_path)
filename = make_filename_for_test(suite)
path = output_dir / filename

View File

@ -2,4 +2,5 @@ from typing import Callable, Dict, Any
TestCase = Dict[str, Any]
TestSuite = Dict[str, Any]
TestSuiteCreator = Callable[[], TestSuite]
# Args: <presets path>
TestSuiteCreator = Callable[[str], TestSuite]