Skip to content

Commit 879b3f7

Browse files
committed
Improve/fix CI testing scripts
1 parent c6b9821 commit 879b3f7

File tree

6 files changed

+32
-20
lines changed

6 files changed

+32
-20
lines changed

scripts/travis/before_install.sh

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,16 +47,18 @@ mkdir -p ${BUILD_ROOT}
4747

4848
# Define a command (using built-in travis functions) to launch one of our
4949
# scripts
50-
function run_script {
51-
set +x
52-
set -e
50+
run_script() {
51+
set +exv
5352
fold_start $1 "$2"
5453
local scriptloc="${SOURCE_ROOT}/scripts/travis/$1.sh"
55-
echo "Running ${scriptloc}"
54+
echo -e "\e[0;32mRunning ${scriptloc}\e[0m"
5655
${scriptloc}
57-
local result=$?
56+
local _RESULT=$?
5857
fold_end $1
59-
return $?
58+
if [ ${_RESULT} -ne 0 ]; then
59+
echo -e "\e[1;31m${scriptloc} exited with ${_RESULT}\e[0m"
60+
fi
61+
return ${_RESULT}
6062
}
6163

6264
###############################################################################
@@ -65,11 +67,11 @@ function run_script {
6567
# from https://github.com/travis-ci/travis-rubies/blob/build/build.sh
6668
###############################################################################
6769

68-
function fold_start() {
70+
fold_start() {
6971
echo -e "travis_fold:start:$1\033[33;1m$2\033[0m"
7072
}
7173

72-
function fold_end() {
74+
fold_end() {
7375
echo -e "\ntravis_fold:end:$1\r"
7476
}
7577

scripts/travis/compile.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/sh -e
1+
#!/bin/sh -ex
22
###############################################################################
33
# File : scripts/travis/compile.sh
44
###############################################################################

scripts/travis/configure.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ else
1313
fi
1414

1515
CXX_FLAGS="-Wall -Wextra -Werror"
16-
Fortran_FLAGS="-Wall -Wextra -Wimplicit-procedure -Wimplicit-interface -Wno-compare-reals -Wno-maybe-uninitialized"
16+
Fortran_FLAGS="-Wall -Wextra -Wimplicit-procedure -Wimplicit-interface -Wno-compare-reals -Wno-maybe-uninitialized -Werror"
1717

1818
set -x
1919
cd ${BUILD_ROOT} && cmake -G "${CMAKE_GENERATOR}" \
@@ -24,6 +24,7 @@ cd ${BUILD_ROOT} && cmake -G "${CMAKE_GENERATOR}" \
2424
-D CMAKE_CXX_FLAGS="${CXX_FLAGS}" \
2525
-D CMAKE_Fortran_FLAGS="${Fortran_FLAGS}" \
2626
-D CMAKE_INSTALL_PREFIX="${INSTALL_ROOT}" \
27+
-D MEMORYCHECK_COMMAND_OPTIONS="--error-exitcode=1 --leak-check=full" \
2728
${SOURCE_ROOT}
2829

2930
###############################################################################

scripts/travis/deploy.sh

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,22 @@ set -x
1313
cd ${BUILD_ROOT} && ${GENERATOR} install
1414

1515
# Test existence of install files
16+
test_f() {
17+
if ! [ -f "$1" ]; then
18+
echo -e "\e[0;31mMissing file $1\e[0m"
19+
ls -al "$(dirname "$1")"
20+
return 1
21+
fi
22+
}
1623

1724
if [ "${FLIBCPP_DEV}" = "ON" ]; then
18-
test -f ${INSTALL_ROOT}/share/doc/Flibcpp/index.html
19-
test -f ${INSTALL_ROOT}/include/flc.i
25+
test_f ${INSTALL_ROOT}/share/doc/Flibcpp/index.html
26+
test_f ${INSTALL_ROOT}/include/flc.i
2027
fi
2128

22-
test -f ${INSTALL_ROOT}/include/flc.mod
23-
test -f ${INSTALL_ROOT}/lib/libflc${SO_EXT}
24-
test -f ${INSTALL_ROOT}/lib/cmake/Flibcpp/FlibcppConfig.cmake
29+
test_f ${INSTALL_ROOT}/include/flc.mod
30+
test_f ${INSTALL_ROOT}/lib/libflc${SO_EXT}
31+
test_f ${INSTALL_ROOT}/lib/cmake/Flibcpp/FlibcppConfig.cmake
2532

2633
###############################################################################
2734
# end of scripts/travis/deploy.sh

scripts/travis/install.sh

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
1-
#!/bin/sh -e
1+
#!/bin/sh -ex
22
###############################################################################
33
# File : scripts/travis/install.sh
44
#
55
# Install dependencies.
66
###############################################################################
77

8-
set -x
9-
108
mkdir -p ${INSTALL_ROOT}/bin
119

1210
if [ "${GENERATOR}" = "ninja" ]; then

scripts/travis/test.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/sh -e
1+
#!/bin/sh -ex
22
###############################################################################
33
# File : scripts/travis/test.sh
44
###############################################################################
@@ -7,7 +7,11 @@ cd ${BUILD_ROOT}
77

88
ctest --output-on-failure
99
if [ "${FLIBCPP_DEV}" = "ON" ]; then
10-
ctest -E examples -D ExperimentalMemCheck --output-on-failure
10+
# Run tests (not examples, which use a shell script) through valgrind
11+
if ! ctest -E examples -D ExperimentalMemCheck --output-on-failure; then
12+
find Testing/Temporary -name "MemoryChecker.*.log" -exec cat {} +
13+
exit 1
14+
fi
1115
fi
1216

1317
###############################################################################

0 commit comments

Comments
 (0)