• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1sudo: required
2dist: trusty
3language: cpp
4
5env:
6  global:
7    - /usr/local/bin:$PATH
8
9matrix:
10  include:
11    - compiler: gcc
12      addons:
13        apt:
14          packages:
15            - lcov
16      env: COMPILER=g++ C_COMPILER=gcc BUILD_TYPE=Coverage
17    - compiler: gcc
18      env: COMPILER=g++ C_COMPILER=gcc BUILD_TYPE=Debug
19    - compiler: gcc
20      env: COMPILER=g++ C_COMPILER=gcc BUILD_TYPE=Release
21    - compiler: gcc
22      addons:
23        apt:
24          packages:
25            - g++-multilib
26      env: COMPILER=g++ C_COMPILER=gcc BUILD_TYPE=Debug BUILD_32_BITS=ON
27    - compiler: gcc
28      addons:
29        apt:
30          packages:
31            - g++-multilib
32      env: COMPILER=g++ C_COMPILER=gcc BUILD_TYPE=Release BUILD_32_BITS=ON
33    - compiler: gcc
34      env:
35        - INSTALL_GCC6_FROM_PPA=1
36        - COMPILER=g++-6 C_COMPILER=gcc-6  BUILD_TYPE=Debug
37        - ENABLE_SANITIZER=1
38        - EXTRA_FLAGS="-fno-omit-frame-pointer -g -O2 -fsanitize=undefined,address -fuse-ld=gold"
39    - compiler: clang
40      env: COMPILER=clang++ C_COMPILER=clang BUILD_TYPE=Debug
41    - compiler: clang
42      env: COMPILER=clang++ C_COMPILER=clang BUILD_TYPE=Release
43    # Clang w/ libc++
44    - compiler: clang
45      addons:
46        apt:
47          packages:
48            clang-3.8
49      env:
50        - COMPILER=clang++-3.8 C_COMPILER=clang-3.8 BUILD_TYPE=Debug
51        - LIBCXX_BUILD=1
52        - EXTRA_FLAGS="-stdlib=libc++"
53    - compiler: clang
54      addons:
55        apt:
56          packages:
57            clang-3.8
58      env:
59        - COMPILER=clang++-3.8 C_COMPILER=clang-3.8 BUILD_TYPE=Release
60        - LIBCXX_BUILD=1
61        - EXTRA_FLAGS="-stdlib=libc++"
62    # Clang w/ 32bit libc++
63    - compiler: clang
64      addons:
65        apt:
66          packages:
67            - clang-3.8
68            - g++-multilib
69      env:
70        - COMPILER=clang++-3.8 C_COMPILER=clang-3.8 BUILD_TYPE=Debug
71        - LIBCXX_BUILD=1
72        - BUILD_32_BITS=ON
73        - EXTRA_FLAGS="-stdlib=libc++ -m32"
74    # Clang w/ 32bit libc++
75    - compiler: clang
76      addons:
77        apt:
78          packages:
79            - clang-3.8
80            - g++-multilib
81      env:
82        - COMPILER=clang++-3.8 C_COMPILER=clang-3.8 BUILD_TYPE=Release
83        - LIBCXX_BUILD=1
84        - BUILD_32_BITS=ON
85        - EXTRA_FLAGS="-stdlib=libc++ -m32"
86    # Clang w/ libc++, ASAN, UBSAN
87    - compiler: clang
88      addons:
89        apt:
90          packages:
91            clang-3.8
92      env:
93        - COMPILER=clang++-3.8 C_COMPILER=clang-3.8 BUILD_TYPE=Debug
94        - LIBCXX_BUILD=1 LIBCXX_SANITIZER="Undefined;Address"
95        - ENABLE_SANITIZER=1
96        - EXTRA_FLAGS="-stdlib=libc++ -g -O2 -fno-omit-frame-pointer -fsanitize=undefined,address -fno-sanitize-recover=all"
97        - UBSAN_OPTIONS=print_stacktrace=1
98    # Clang w/ libc++ and MSAN
99    - compiler: clang
100      addons:
101        apt:
102          packages:
103            clang-3.8
104      env:
105        - COMPILER=clang++-3.8 C_COMPILER=clang-3.8 BUILD_TYPE=Debug
106        - LIBCXX_BUILD=1 LIBCXX_SANITIZER=MemoryWithOrigins
107        - ENABLE_SANITIZER=1
108        - EXTRA_FLAGS="-stdlib=libc++ -g -O2 -fno-omit-frame-pointer -fsanitize=memory -fsanitize-memory-track-origins"
109    # Clang w/ libc++ and MSAN
110    - compiler: clang
111      addons:
112        apt:
113          packages:
114            clang-3.8
115      env:
116        - COMPILER=clang++-3.8 C_COMPILER=clang-3.8 BUILD_TYPE=RelWithDebInfo
117        - LIBCXX_BUILD=1 LIBCXX_SANITIZER=Thread
118        - ENABLE_SANITIZER=1
119        - EXTRA_FLAGS="-stdlib=libc++ -g -O2 -fno-omit-frame-pointer -fsanitize=thread -fno-sanitize-recover=all"
120    - os: osx
121      osx_image: xcode8.3
122      compiler: clang
123      env:
124        - COMPILER=clang++ BUILD_TYPE=Debug
125    - os: osx
126      osx_image: xcode8.3
127      compiler: clang
128      env:
129        - COMPILER=clang++ BUILD_TYPE=Release
130    - os: osx
131      osx_image: xcode8.3
132      compiler: clang
133      env:
134        - COMPILER=clang++ BUILD_TYPE=Release BUILD_32_BITS=ON
135    - os: osx
136      osx_image: xcode8.3
137      compiler: gcc
138      env:
139        - COMPILER=g++-7 C_COMPILER=gcc-7  BUILD_TYPE=Debug
140
141before_script:
142  - if [ -n "${LIBCXX_BUILD}" ]; then
143      source .travis-libcxx-setup.sh;
144    fi
145  - if [ -n "${ENABLE_SANITIZER}" ]; then
146      export EXTRA_OPTIONS="-DBENCHMARK_ENABLE_ASSEMBLY_TESTS=OFF";
147    else
148      export EXTRA_OPTIONS="";
149    fi
150  - mkdir -p build && cd build
151
152before_install:
153  - if [ -z "$BUILD_32_BITS" ]; then
154      export BUILD_32_BITS=OFF && echo disabling 32 bit build;
155    fi
156  - if [ -n "${INSTALL_GCC6_FROM_PPA}" ]; then
157      sudo add-apt-repository -y "ppa:ubuntu-toolchain-r/test";
158      sudo apt-get update --option Acquire::Retries=100 --option Acquire::http::Timeout="60";
159    fi
160
161install:
162  - if [ -n "${INSTALL_GCC6_FROM_PPA}" ]; then
163      travis_wait sudo -E apt-get -yq --no-install-suggests --no-install-recommends install g++-6;
164    fi
165  - if [ "${TRAVIS_OS_NAME}" == "linux" -a "${BUILD_32_BITS}" == "OFF" ]; then
166      travis_wait sudo -E apt-get -y --no-install-suggests --no-install-recommends install llvm-3.9-tools;
167      sudo cp /usr/lib/llvm-3.9/bin/FileCheck /usr/local/bin/;
168    fi
169  - if [ "${BUILD_TYPE}" == "Coverage" -a "${TRAVIS_OS_NAME}" == "linux" ]; then
170      PATH=~/.local/bin:${PATH};
171      pip install --user --upgrade pip;
172      travis_wait pip install --user cpp-coveralls;
173    fi
174  - if [ "${C_COMPILER}" == "gcc-7" -a "${TRAVIS_OS_NAME}" == "osx" ]; then
175      rm -f /usr/local/include/c++;
176      brew update;
177      travis_wait brew install gcc@7;
178    fi
179  - if [ "${TRAVIS_OS_NAME}" == "linux" ]; then
180      sudo apt-get update -qq;
181      sudo apt-get install -qq unzip;
182      wget https://github.com/bazelbuild/bazel/releases/download/0.10.1/bazel-0.10.1-installer-linux-x86_64.sh --output-document bazel-installer.sh;
183      travis_wait sudo bash bazel-installer.sh;
184    fi
185  - if [ "${TRAVIS_OS_NAME}" == "osx" ]; then
186      curl -L -o bazel-installer.sh https://github.com/bazelbuild/bazel/releases/download/0.10.1/bazel-0.10.1-installer-darwin-x86_64.sh;
187      travis_wait sudo bash bazel-installer.sh;
188    fi
189
190script:
191  - cmake -DCMAKE_C_COMPILER=${C_COMPILER} -DCMAKE_CXX_COMPILER=${COMPILER} -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DCMAKE_CXX_FLAGS="${EXTRA_FLAGS}" -DBENCHMARK_DOWNLOAD_DEPENDENCIES=ON -DBENCHMARK_BUILD_32_BITS=${BUILD_32_BITS} ${EXTRA_OPTIONS} ..
192  - make
193  - ctest -C ${BUILD_TYPE} --output-on-failure
194  - bazel test -c dbg --define google_benchmark.have_regex=posix --announce_rc --verbose_failures --test_output=errors --keep_going //test/...
195
196after_success:
197  - if [ "${BUILD_TYPE}" == "Coverage" -a "${TRAVIS_OS_NAME}" == "linux" ]; then
198      coveralls --include src --include include --gcov-options '\-lp' --root .. --build-root .;
199    fi
200