Skip to content

Commit

Permalink
Use --support-templates in a test
Browse files Browse the repository at this point in the history
  • Loading branch information
swuerl committed Jan 18, 2024
1 parent e38dab7 commit db36301
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ def __init__(self, test_file: str, keep_temporaries: bool, node_name: str):
search_dir = search_dir.parent
self.root_dir = search_dir
self.templates_dir = self.test_dir / pathlib.Path("templates")
self.support_templates_dir = self.test_dir / pathlib.Path("support")
self.dsdl_dir = self.test_dir / pathlib.Path("dsdl")
self.lang_src_dir = self.root_dir / pathlib.Path("src") / pathlib.Path("nunavut") / pathlib.Path("lang")

Expand Down
1 change: 1 addition & 0 deletions test/gentest_nnvg/support/serialization.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
19 changes: 19 additions & 0 deletions test/gentest_nnvg/test_nnvg.py
Original file line number Diff line number Diff line change
Expand Up @@ -610,3 +610,22 @@ def test_list_configuration(gen_paths: typing.Any, run_nnvg: typing.Callable) ->
)
assert len(parsed_config[default_target_section_name]) > 0
print(yaml.dump(parsed_config))

def test_support_templates_dir(gen_paths: typing.Any, run_nnvg: typing.Callable) -> None:
"""
Use the --support-templates option to find templates for support generation
"""
nnvg_args = [
"--templates",
gen_paths.templates_dir.as_posix(),
"--support-templates",
gen_paths.support_templates_dir.as_posix(),
"-O",
gen_paths.out_dir.as_posix(),
"-I",
(gen_paths.dsdl_dir / pathlib.Path("scotec")).as_posix(),
"--list-inputs",
(gen_paths.dsdl_dir / pathlib.Path("uavcan")).as_posix(),
]

run_nnvg(gen_paths, nnvg_args).stdout.decode("utf-8").split(";")

0 comments on commit db36301

Please sign in to comment.