language: cpp

compiler:
  - gcc
  - clang

before_install:
  - sudo apt-get update -qq
  - wget https://github.com/boostorg/build/raw/develop/src/contrib/boost.jam -O ~/boost.jam
  - echo -e 'import boost ;\nboost.use-project ;\n using gcc ;\n using clang ;\n using python ;' > ~/user-config.jam
  - cat ~/user-config.jam

install:
  - sudo apt-get install -qq libboost1.48-all-dev

# It just so happens that ${CC} corresponds to the Boost.Build toolset name.
script: ./test/bjam_test_in_parent_directory.sh toolset=${CC} variant=${VARIANT}

env:
  - VARIANT=debug
  - VARIANT=release

branches:
  only:
    - master
    - travis-test

language: cpp

compiler:
  - gcc
  - clang

env:
  - VARIANT=debug
  - VARIANT=release

before_install:
  - sudo apt-get update -qq
  - wget https://github.com/boostorg/build/raw/develop/src/contrib/boost.jam -O ~/boost.jam
  - echo -e 'import boost ;\nboost.use-project ;\n using gcc ;\n using clang ;\n using python ;' > ~/user-config.jam
  - cat ~/user-config.jam

install:
  - sudo apt-get install -qq libboost1.48-all-dev python-dev
  - sudo apt-get install -qq lcov
  - gem install coveralls-lcov

# It just so happens that ${CC} corresponds to the Boost.Build toolset name.
script:
  # For debug builds, compute coverage of tests.
  - if [ "$VARIANT" == "debug" ]; then
      COVERAGE="cxxflags='--coverage' linkflags='--coverage'";
    else
      COVERAGE="";
    fi;
    ./test/bjam_test_in_parent_directory.sh toolset=${CC} variant=${VARIANT} ${COVERAGE};

after_success:
  # For debug builds, report coverage on coveralls.io.
  # Run lcov and then coveralls-lcov as per README at
  #   https://github.com/okkez/coveralls-lcov
  - if [ "$VARIANT" == "debug" ]; then
      cd ../range-test;
      mkdir coverage-data/;
      cp `find bin -name '*.gcno'` coverage-data/;
      cp `find bin -name '*.gcda'` coverage-data/;
      mkdir coverage/;
      lcov --compat-libtool --directory coverage-data --base-directory ./ --capture --output-file coverage/coverage.info;
      lcov --extract coverage/coverage.info `pwd`/range/'*' -o coverage/coverage.info.cleaned;
      coveralls-lcov coverage/coverage.info.cleaned;
    fi

Set up unit test coverage configuration
Set up unit test coverage configuration

Coverage is checked as part of the continuous integration tests on Travis CI.
This runs only on the debug builds.
It uses gcov and lcov, and then uploads the coverage statistics to coveralls.io.
