Skip to content

Commit 3f7d785

Browse files
committed
Update ctest problem in Travis-CI scripts
- Also silence false shellcheck warnings - Add ctest to lint Travis-CI scripts
1 parent 725a617 commit 3f7d785

File tree

5 files changed

+23
-6
lines changed

5 files changed

+23
-6
lines changed

CMakeLists.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -791,3 +791,13 @@ endif()
791791

792792
include(cmake/AddInstallationScriptTest.cmake )
793793
add_installation_script_test(installation-scripts.sh src/tests/installation/)
794+
795+
# Lint the Travis-CI scripts
796+
set(TRAVIS_SCRIPTS
797+
install.linux.sh
798+
install.osx.sh
799+
test-script.InstallScript.sh
800+
test-script.cmake.sh)
801+
foreach(SCRIPT ${TRAVIS_SCRIPTS})
802+
lint_script("${CMAKE_SOURCE_DIR}/developer-scripts/travis" ${SCRIPT})
803+
endforeach()

developer-scripts/travis/install.linux.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,12 @@ fi
3939

4040
{
4141
mpif90 --version && mpif90 -show
42-
} || true
42+
} || echo "No mpif90"
4343
{
4444
mpicc --version && mpicc -show
45-
} || true
45+
} || echo "No mpicc"
46+
47+
type -a cmake || echo "CMake not installed"
4648
cmake --version || true
4749

4850
echo "Done."

developer-scripts/travis/install.osx.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,12 @@ fi
4343

4444
{
4545
mpif90 --version && mpif90 -show
46-
} || true
46+
} || echo "No mpif90"
4747
{
4848
mpicc --version && mpicc -show
49-
} || true
49+
} || echo "No mpicc"
50+
51+
type -a cmake || echo "CMake not installed"
5052
cmake --version || true
5153

5254
echo "Done."

developer-scripts/travis/test-script.InstallScript.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,10 @@ trap '__caf_err_report "${FUNCNAME:-.}" ${LINENO}' ERR
2323
echo "Performing Travis-CI script phase for the OpenCoarrays installation script..."
2424

2525
./install.sh --yes-to-all -i "${HOME}/opencoarrays" -j 4 -f "$(type -P "${FC}")" -c "$(type -P "${CC}")" -C "$(type -P "${CXX}")"
26-
if [[ -x "prerequisites/installations/cmake/*/bin/ctest" ]] ;then
27-
"prerequisites/installations/cmake/*/bin/ctest" --output-on-failure --schedule-random --repeat-until-fail "${NREPEAT:-5}"
26+
CTEST_LOC=(prerequisites/installations/cmake/*/bin/ctest)
27+
INSTALLER_CTEST="${CTEST_LOC[${#CTEST_LOC[@]}-1]}"
28+
if [[ -x "${INSTALLER_CTEST}" ]] ;then
29+
"${INSTALLER_CTEST}" --output-on-failure --schedule-random --repeat-until-fail "${NREPEAT:-5}"
2830
else
2931
ctest --output-on-failure --schedule-random --repeat-until-fail "${NREPEAT:-5}"
3032
fi

developer-scripts/travis/test-script.cmake.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ trap '__caf_err_report "${FUNCNAME:-.}" ${LINENO}' ERR
2323
echo "Performing Travis-CI script phase for the OpenCoarrays direct cmake build..."
2424

2525
mkdir cmake-build || echo "Cannot mkdir cmake-build"
26+
# shellcheck disable=SC2153
2627
for BUILD_TYPE in ${BUILD_TYPES}; do
2728
rm -rf cmake-build/* || true
2829
(

0 commit comments

Comments
 (0)