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

Added simple test

parent 55c15865
No related branches found
No related tags found
1 merge request!83E3-752: Fetch dependencies recursively
......@@ -445,7 +445,7 @@ str-eq = $(if $(subst x$1,,x$2),,t)
_MODULES :=
_PROCESSED_MODULES :=
REQ :=
INSTALLED_MODULES := $(sort $(notdir $(shell ls -d $(E3_SITEMODS_PATH)/* $(EPICS_MODULES)/*)))
INSTALLED_MODULES := $(sort $(notdir $(wildcard $(E3_SITEMODS_PATH)/* $(EPICS_MODULES)/*)))
# Converts all of the X_DEP_VERSIONs to x_VERSION and records them
define fetch_module_versions
......@@ -466,7 +466,7 @@ export REQ
# Fetches the data from .dep files to be parsed by the above
define fetch_deps
$(shell cat $(E3_SITEMODS_PATH)/$1/$($1_VERSION)/lib/$(T_A)/$1.dep | sed '1d')
$(shell cat $(lastword $(wildcard $(addsuffix /$1/$($1_VERSION)/lib/$(T_A)/$1.dep,$(E3_SITEMODS_PATH) $(EPICS_MODULES)))) | sed '1d')
endef
# Used to recurse through versions: recursively fetches all of the dependencies from the given module
......
......@@ -160,3 +160,28 @@ def test_updated_dependencies(wrappers):
)
assert rc == 0
assert f"Loaded {wrapper_dep.name} version {new_version}" in outs
def test_recursive_deps(wrappers):
wrapper_a = wrappers.get()
wrapper_b = wrappers.get()
wrapper_c = wrappers.get()
cell_path = wrapper_a.path / "cellMods"
wrapper_a.add_var_to_config_module(f"{wrapper_b.name}_DEP_VERSION", "0.0.0+0")
wrapper_b.add_var_to_config_module(f"{wrapper_c.name}_DEP_VERSION", "0.0.0+0")
wrapper_c.add_var_to_makefile("HEADERS", f"{wrapper_c.name}.h")
(wrapper_c.module_dir / f"{wrapper_c.name}.h").touch()
wrapper_a.add_var_to_makefile("SOURCES", f"{wrapper_a.name}.c")
with open(wrapper_a.module_dir / f"{wrapper_a.name}.c", "w") as f:
f.write(f'#include "{wrapper_c.name}.h"')
rc, *_ = wrapper_c.run_make("cellinstall", cell_path=cell_path)
assert rc == 0
rc, *_ = wrapper_b.run_make("cellinstall", cell_path=cell_path)
assert rc == 0
rc, *_ = wrapper_a.run_make("cellinstall", cell_path=cell_path)
assert rc == 0
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