Skip to content

Commit

Permalink
remove full path from pvi template entries
Browse files Browse the repository at this point in the history
in ioc.subst.

This makes the tests work from different local paths.
The runtime folder is added to the db include path to make this work.
  • Loading branch information
gilesknap committed Nov 9, 2023
1 parent c30aee6 commit d7bf253
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 55 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,8 @@ lockfiles/
# this file may be created accidentally by ibek being run in its own directory
# so we ignore it
config/

# generated test files
tests/samples/epics/opi
tests/samples/epics/runtime

2 changes: 1 addition & 1 deletion src/ibek/runtime_cmds/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def generate_pvi(ioc: IOC) -> Tuple[List[IndexEntry], List[Tuple[Database, Entit

# Add to extra databases to be added into substitution file
databases.append(
(Database(file=output_template.as_posix(), args=macros), entity)
(Database(file=output_template.name, args=macros), entity)
)

if device_name not in formatted_pvi_devices:
Expand Down
4 changes: 2 additions & 2 deletions src/ibek/templates/ioc/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ if [ -f ${ibek_src} ]; then
# build expanded database using msi
if [ -f ${db_src} ]; then
includes=$(for i in ${SUPPORT}/*/db; do echo -n "-I $i "; done)
bash -c "msi -o${epics_db} ${includes} -S${db_src}"
bash -c "msi -o${epics_db} ${includes} -I${RUNTIME_DIR} -S${db_src}"
fi

# 2. st.cmd + ioc.subst ************************************************
Expand All @@ -92,7 +92,7 @@ elif [ -f ${ioc_startup} ] ; then
if [ -f ${CONFIG_DIR}/ioc.subst ]; then
# generate ioc.db from ioc.subst, including all templates from SUPPORT
includes=$(for i in ${SUPPORT}/*/db; do echo -n "-I $i "; done)
msi ${includes} -S ${CONFIG_DIR}/ioc.subst -o ${epics_db}
msi ${includes} -I${RUNTIME_DIR} -S ${CONFIG_DIR}/ioc.subst -o ${epics_db}
fi
final_ioc_startup=${ioc_startup}

Expand Down
32 changes: 0 additions & 32 deletions tests/samples/outputs/all.db.subst

This file was deleted.

7 changes: 7 additions & 0 deletions tests/samples/outputs/all.ioc.subst
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,10 @@ pattern
{ "name", "ip", "value" }
{ "Consumer Two With DB", "127.0.0.1", "Ref1.127.0.0.1" }
}

file "simple.pvi.template" {
pattern
{ "prefix" }
{ "AllObject One" }
{ "AllObject Two" }
}
17 changes: 0 additions & 17 deletions tests/samples/outputs/objects.db.subst

This file was deleted.

3 changes: 0 additions & 3 deletions tests/samples/outputs/utils.db.subst

This file was deleted.

1 change: 1 addition & 0 deletions tests/samples/yaml/all.ibek.support.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -122,3 +122,4 @@ defs:
pvi:
yaml_path: simple.pvi.device.yaml
prefix: "{{ name }}"
pva: true

0 comments on commit d7bf253

Please sign in to comment.