diff --git a/tests/test_versions/test.sh b/tests/test_versions/test.sh index e7fb4910f152fdcbc055b05c22dcdd650903b61b..e3b6a48612c4f876c29cf87860d811d688d5d385 100755 --- a/tests/test_versions/test.sh +++ b/tests/test_versions/test.sh @@ -7,12 +7,14 @@ EPICS_BASE=${EPICS_BASE:-/epics/base-7.0.5} REQUIRE_VER=${E3_REQUIRE_VERSION:-3.4.1} if which ack &>/dev/null; then - __SEARCH_COMMAND__="ack --passthru" + __use_ack=true else echo "ack is not installed; defaulting to grep, but note that the log will be missing the IOC log" >&2 - __SEARCH_COMMAND__="grep" + __use_ack=false fi +#__use_ack=false + function usage { echo "Usage:" echo " bash test.sh [-b <EPICS_BASE>] [-r <REQUIRE_VER>] [-h] testfile" @@ -65,8 +67,13 @@ function test_require { echo "Installed: ${args[*]}" echo "============================================================" - required=${required//+/\\+} - expected=${expected//+/\\+} + if [ "$__use_ack" = true ]; then + required=${required//+/\\+} + expected=${expected//+/\\+} + __SEARCH_COMMAND__="ack --passthru" + else + __SEARCH_COMMAND__="grep" + fi clean_vers @@ -84,6 +91,8 @@ function test_require { search_string="^Loaded $MODULENAME version $expected\$" fi + echo "SEARCH STRING: $search_string" + # The funny sed command here is from https://unix.stackexchange.com/a/235016/445931 # The reason this is needed is because the "Starting iocInit" message seems to be threaded # differently than the regular flow of output and sometimes will separate the strings that