sudo: false

language: c

compiler:
  - gcc
  - clang

addons:
  apt:
    sources:
    - ubuntu-toolchain-r-test
    packages:
    - gcc-4.8

before_script:
    # force newer gcc version
  - if [ "$CC" = "gcc" ]; then export CC="gcc-4.8"; fi
    # show which tests failed
  - export CTEST_OUTPUT_ON_FAILURE=1

script:
  - mkdir build && cd build && cmake ../samples && make -j2 && cd .. && rm -rf build
  - mkdir build && cd build && cmake ../tests && make -j2 && make test && cd .. && rm -rf build
