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

Merge branch 'e3_822_db_dependencies' into 'master'

E3-822: Register dependencies for expanded db files

See merge request e3/e3-require!86
parents 06556608 f5364bc6
No related branches found
No related tags found
No related merge requests found
......@@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* It is no longer necessary to specify `REQUIRED += ...` nor `x_VERSION = $(X_DEP_VERSION)` within the module makefile
### Bugfixes
* Fixed issue where updated dependencies of substitution files did not retrigger a .db expansion.
### Other changes
......
......@@ -398,6 +398,8 @@ export SRCS_Linux
# Perform default database expansion of .substitions/.templates into $(COMMON_DIR)
db_internal: $(COMMON_DIR)
-include $(COMMON_DIR)/*.db.d
define SUBS_EXPAND
vpath $(notdir $2) $(dir $2)
db_internal: $(COMMON_DIR)/$(notdir $(basename $2).db)
......
......@@ -264,3 +264,26 @@ def test_recursive_header_include(wrappers):
)
assert rc == 0
assert f"Loaded {wrapper_c.name} version {module_version}" in outs
def test_updated_template_files(wrapper):
wrapper.add_var_to_makefile("SUBS", "x.substitutions")
substitution_file = wrapper.module_dir / "x.substitutions"
substitution_file.write_text("file x.template {pattern {x} {y}}")
template_file = wrapper.module_dir / "x.template"
template_file.write_text("record(ai, initial) {}")
base_version = wrapper.get_env_var("EPICS_VERSION_NUMBER")
db_file = wrapper.module_dir / f"O.{base_version}_Common" / "x.db"
rc, *_ = wrapper.run_make("db_internal")
assert rc == 0
assert db_file.read_text() == "record(ai, initial) {}"
template_file.write_text("record(ai, updated) {}")
rc, *_ = wrapper.run_make("db_internal")
assert rc == 0
assert db_file.read_text() == "record(ai, updated) {}"
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