-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
173 lines (150 loc) · 7.19 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
language: cpp
compiler: gcc
dist: xenial
repo_token: 8fED6K5jbjn44SCw2umhjAgXeTy21JTEX
cache: ccache
common_sources: &all_sources
- ubuntu-toolchain-r-test
- llvm-toolchain-xenial
- llvm-toolchain-xenial-8
addons:
apt:
sources: *all_sources
packages:
- python3
- python3-pip
matrix:
include:
- os: linux
compiler: gcc
addons: &gcc7
apt:
sources: *all_sources
packages: ['g++-7']
env: COMPILER='g++-7' COMPVER='7' COMPNAME='gcc'
- os: linux
compiler: gcc
addons: &gcc8
apt:
sources: *all_sources
packages: ['g++-8']
env: COMPILER='g++-8' COMPVER='8' COMPNAME='gcc'
# - os: linux
# compiler: gcc
# addons: &gcc8
# apt:
# sources: *all_sources
# packages: ['g++-8', 'valgrind','libc6-dbg', 'linux-libc-dev']
# env: COMPILER='g++-8' COMPVER='8' COMPNAME='gcc' VALGRIND=true
- os: linux
compiler: gcc
addons: &gcc8
apt:
sources: *all_sources
packages: ['g++-7', 'lcov']
env: COMPILER='g++-7' COMPVER='7' COMPNAME='gcc' CODE_COVERAGE=true
- env: COMPILER=clang++-8 COMPVER='8' COMPNAME='clang'
sudo: required
compiler: clang
addons: &clang8
apt:
sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-xenial-8']
packages: ["clang-8", "libc6-dbg", "g++-8"]
- env: COMPILER=clang++-8 COMPVER='8' COMPNAME='clang' HAS_TSAN=true
sudo: required
compiler: clang
addons: &clang8
apt:
sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-xenial-8']
packages: ["clang-8", "libc6-dbg", "g++-8", "llvm"]
- env: COMPILER=clang++-8 COMPVER='8' COMPNAME='clang' HAS_UBSAN=true
sudo: required
compiler: clang
addons: &clang8
apt:
sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-xenial-8']
packages: ["clang-8", "libc6-dbg", "g++-8", "llvm"]
- env: COMPILER=clang++-8 COMPVER='8' COMPNAME='clang' HAS_ASAN=true
sudo: required
compiler: clang
addons: &clang8
apt:
sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-xenial-8']
packages: ["clang-8", "libc6-dbg", "g++-8", "llvm"]
sources: *apt_sources
install:
- DEPS_DIR="${TRAVIS_BUILD_DIR}/deps"
- mkdir ${DEPS_DIR} && cd ${DEPS_DIR}
- travis_retry wget --no-check-certificate https://cmake.org/files/v3.14/cmake-3.14.2-Linux-x86_64.tar.gz
- tar -xvf cmake-3.14.2-Linux-x86_64.tar.gz > /dev/null
- mv cmake-3.14.2-Linux-x86_64 cmake-install
- PATH=${DEPS_DIR}/cmake-install:${DEPS_DIR}/cmake-install/bin:$PATH
- cd ${TRAVIS_BUILD_DIR}
- pip install conan --user
- if [[ "${CODE_COVERAGE}" == "true" ]]; then gem install coveralls-lcov ; fi
script:
- export CXX=${COMPILER}
- conan remote list
- git submodule update --init
- mkdir build
- cd build
- cmake --version
- |
if [[ "${CODE_COVERAGE}" = "true" ]]; then
sudo update-alternatives --install /usr/bin/gcov gcov /usr/bin/gcov-7 90
cd ..
conan install . --build boost -s compiler=${COMPNAME} -s compiler.version=${COMPVER} ${CFLAGS}
cmake ${CMAKE_OPTIONS_GLOBAL} ${CMAKE_OPTIONS} -Dsolidarity_ENABLE_DOUBLECHECKS=ON -Dsolidarity_COVER=ON -Dsolidarity_ENABLE_EXAMPLES=OFF -DCMAKE_EXE_LINKER_FLAGS="${CMAKE_EXE_LINKER_FLAGS} -lgcov" -DCMAKE_CXX_COMPILER=${CXX} -DCMAKE_CXX_FLAGS="${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage -g -O0" -DCMAKE_BUILD_TYPE=Debug . || exit 1
make -k -j2 || exit 1
ctest -j2 -C Debug . --verbose || exit 1
echo "lcov --base-directory --directory . --capture --output-file coverage.info"
lcov --base-directory . --directory . -c -o coverage.info # parse coverage data
lcov -r coverage.info "/usr*" -o coverage.info # remove data for system headers
lcov -r coverage.info "$(readlink -f /home/travis/.conan)/*" -o coverage.info # remove data for .cpp files
lcov -r coverage.info "$(readlink -f extern)/*" -o coverage.info # remove data for .cpp files
lcov -r coverage.info "$(readlink -f examples)/*" -o coverage.info # remove data for .cpp files
lcov -r coverage.info "$(readlink -f perftest)/*" -o coverage.info # remove data for .cpp files
echo "lcov --list coverage.info"
lcov -l coverage.info # just list a short summary of the results
coveralls-lcov --repo-token='8fED6K5jbjn44SCw2umhjAgXeTy21JTEX' coverage.info # upload results
bash <(curl -s https://codecov.io/bash) -f coverage.info || echo "Codecov did not collect coverage reports"
exit
fi
- conan install .. --build boost -s compiler=${COMPNAME} -s compiler.version=${COMPVER} ${CFLAGS}
- export TSAN_OPTIONS="verbosity=1 symbolize=1 force_seq_cst_atomics=1 second_deadlock_stack=1 external_symbolizer_path=`which llvm-symbolizer`"
- export UBSAN_OPTIONS="verbosity=1 symbolize=1 print_stacktrace=1 external_symbolizer_path=`which llvm-symbolizer`"
- export ASAN_OPTIONS=verbosity=1:symbolize=1:strict_string_checks=true:detect_odr_violation=2:detect_stack_use_after_return=true:check_initialization_order=true:strict_init_order=true
- export ASAN_SYMBOLIZER_PATH=$(which llvm-symbolizer)
- export UBSAN_SYMBOLIZER_PATH=$(which llvm-symbolizer)
- export MSAN_SYMBOLIZER_PATH=$(which llvm-symbolizer)
- export TSAN_SYMBOLIZER_PATH=$(which llvm-symbolizer)
- export PATH=${PATH}:$(dirname $(which llvm-symbolizer))
- echo "ASAN_SYMBOLIZER_PATH => " ${ASAN_SYMBOLIZER_PATH}
- echo "UBSAN_SYMBOLIZER_PATH => " ${UBSAN_SYMBOLIZER_PATH}
- echo "MSAN_SYMBOLIZER_PATH => " ${MSAN_SYMBOLIZER_PATH}
- echo "TSAN_SYMBOLIZER_PATH => " ${TSAN_SYMBOLIZER_PATH}
- echo "PATH => " ${PATH}
- echo "TSAN_OPTIONS => " ${TSAN_OPTIONS}
- |
if [[ "${HAS_TSAN}" = "true" ]]; then
cmake -Dsolidarity_ENABLE_TESTS=ON -Dsolidarity_ENABLE_BENCHMARKS=OFF -Dsolidarity_ENABLE_EXAMPLES=ON -Dsolidarity_ENABLE_DOUBLECHECKS=ON -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="${CXX_FLAGS} -g -O1 -fsanitize=thread -fPIE" -DCMAKE_BUILD_TYPE=Debug ..
make -k -j2
ctest -j2 -C Debug . --verbose || exit 1
exit
fi
- |
if [[ "${HAS_UBSAN}" = "true" ]]; then
cmake -Dsolidarity_ENABLE_TESTS=ON -Dsolidarity_ENABLE_BENCHMARKS=OFF -Dsolidarity_ENABLE_EXAMPLES=ON -Dsolidarity_ENABLE_DOUBLECHECKS=ON -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="${CXX_FLAGS} -g -O1 -fsanitize=undefined -fno-omit-frame-pointer" -DCMAKE_BUILD_TYPE=Debug ..
make -k -j2
ctest -j2 -C Debug . --verbose || exit 1
exit
fi
- |
if [[ "${HAS_ASAN}" = "true" ]]; then
cmake -Dsolidarity_ENABLE_TESTS=ON -Dsolidarity_ENABLE_BENCHMARKS=OFF -Dsolidarity_ENABLE_EXAMPLES=ON -Dsolidarity_ENABLE_DOUBLECHECKS=ON -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="${CXX_FLAGS} -g -O1 -fsanitize=address -fno-omit-frame-pointer" -DCMAKE_BUILD_TYPE=Debug ..
make -k -j2
ctest -j2 -C Debug . --verbose || exit 1
exit
fi
- cmake -Dsolidarity_ENABLE_TESTS=ON -Dsolidarity_ENABLE_BENCHMARKS=OFF -Dsolidarity_ENABLE_EXAMPLES=ON -Dsolidarity_ENABLE_DOUBLECHECKS=ON ..
- make -k -j 2