-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
219 lines (214 loc) · 7.1 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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
###############################################################################
# Copyright (c) 2017, Lawrence Livermore National Security, LLC.
#
# Produced at the Lawrence Livermore National Laboratory
#
# LLNL-CODE-725085
#
# All rights reserved.
#
# This file is part of BLT.
#
# For additional details, please also read BLT/LICENSE.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice,
# this list of conditions and the disclaimer below.
#
# * Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the disclaimer (as noted below) in the
# documentation and/or other materials provided with the distribution.
#
# * Neither the name of the LLNS/LLNL nor the names of its contributors may
# be used to endorse or promote products derived from this software without
# specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL LAWRENCE LIVERMORE NATIONAL SECURITY,
# LLC, THE U.S. DEPARTMENT OF ENERGY OR CONTRIBUTORS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
# IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
###############################################################################
sudo: false
language: cpp
compiler:
- gcc
env:
global:
# we need to know the root dir for our 3rd party lib installs
- TRAVIS_HOME=`pwd`/..
- TRAVIS_TPLS_DIR=${TRAVIS_HOME}/tpls
matrix:
# gcc w/ cmake 3.3.1
- CMAKE_MAJOR=3.3
CMAKE_MINOR=1
BLT_CC=gcc-4.9
BLT_CXX=g++-4.9
BLT_FC=gfortran-4.9
BLT_FORTRAN=ON
BLT_OPENMP=ON
BLT_GTEST=ON
BLT_FRUIT=ON
BLT_GMOCK=OFF
# gcc w/ cmake 3.4.1
- CMAKE_MAJOR=3.4
CMAKE_MINOR=1
BLT_CC=gcc-4.9
BLT_CXX=g++-4.9
BLT_FC=gfortran-4.9
BLT_FORTRAN=ON
BLT_OPENMP=ON
BLT_GTEST=ON
BLT_FRUIT=ON
BLT_GMOCK=OFF
# gcc w/ cmake 3.8.0
- CMAKE_MAJOR=3.8
CMAKE_MINOR=0
BLT_CC=gcc-4.9
BLT_CXX=g++-4.9
BLT_FC=gfortran-4.9
BLT_FORTRAN=ON
BLT_OPENMP=ON
BLT_GTEST=ON
BLT_FRUIT=ON
BLT_GMOCK=OFF
# gcc w/ cmake 3.8.0, gmock on
- CMAKE_MAJOR=3.8
CMAKE_MINOR=0
BLT_CC=gcc-4.9
BLT_CXX=g++-4.9
BLT_FC=gfortran-4.9
BLT_FORTRAN=ON
BLT_OPENMP=ON
BLT_GTEST=ON
BLT_FRUIT=ON
BLT_GMOCK=ON
# gcc w/ cmake 3.8.0, gtest and fruit off
- CMAKE_MAJOR=3.8
CMAKE_MINOR=0
BLT_CC=gcc-4.9
BLT_CXX=g++-4.9
BLT_FC=gfortran-4.9
BLT_FORTRAN=ON
BLT_GTEST=OFF
BLT_FRUIT=OFF
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-4.9
- g++-4.9
- gfortran-4.9
- mpich2
- libmpich2-dev
before_install:
# download the ver of cmake we want to test
- wget --no-check-certificate http://www.cmake.org/files/v${CMAKE_MAJOR}/cmake-${CMAKE_MAJOR}.${CMAKE_MINOR}-Linux-x86_64.sh
install:
# install cmake
- mkdir -p ${TRAVIS_TPLS_DIR}/cmake/
- sh cmake-${CMAKE_MAJOR}.${CMAKE_MINOR}-Linux-x86_64.sh --skip-license --prefix=${TRAVIS_TPLS_DIR}/cmake/
- export PATH=${TRAVIS_TPLS_DIR}/cmake/bin:$PATH
script:
# set git user info
- git config --global user.email "[email protected]"
- git config --global user.name "BLT Robot"
- BLT_SOURCE_DIR=${TRAVIS_BUILD_DIR}
- cmake --version
- cd $TRAVIS_BUILD_DIR/..
# copy our internal testing project
- cp -r blt/tests/internal blt-test
# create a git repo for blt-test to test the git macros
- cd blt-test
- git init
- git add -A
- git commit -a -m "Initial Commit"
- git checkout -b test-branch
- git tag test-tag
- cd ..
# create an out-of-source build dir and an install dir
- mkdir travis-debug-build
- mkdir travis-debug-install
# sanity check
- ls
- ls blt-test
# change into build dir
- cd travis-debug-build
# point to blt
- CMAKE_OPTS="-DBLT_SOURCE_DIR=${BLT_SOURCE_DIR}"
# build type and install loc
- CMAKE_OPTS="${CMAKE_OPTS} -DCMAKE_BUILD_TYPE=Debug"
- CMAKE_OPTS="${CMAKE_OPTS} -DCMAKE_INSTALL_PREFIX=../travis-debug-install"
# c & c++ compilers
- CMAKE_OPTS="${CMAKE_OPTS} -DCMAKE_C_COMPILER=${BLT_CC}"
- CMAKE_OPTS="${CMAKE_OPTS} -DCMAKE_CXX_COMPILER=${BLT_CXX}"
# gtest support
- CMAKE_OPTS="${CMAKE_OPTS} -DENABLE_GTEST=${BLT_GTEST}"
# gmock support
- CMAKE_OPTS="${CMAKE_OPTS} -DENABLE_GMOCK=${BLT_GMOCK}"
# fruit support
- CMAKE_OPTS="${CMAKE_OPTS} -DENABLE_FRUIT=${BLT_FRUIT}"
# benchmarking
- CMAKE_OPTS="${CMAKE_OPTS} -DENABLE_BENCHMARKS=ON"
# enable fortran support
- CMAKE_OPTS="${CMAKE_OPTS} -DENABLE_FORTRAN=${BLT_FORTRAN}"
- CMAKE_OPTS="${CMAKE_OPTS} -DCMAKE_Fortran_COMPILER=${BLT_FC}"
# openmp support
- CMAKE_OPTS="${CMAKE_OPTS} -DENABLE_OPENMP=${BLT_OPENMP}"
# mpi support
- CMAKE_OPTS="${CMAKE_OPTS} -DENABLE_MPI=ON"
- CMAKE_OPTS="${CMAKE_OPTS} -DMPI_C_COMPILER=mpicc"
- CMAKE_OPTS="${CMAKE_OPTS} -DMPI_CXX_COMPILER=mpicc"
- CMAKE_OPTS="${CMAKE_OPTS} -DMPI_Fortran_COMPILER=mpif90"
# test git macros
- CMAKE_OPTS="${CMAKE_OPTS} -DTEST_GIT_MACROS=ON"
# configure with cmake
- cmake ${CMAKE_OPTS} ../blt-test
# build, link, and triumph
- make
- env CTEST_OUTPUT_ON_FAILURE=1 make test
- make install
#########################################################
#########################################################
# tutorial tests
#########################################################
#########################################################
# override prev gtest setting, these projects req gtest
- CMAKE_OPTS="${CMAKE_OPTS} -DENABLE_GTEST=ON"
#########################################################
# test docs/tutorial/blank_project
#########################################################
- cd ${TRAVIS_BUILD_DIR}
- mkdir -p test-tutorial/blank_project
- cd test-tutorial/blank_project
- cmake ${CMAKE_OPTS} ${BLT_SOURCE_DIR}/docs/tutorial/blank_project
- make
- env CTEST_OUTPUT_ON_FAILURE=1 make test
- make install
#########################################################
# test docs/tutorial/calc_pi
#########################################################
- cd ${TRAVIS_BUILD_DIR}
- mkdir -p test-tutorial/calc_pi
- cd test-tutorial/calc_pi
- cmake ${CMAKE_OPTS} ${BLT_SOURCE_DIR}/docs/tutorial/calc_pi
- make
- env CTEST_OUTPUT_ON_FAILURE=1 make test
- make install
notifications:
email:
recipients:
on_success: always
on_failure: always