Skip to content
Snippets Groups Projects
Commit 5a22b50d authored by Simon Rose's avatar Simon Rose
Browse files

Add test for recursive database dependency loading

parent f7f81e2a
No related branches found
No related tags found
No related merge requests found
......@@ -539,6 +539,43 @@ def test_expand_db_files(wrapper: Wrapper):
)
def test_recursive_db_dependency(wrappers):
wrapper_main: Wrapper = wrappers.get()
wrapper_dep: Wrapper = wrappers.get()
cell_path = wrapper_main.path / "cellMods"
common_dir = wrapper_main.module_dir / f"O.{wrapper_main.base_version}_Common"
wrapper_main.add_var_to_config_module(
f"{wrapper_dep.name}_DEP_VERSION", wrapper_dep.version
)
substitution_file = wrapper_main.module_dir / "a.substitutions"
substitution_file.write_text(
"""file "b.template"
{
pattern { PATTERN }
{ SUBST }
}"""
)
wrapper_main.add_var_to_module_makefile("SUBS", "a.substitutions")
wrapper_main.add_var_to_module_makefile(
"USR_DBFLAGS",
f"-I $(EPICS_MODULES)/{wrapper_dep.name}/$({wrapper_dep.name}_VERSION)/db",
)
template_file = wrapper_dep.module_dir / "b.template"
template_file.write_text("record(ai, $(PATTERN)) {}")
wrapper_dep.add_var_to_module_makefile("TEMPLATES", "b.template")
rc, *_ = wrapper_dep.run_make("install", cell_path=cell_path)
assert rc == 0
rc, *_ = wrapper_main.run_make("cellbuild", cell_path=cell_path)
assert rc == 0
assert "SUBST" in (common_dir / "a.db").read_text()
def test_substitution_template_priority(wrapper: Wrapper):
"""Test that the automated template/substitution file expansion works."""
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment