forked from iboB/dynamix
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
172 lines (157 loc) · 5.3 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
if: tag IS blank # don't build tags
language: cpp
# temporary set sudo to true to work around travis-ci/travis-ci#9033
sudo: true
os: linux
compiler: gcc
notifications:
email:
on_success: change
on_failure: always
webhooks:
urls:
- https://webhooks.gitter.im/e/d605a517fe78a18459bd
on_success: change
on_failure: always
on_start: never
git:
depth: 5
branches:
except:
- next
cache:
directories:
- .mtime_cache
- debug_build
- release_build
- cc_debug
- cc_release
- static_debug
- static_release
addons:
apt:
sources: &apt_sources
- ubuntu-toolchain-r-test
- llvm-toolchain-trusty
- llvm-toolchain-trusty-4.0
- llvm-toolchain-trusty-5.0
matrix:
include:
# GCC 5
- env: COMPILER=g++-5
compiler: gcc
addons: &gcc5
apt:
packages: ["g++-5", "valgrind"]
sources: *apt_sources
# GCC 6
- env: COMPILER=g++-6
compiler: gcc
addons: &gcc6
apt:
packages: ["g++-6", "valgrind"]
sources: *apt_sources
# GCC 7
- env: COMPILER=g++-7
compiler: gcc
addons: &gcc7
apt:
packages: ["g++-7", "valgrind"]
sources: *apt_sources
# Clang 4.0
- env: COMPILER=clang++-4.0 ADDITIONAL_CXX_FLAGS="-g -fno-omit-frame-pointer -fsanitize=address,undefined"
addons: &clang40
apt:
packages: ["clang-4.0", "valgrind", "g++-6"]
sources: *apt_sources
# Clang 5.0
- env: COMPILER=clang++-5.0 ADDITIONAL_CXX_FLAGS="-g -fno-omit-frame-pointer -fsanitize=address,undefined"
addons: &clang50
apt:
packages: ["clang-5.0", "valgrind", "g++-6"]
sources: *apt_sources
# Clang 5.0 - sanitize thread
- env: COMPILER=clang++-5.0 ADDITIONAL_CXX_FLAGS="-g -fno-omit-frame-pointer -fsanitize=thread"
addons: &clang50
apt:
packages: ["clang-5.0", "valgrind", "g++-6"]
sources: *apt_sources
# Xcode 9.2 Clang
- env: COMPILER=clang++ ADDITIONAL_CXX_FLAGS="-g -fno-omit-frame-pointer -fsanitize=address,undefined"
osx_image: xcode9.2
os: osx
# OSX GCC 5
#- env: COMPILER=g++-5
# compiler: gcc
# osx_image: xcode7.3
# os: osx
install:
- |
if [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then
brew update
# cmake
if brew list -1 | grep -q "^cmake\$"; then
brew outdated cmake || brew upgrade cmake
else
brew install cmake
fi
# gcc
if [[ "${COMPILER}" = "g++-5" ]]; then
brew install gcc5
fi
fi
before_script:
- ${COMPILER} --version
- cmake --version
script:
# sanitizer options
- export ASAN_OPTIONS=allow_addr2line=true:check_initialization_order=true:strict_init_order=true:strict_string_checks=true:detect_odr_violation=2:detect_stack_use_after_return=true:verbosity=0
# prepare generated code for mutation performance test
- cd perf/mutation_perf
- ruby generate.rb
- cd ../..
# mtime_cache for faster builds
- ruby tools/mtime_cache **/*.{%{cpp}} -c .mtime_cache/cache.json
# build all in debug and release
# run unit tests and performance tests
- mkdir -p debug_build
- cd debug_build
- cmake -DCMAKE_CXX_COMPILER=$COMPILER .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="${ADDITIONAL_CXX_FLAGS} -fvisibility=hidden" -DDYNAMIX_BUILD_PERF=1
- make -j2
- ctest --output-on-failure
- ./message_perf
- ./mutation_perf
- cd ..
- mkdir -p release_build
- cd release_build
- cmake -DCMAKE_CXX_COMPILER=$COMPILER .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="${ADDITIONAL_CXX_FLAGS} -fvisibility=hidden" -DDYNAMIX_BUILD_PERF=1
- make -j2
- ctest --output-on_failure
- ./message_perf --test-perf-regression
- ./mutation_perf --test-perf-regression
- cd ..
# build and run only unit tests with a custom config file
- mkdir -p cc_debug
- cd cc_debug
- cmake .. -DCMAKE_CXX_COMPILER=$COMPILER -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="${ADDITIONAL_CXX_FLAGS} -fno-rtti" -DDYNAMIX_BUILD_PERF=0 -DDYNAMIX_BUILD_EXAMPLES=0 -DDYNAMIX_BUILD_TUTORIALS=0 -DDYNAMIX_BUILD_SCRATCH=0 -DDYNAMIX_CUSTOM_CONFIG_FILE="\"$PWD/../test/custom_config/custom_config.hpp\""
- make -j2
- ctest --output-on_failure
- cd ..
- mkdir -p cc_release
- cd cc_release
- cmake .. -DCMAKE_CXX_COMPILER=$COMPILER -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="${ADDITIONAL_CXX_FLAGS} -fno-rtti" -DDYNAMIX_BUILD_PERF=0 -DDYNAMIX_BUILD_EXAMPLES=0 -DDYNAMIX_BUILD_TUTORIALS=0 -DDYNAMIX_BUILD_SCRATCH=0 -DDYNAMIX_CUSTOM_CONFIG_FILE="\"$PWD/../test/custom_config/custom_config.hpp\""
- make -j2
- ctest --output-on_failure
- cd ..
# build and run only unit tests with DynaMix as a static lib
- mkdir -p static_debug
- cd static_debug
- cmake .. -DCMAKE_CXX_COMPILER=$COMPILER -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="${ADDITIONAL_CXX_FLAGS}" -DDYNAMIX_SHARED_LIB=0 -DDYNAMIX_BUILD_EXAMPLES=0 -DDYNAMIX_BUILD_TUTORIALS=0 -DDYNAMIX_BUILD_SCRATCH=0
- make -j2
- ctest --output-on_failure
- cd ..
- mkdir -p static_release
- cd static_release
- cmake .. -DCMAKE_CXX_COMPILER=$COMPILER -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="${ADDITIONAL_CXX_FLAGS}" -DDYNAMIX_SHARED_LIB=0 -DDYNAMIX_BUILD_EXAMPLES=0 -DDYNAMIX_BUILD_TUTORIALS=0 -DDYNAMIX_BUILD_SCRATCH=0
- make -j2
- ctest --output-on_failure