snappy/.travis.yml

90 lines
2.3 KiB
YAML
Raw Normal View History

# Build matrix / environment variables are explained on:
# http://about.travis-ci.org/docs/user/build-configuration/
# This file can be validated on: http://lint.travis-ci.org/
language: cpp
dist: xenial
osx_image: xcode10.2
compiler:
- gcc
- clang
os:
- linux
- osx
env:
- BUILD_TYPE=Debug CPU_LEVEL=AVX
- BUILD_TYPE=Debug CPU_LEVEL=AVX2
- BUILD_TYPE=RelWithDebInfo CPU_LEVEL=AVX
- BUILD_TYPE=RelWithDebInfo CPU_LEVEL=AVX2
matrix:
exclude:
# Travis OSX servers seem to run on pre-Haswell CPUs. Attempting to use AVX2
# results in crashes.
- env: BUILD_TYPE=Debug CPU_LEVEL=AVX2
os: osx
- env: BUILD_TYPE=RelWithDebInfo CPU_LEVEL=AVX2
os: osx
addons:
apt:
sources:
- llvm-toolchain-xenial-8
- ubuntu-toolchain-r-test
packages:
- clang-8
- cmake
- gcc-9
- g++-9
- ninja-build
homebrew:
packages:
- cmake
- gcc@9
- llvm@8
- ninja
update: true
install:
# The following Homebrew packages aren't linked by default, and need to be
# prepended to the path explicitly.
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then
export PATH="$(brew --prefix llvm)/bin:$PATH";
fi
# /usr/bin/gcc points to an older compiler on both Linux and macOS.
- if [ "$CXX" = "g++" ]; then export CXX="g++-9" CC="gcc-9"; fi
# /usr/bin/clang points to an older compiler on both Linux and macOS.
#
# Homebrew's llvm package doesn't ship a versioned clang++ binary, so the values
# below don't work on macOS. Fortunately, the path change above makes the
# default values (clang and clang++) resolve to the correct compiler on macOS.
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then
if [ "$CXX" = "clang++" ]; then export CXX="clang++-8" CC="clang-8"; fi;
fi
- echo ${CC}
- echo ${CXX}
- ${CXX} --version
- cmake --version
before_script:
- mkdir -p build && cd build
2019-07-27 08:57:49 +00:00
- if [ "$CXX" = "clang++-8"; then
# Build UBSan binary
export CXXFLAGS="-fsanitize=undefined -fsanitize-coverage=bb,trace-pc-guard";
cmake .. -G Ninja -DCMAKE_BUILD_TYPE=$BUILD_TYPE
-DSNAPPY_REQUIRE_${CPU_LEVEL}=ON
2019-07-27 08:57:49 +00:00
-DSNAPPY_BUILD_FUZZERS=ON;
else
cmake .. -G Ninja -DCMAKE_BUILD_TYPE=$BUILD_TYPE
-DSNAPPY_REQUIRE_${CPU_LEVEL}=ON;
fi
- cmake --build .
- cd ..
script:
- build/snappy_unittest
- build/snappy_compress_uncompress_fuzzer -runs=1000 -close_fd_mask=3
- build/snappy_uncompress_fuzzer -runs=1000 -close_fd_mask=3