forked from SPECFEM/specfem3d_globe
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
116 lines (87 loc) · 3.5 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
# Travis configuration
#
# Note: building Fortran code is not supported (yet): see https://docs.travis-ci.com/user/language-specific/
# this is using C as a base and installs gfortran in the test environment
language: c
dist: trusty
sudo: required
os: linux
compiler: gcc
env:
global:
- FC=gfortran
- MPIFC=mpif90
- CC=gcc
- OMP_NUM_THREADS=2
- WORKDIR=`pwd`
matrix:
# for test cases, we use
# TESTID - identification number for test
# TESTDIR - test directory id
# TESTFLAGS - flags used for configuration
# TESTCOV - determines whether or not (0/1) code coverage flags are used
# CUDA - flag for compilation with CUDA
# CUDA_VERSION - specifies CUDA toolkit version
# code coverage: using coverage flags
- TESTID=1 TESTDIR=1 TESTCOV=1 TESTFLAGS="" CUDA=false
# code coverage: vectorization & openmp, using coverage flags
- TESTID=2 TESTDIR=1 TESTCOV=1 TESTFLAGS="--enable-vectorization" CUDA=false
# default test (with > make tests)
- TESTID=3 TESTDIR=0 TESTCOV=0 TESTFLAGS="" CUDA=false
# regional example w/ default configuration
- TESTID=4 TESTDIR=1 TESTCOV=0 TESTFLAGS="" CUDA=false
# regional example w/ vectorization
- TESTID=5 TESTDIR=1 TESTCOV=0 TESTFLAGS="--enable-vectorization" CUDA=false
# regional example w/ vectorization & openmp
- TESTID=6 TESTDIR=1 TESTCOV=0 TESTFLAGS="--enable-vectorization --enable-openmp" CUDA=false
# regional example with debug bounds checking
- TESTID=7 TESTDIR=1 TESTCOV=0 TESTFLAGS="--enable-debug" CUDA=false
# regional example with NGLL = 6
- TESTID=8 TESTDIR=1 TESTCOV=0 TESTFLAGS="" CUDA=false
# globe_small example
- TESTID=9 TESTDIR=2 TESTCOV=0 TESTFLAGS="--enable-vectorization" CUDA=false
# globe_small example with openmp
- TESTID=10 TESTDIR=2 TESTCOV=0 TESTFLAGS="--enable-vectorization --enable-openmp" CUDA=false
# point force example
- TESTID=11 TESTDIR=3 TESTCOV=0 TESTFLAGS="" CUDA=false
# regular kernel example
- TESTID=12 TESTDIR=4 TESTCOV=0 TESTFLAGS="--enable-vectorization" CUDA=false
before_install:
# informations on git
- |
git --version
git rev-parse --verify HEAD
git branch -a
# infos on commits
- |
echo "request: Branch($TRAVIS_BRANCH) Pull Request($TRAVIS_PULL_REQUEST) Tag($TRAVIS_TAG)"
echo "commit : Commit($TRAVIS_COMMIT) Range($TRAVIS_COMMIT_RANGE)"
# recommended for MPI projects to unset CC: see https://docs.travis-ci.com/user/languages/c
#- test -n $CC && unset CC
# updates repository
- sudo apt-get update
install:
- bash .travis/run_install.sh
script:
- bash .travis/run_tests.sh
after_success:
###########################################################
# code coverage
###########################################################
- |
if [ "$TESTCOV" == "1" ]; then
gcov --version
echo `pwd`
ls -al obj/
fi
# produces coverage reports (done manually because of different naming for source & object files)
- |
if [ "$TESTCOV" == "1" ]; then
find obj/ -iname '*.o' | sort | awk '{print "gcov -o obj/ "$1;}'
# executes gcov-commands
find obj/ -iname '*.o' | sort | awk '{print "gcov -o obj/ "$1;}' | sh
fi
# code coverage:
# see script : https://github.com/codecov/codecov-bash/blob/master/codecov
# see example: https://github.com/codecov/example-fortran/blob/master/.travis.yml
- if [ "$TESTCOV" == "1" ]; then bash <(curl -s https://codecov.io/bash) -X gcov; fi