language: cpp

sudo: false

compiler:
  - clang
  - gcc

env:
  - BUILD_TYPE=Debug    VALGRIND=true   SANITIZE='' 
  - BUILD_TYPE=Debug    VALGRIND=false  SANITIZE=undefined 
#  - BUILD_TYPE=Debug    VALGRIND=false  SANITIZE=address 
  - BUILD_TYPE=Release  VALGRIND=false  SANITIZE=''

addons:
  apt:
    sources:
      - llvm-toolchain-trusty-3.8
      - ubuntu-toolchain-r-test
    packages:
      - clang-3.8
      - g++-5
      - valgrind

install:
  - if [ "$CXX" = "g++" ]; then export CXX="g++-5"; fi
  - if [ "$CXX" = "clang++" ]; then export CXX="clang++-3.8"; fi

script: 
  - cmake -DCMAKE_BUILD_TYPE="${BUILD_TYPE}" -DSANITIZE="${SANITIZE}" .
  - make
  - if [ "${VALGRIND}" = "true" ]; then
      travis_wait valgrind --leak-check=full --track-origins=yes --error-exitcode=1 testsuite/cpp-sort-testsuite --rng-seed $RANDOM;
    else
      testsuite/cpp-sort-testsuite --rng-seed $RANDOM;
    fi

notifications:
  email: false

language: cpp

sudo: false

compiler:
  - clang
  - gcc

env:
  - BUILD_TYPE=Debug    VALGRIND=true   SANITIZE='' 
  - BUILD_TYPE=Debug    VALGRIND=false  SANITIZE=undefined 
#  - BUILD_TYPE=Debug    VALGRIND=false  SANITIZE=address 
  - BUILD_TYPE=Release  VALGRIND=false  SANITIZE=''

addons:
  apt:
    sources:
      - llvm-toolchain-trusty-3.8
      - ubuntu-toolchain-r-test
    packages:
      - clang-3.8
      - g++-5
      - valgrind

install:
  - if [ "$CXX" = "g++" ]; then export CXX="g++-5"; fi
  - if [ "$CXX" = "clang++" ]; then export CXX="clang++-3.8"; fi

script: 
  - mkdir build
  - cd build
  - cmake -DCMAKE_BUILD_TYPE="${BUILD_TYPE}" -DSANITIZE="${SANITIZE}" ..
  - cmake --build .
  - if [ "${VALGRIND}" = "true" ]; then
      travis_wait valgrind --leak-check=full --track-origins=yes --error-exitcode=1 testsuite/cpp-sort-testsuite --rng-seed $RANDOM;
    else
      testsuite/cpp-sort-testsuite --rng-seed $RANDOM;
    fi

notifications:
  email: false

Build testsuite in a dedicated build directory
Build testsuite in a dedicated build directory
