Skip to content

Commit

Permalink
fix RELEASE file parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
gilesknap committed Jun 24, 2024
1 parent 746a1d4 commit 4d0e369
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/ibek/support_cmds/checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
SHELL_REPLACE = r"${\1}"

# find macros, including ones with blank values
PARSE_MACROS_NULL = re.compile(r"^([A-Z_a-z0-9]*)\s*=(.*)$", flags=re.M)
PARSE_MACROS_NULL = re.compile(r"^([A-Z_\-\.a-z0-9]*)\s*=(.*)$", flags=re.M)


def verify_release_includes_local(configure_folder: Path):
Expand Down
3 changes: 2 additions & 1 deletion tests/samples/epics/support/configure/RELEASE
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ SUPPORT=/epics/support
EPICS_BASE=/epics/epics-base

# Additional Support Modules for individual IOCs will be added below this line
ADSIMDETECTOR=/epics/support/ADSimDetector
ADSIMDETECTOR=/epics/support/ADSimDetector
SOME-OTHER-MODULE=/epics/support/some-other-module
Empty file.
23 changes: 21 additions & 2 deletions tests/test_support.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import pytest

from ibek.support_cmds.checks import check_deps
from ibek.support_cmds.checks import check_deps, do_dependencies
from ibek.support_cmds.files import symlink_files


Expand Down Expand Up @@ -38,8 +38,27 @@ def test_symlink_pvi(tmp_path: Path, samples: Path):
# the support files
def test_check_dependencies(tmp_epics_root: Path):
# Check Passes vs test data
check_deps(["ADSimDetector"])
check_deps(["ADSimDetector", "some-other-module"])

# Check fails
with pytest.raises(Exception):
check_deps(["FakeDetector"])


def test_check_release_sh(tmp_epics_root: Path):
"""validate generation of RELEASE.sh for issue #227"""

do_dependencies()

release_sh = tmp_epics_root / "support" / "configure" / "RELEASE.shell"
assert release_sh.exists()
text = release_sh.read_text()
assert (
text
== """export SUPPORT="/epics/support"
export EPICS_BASE="/epics/epics-base"
export ADSIMDETECTOR="/epics/support/ADSimDetector"
export SOME-OTHER-MODULE="/epics/support/some-other-module"
export EPICS_DB_INCLUDE_PATH=""
"""
)

0 comments on commit 4d0e369

Please sign in to comment.