2015-02-19 19:36:43 +01:00
language : cpp
2015-04-08 17:01:14 +02:00
sudo : required
2016-02-11 03:11:39 +01:00
dist : trusty
2015-02-19 19:36:43 +01:00
compiler :
- gcc
2016-02-11 03:08:32 +01:00
- clang
2016-02-11 04:26:26 +01:00
os :
- linux
- osx
2016-02-11 03:16:18 +01:00
addons :
apt :
2016-03-04 01:29:27 +01:00
sources :
# Both needed for clang 3.7
- llvm-toolchain-precise-3.7
- ubuntu-toolchain-r-test
2016-02-11 03:16:18 +01:00
packages :
2016-03-04 01:29:27 +01:00
- clang-3.7
2016-02-11 03:16:18 +01:00
- libcrypto++-dev
2016-02-11 12:14:44 +01:00
- libfuse-dev
2015-02-20 02:02:35 +01:00
install :
2016-07-22 13:05:59 +02:00
# Use new clang on linux
2016-03-04 01:29:27 +01:00
- if [ "${TRAVIS_OS_NAME}" == "linux" ] && [ "$CXX" = "clang++" ]; then export CXX="clang++-3.7" CC="clang-3.7"; fi
2016-07-22 13:05:59 +02:00
# If using gcc on mac, actually use it ("gcc" just links to clang, but "gcc-4.8" is gcc, https://github.com/travis-ci/travis-ci/issues/2423)
- if [ "${TRAVIS_OS_NAME}" == "osx" ] && ["${CXX}" = "g++" ]; then export CXX="g++-4.8" CC="gcc-4.8"; fi
2016-02-12 22:10:06 +01:00
# Detect number of CPU cores
2016-02-12 18:30:20 +01:00
- export NUMCORES=`grep -c ^processor /proc/cpuinfo` && if [ ! -n "$NUMCORES" ]; then export NUMCORES=`sysctl -n hw.ncpu`; fi
2016-02-12 13:11:11 +01:00
- echo Using $NUMCORES cores
2016-03-04 01:29:27 +01:00
# Install dependencies
2016-02-17 09:13:02 +01:00
- if [ "${TRAVIS_OS_NAME}" == "linux" ]; then ./travis.install_boost.sh; fi
2016-10-05 10:05:02 +02:00
- if [ "${TRAVIS_OS_NAME}" == "osx" ]; then brew cask install osxfuse && brew install cryptopp; fi
2016-07-22 02:56:15 +02:00
# By default, travis only fetches the newest 50 commits. We need more in case we're further from the last version tag, so the build doesn't fail because it can't generate the version number.
- git fetch --unshallow
2016-07-22 20:46:02 +02:00
# Setup target directory
2016-02-11 14:23:14 +01:00
- mkdir cmake
- cd cmake
2015-10-28 10:02:58 +01:00
- cmake --version
2015-09-07 16:44:40 +02:00
# Use /dev/urandom when /dev/random is accessed, because travis doesn't have enough entropy
2015-09-07 16:43:30 +02:00
- sudo cp -a /dev/urandom /dev/random
2015-02-19 19:36:43 +01:00
script :
2016-02-15 04:27:10 +01:00
- cmake .. -DBUILD_TESTING=on -DCMAKE_BUILD_TYPE=Debug
2016-02-12 22:10:06 +01:00
- make -j$NUMCORES
2016-03-02 13:53:37 +01:00
- ./test/gitversion/gitversion-test
2016-02-11 14:37:10 +01:00
- ./test/cpp-utils/cpp-utils-test
2016-02-17 10:53:23 +01:00
# TODO Also run on osx once fixed
2016-07-22 20:46:02 +02:00
- if [ "${TRAVIS_OS_NAME}" == "linux" ]; then ./test/fspp/fspp-test || exit 1; fi
2016-02-11 14:37:10 +01:00
- ./test/parallelaccessstore/parallelaccessstore-test
2016-02-11 14:44:28 +01:00
- ./test/blockstore/blockstore-test
2016-02-11 14:50:18 +01:00
- ./test/blobstore/blobstore-test
2016-02-17 10:53:23 +01:00
# TODO Also run on osx once fixed
2016-04-02 10:06:22 +02:00
- if [ "${TRAVIS_OS_NAME}" == "linux" ]; then ./test/cryfs/cryfs-test || exit 1; fi
- if [ "${TRAVIS_OS_NAME}" == "linux" ]; then ./test/cryfs-cli/cryfs-cli-test || exit 1; fi