sudo: false
language: c

# Build matrix
compiler:
  - gcc
  - clang

env:
  - CGREEN_WITH_STATIC_LIBRARY="OFF"
  - CGREEN_WITH_STATIC_LIBRARY="ON"

addons:
  apt:
    packages:
    - cmake
    - lcov
    - g++

before_install:
  - if [[ $CC == gcc ]] ; then export CXX=g++ ; else export CXX=clang++ ; fi
  - $CC --version
  - $CXX --version
  - gem install coveralls-lcov
  - if [ "$CC" = "gcc" ]; then export WITH_GCOV=ON; else WITH_GCOV=OFF; fi

script:
  - mkdir -p build
  - cd build
  - cmake -DCGREEN_WITH_UNIT_TESTS:BOOL=ON -DCGREEN_WITH_STATIC_LIBRARY:BOOL=$CGREEN_WITH_STATIC_LIBRARY -DCGREEN_INTERNAL_WITH_GCOV:BOOL=$WITH_GCOV ..
  - make -j2
  - ctest --output-on-failure

after_success:
  - if [ "$CC" = "gcc" ];
    then
      lcov -d tests -d src -base-directory .. -c -o coverage.info;
      lcov --remove coverage.info '/usr/*' -o coverage.info;
      cd ..;
      coveralls-lcov build/coverage.info;
    fi

notifications:
  slack: cgreen:EC3bZqwnyBsaqyeIndEewwNT

sudo: false
language: c

# Build matrix
compiler:
  - gcc
  - clang

env:
  - CGREEN_WITH_STATIC_LIBRARY="OFF"
  - CGREEN_WITH_STATIC_LIBRARY="ON"

addons:
  apt:
    packages:
    - cmake
    - lcov
    - g++

before_install:
  - if [[ $CC == gcc ]] ; then export CXX=g++ ; else export CXX=clang++ ; fi
  - $CC --version
  - $CXX --version
  - gem install coveralls-lcov
  - if [ "$CC" = "gcc" ]; then export WITH_GCOV=ON; else WITH_GCOV=OFF; fi

script:
  - mkdir -p build
  - cd build
  - cmake -DCGREEN_WITH_UNIT_TESTS:BOOL=ON -DCGREEN_WITH_STATIC_LIBRARY:BOOL=$CGREEN_WITH_STATIC_LIBRARY -DCGREEN_INTERNAL_WITH_GCOV:BOOL=$WITH_GCOV ..
  - make -j2
  - ctest --output-on-failure

after_success:
  - if [ "$CC" = "gcc" ];
    then
      lcov -d tests -d src -d tools -base-directory .. -c -o coverage.info;
      lcov --remove coverage.info '/usr/*' -o coverage.info;
      cd ..;
      coveralls-lcov build/coverage.info;
    fi

notifications:
  slack: cgreen:EC3bZqwnyBsaqyeIndEewwNT

Add tools directory to coverage
Add tools directory to coverage
