Skip to content

Commit 87a850e

Browse files
committed
Fix test case for csh
1 parent 5d897f0 commit 87a850e

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

.github/workflows/scripts/test_init_scripts.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,11 @@ for shell in ${SHELLS[@]}; do
4343

4444
# TEST 1: Source Script and check Module Output
4545
expected_pattern=".*EESSI has selected $EESSI_SOFTWARE_SUBDIR_OVERRIDE as the compatible CPU target for EESSI/$EESSI_VERSION.*"
46-
assert_raises "$shell -c '. init/lmod/$shell' 2>&1 | grep -E \"${expected_pattern}\""
46+
if [ "$shell" = "csh" ]; then
47+
assert_raises "$shell -c 'source init/lmod/$shell' 2>&1 | grep -E \"${expected_pattern}\""
48+
else
49+
assert_raises "$shell -c '. init/lmod/$shell' 2>&1 | grep -E \"${expected_pattern}\""
50+
fi
4751

4852
# TEST 2: Check if module overviews first section is the loaded EESSI module
4953
if [ "$shell" = "csh" ]; then
@@ -124,7 +128,7 @@ for shell in ${SHELLS[@]}; do
124128
TEST_EESSI_WITHOUT_PURGE=$($shell -c 'echo $EESSI_NO_MODULE_PURGE_ON_INIT')
125129
elif [ "$shell" = "fish" ]; then
126130
TEST_EESSI_WITH_PURGE=$($shell -c "source $LMOD_PKG/init/$shell 2>/dev/null ; source init/lmod/$shell 2>/dev/null")
127-
TEST_EESSI_WITHOUT_PURGE=$($shell -c "set -x EESSI_NO_MODULE_PURGE_ON_INIT 1 ; source $LMOD_PKG/init/$shell 2>/dev/null ; . init/lmod/$shell 2>/dev/null")
131+
TEST_EESSI_WITHOUT_PURGE=$($shell -c "set -x EESSI_NO_MODULE_PURGE_ON_INIT 1 ; source $LMOD_PKG/init/$shell 2>/dev/null ; source init/lmod/$shell 2>/dev/null")
128132
else
129133
TEST_EESSI_WITH_PURGE=$($shell -c ". $LMOD_PKG/init/$shell 2>/dev/null ; . init/lmod/$shell 2>/dev/null")
130134
TEST_EESSI_WITHOUT_PURGE=$($shell -c "export EESSI_NO_MODULE_PURGE_ON_INIT=1 ; . $LMOD_PKG/init/$shell 2>/dev/null ; . init/lmod/$shell 2>/dev/null")

0 commit comments

Comments
 (0)