Skip to content

Commit a5ae6cc

Browse files
committed
Enable codecov.io test coverage reporting
- Fixes #51 (cherry picked from commit 2d319b4)
1 parent c83d0d9 commit a5ae6cc

File tree

3 files changed

+42
-8
lines changed

3 files changed

+42
-8
lines changed

.travis.yml

Lines changed: 37 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@ env:
77
- MPICH_URL_HEAD="http://www.mpich.org/static/downloads/$MPICH_VER"
88
- MPICH_URL_TAIL="mpich-${MPICH_VER}.tar.gz"
99
- MPICH_DIR="$HOME/.local/usr/mpich"
10-
- OSX_PACKAGES="gcc cmake mpich"
11-
# homebrew bug requires MPI to be built from source, for now
10+
- MPICH_BOT_URL_HEAD="https://github.com/sourceryinstitute/opencoarrays/files/64308/"
11+
- MPICH_BOT_URL_TAIL="mpich-3.2.yosemite.bottle.1.tar.gz"
12+
- OSX_PACKAGES="gcc cmake"
1213

1314
matrix:
1415
include:
@@ -17,7 +18,8 @@ matrix:
1718
sudo: false
1819
cache:
1920
directories:
20-
"$CACHE"
21+
- "$CACHE"
22+
- "$HOME/.cache/pip"
2123
addons:
2224
apt:
2325
sources:
@@ -26,13 +28,14 @@ matrix:
2628
packages:
2729
- gcc-5
2830
- gfortran-5
31+
- binutils
2932
- cmake-data
3033
- cmake
3134

3235
before_install:
3336
- |
3437
if [[ $TRAVIS ]] && [[ "X$TRAVIS_OS_NAME" = "Xosx" ]]; then
35-
brew update 2>brewupdate.err | tee brewupdate.log | head -n 1
38+
export PATH="$PATH:$HOME/Library/Python/2.7/bin"
3639
else
3740
[[ -d "$CACHE/bin" ]] || mkdir -p "$CACHE/bin"
3841
[[ -d "$MPICH_DIR" ]] || mkdir -p "$MPICH_DIR"
@@ -47,10 +50,21 @@ before_install:
4750
install:
4851
- |
4952
if [[ $TRAVIS ]] && [[ "X$TRAVIS_OS_NAME" = "Xosx" ]]; then
53+
brew update > /dev/null
54+
5055
for pkg in $OSX_PACKAGES; do
51-
[[ "$(brew ls --versions $pkg)" ]] || brew install $pkg
52-
brew outdated $pkg || brew upgrade $pkg
56+
[[ "$(brew ls --versions $pkg)" ]] || brew install --force-bottle $pkg
57+
brew outdated $pkg || brew upgrade --force-bottle $pkg
5358
done
59+
export FC=gfortran-5
60+
export CC=gcc-5
61+
if ! [[ "$(brew ls --versions mpich)" ]]; then
62+
wget ${MPICH_BOT_URL_HEAD}${MPICH_BOT_URL_TAIL}
63+
brew install --force-bottle ${MPICH_BOT_URL_TAIL}
64+
if ! [[ "$(brew ls --versions mpich)" ]]; then
65+
brew install --force-bottle mpich
66+
fi
67+
fi
5468
else
5569
if ! ( [[ -x "$HOME/.local/bin/mpif90" ]] && [[ -x "$HOME/.local/bin/mpicc" ]] ); then
5670
# mpich install not cached
@@ -87,6 +101,22 @@ before_script:
87101
script:
88102
- mkdir cmake-build
89103
- cd cmake-build
90-
- cmake ..
104+
- cmake -DCMAKE_INSTALL_PREFIX:PATH="$HOME/OpenCoarrays" -DCMAKE_Fortran_FLAGS='-ftest-coverage -fprofile-arcs -O0' -DCMAKE_C_FLAGS='-fprofile-arcs -ftest-coverage -O0' ..
91105
- make -j 4
92106
- ctest --verbose
107+
- make install
108+
- cd ..
109+
110+
after_success:
111+
- find . -name '*.gcno' -print
112+
- find . -name '*.gcda' -print
113+
- gcov-5 --version
114+
- bash <(curl -s https://codecov.io/bash) -x $(which gcov-5)
115+
116+
notifications:
117+
webhooks:
118+
urls:
119+
- $GITTERHOOK_URL
120+
on_success: change # options: [always|never|change]
121+
on_failure: always
122+
on_start: always

src/tests/integration/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
if (opencoarrays_aware_compiler)
22
add_subdirectory(coarrayHelloWorld)
3-
add_subdirectory(dist_transpose )
3+
if (NOT (DEFINED ENV{TRAVIS}))
4+
add_subdirectory(dist_transpose )
5+
endif()
46
add_subdirectory(pde_solvers)
57
endif()

src/tests/integration/pde_solvers/navier-stokes/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ if ("${CMAKE_SYSTEM_NAME}" MATCHES "Linux")
44
# checking whether the machine is of type 64-bit before proceeding further
55
if ("${MACHINE_TYPE}" MATCHES "x86_64")
66
# Default to older SSE-instruction-based FFT library
7+
if (NOT (DEFINED ENV{TRAVIS}))
78
if (LEGACY_ARCHITECTURE OR (NOT DEFINED(LEGACY_ARCHITECTURE)))
89
set(fft_library ${CMAKE_CURRENT_SOURCE_DIR}/libfft_sse.a )
910
else()
@@ -16,6 +17,7 @@ if ("${CMAKE_SYSTEM_NAME}" MATCHES "Linux")
1617
)
1718
target_link_libraries(coarray_navier_stokes OpenCoarrays ${fft_library})
1819
endif()
20+
endif()
1921
else()
2022
# Skip Navier-Stokes build until an appropriate FFT has been found.
2123
endif()

0 commit comments

Comments
 (0)