sudo: required
dist: trusty
language: cpp

addons:
  apt:
    sources:
      - ubuntu-toolchain-r-test
    packages:
      - valgrind
      - libstdc++-5-dev  # default version is not valgrind-clean

# test_layers takes a long time; divide up the work into multiple jobs on the
# matrix so we don't time out on Travis
matrix:
  include:
    - env: COMMAND=./test_layers CXX=clang++ START=000 END=040
    - env: COMMAND=./test_layers CXX=clang++ START=040 END=055
    - env: COMMAND=./test_layers CXX=clang++ START=055 END=065
    - env: COMMAND=./test_layers CXX=clang++ START=065 END=070
    - env: COMMAND=./test_layers CXX=clang++ START=070 END=075
    - env: COMMAND=./test_layers CXX=clang++ START=075 END=080
    - env: COMMAND=./test_layers CXX=clang++ START=080 END=085
    - env: COMMAND=./test_layers CXX=clang++ START=085 END=090
    - env: COMMAND=./test_layers CXX=clang++ START=090 END=095
    - env: COMMAND=./test_layers CXX=clang++ START=095 END=999  # overflow; will start timing out if we add too many layers
    - env: COMMAND=./test_layers CXX=clang++ START=chessboard
    - env: COMMAND=./test_layers CXX=clang++ START=edit
    - env: COMMAND=./test_layers CXX=clang++ START=edit2
    - env: COMMAND=./test_layers CXX=clang++ START=edit3
    - env: COMMAND=./test_layers CXX=clang++ START=edit4
    - env: COMMAND=./test_layers CXX=g++ START=one-off  # minimal testing for gcc
    # other build scripts
    - env: COMMAND=./test_layers BUILD=build0 START=one-off
    - env: COMMAND=./test_layers BUILD=build1 START=one-off
    - env: COMMAND=./test_layers BUILD=build2 START=one-off
    # other directories
    - env: COMMAND=./subx/test_layers
    - env: COMMAND=./subx/test_apps

script:
  - $COMMAND $START $END

notifications:
  email:
    on_success: never
    on_failure: always
