language: rust
sudo: false
rust:
    - stable
    - beta
    - nightly
matrix:
    allow_failures:
        - rust: nightly



sudo: false

language: rust

rust:
    - stable
    - beta
    - nightly

matrix:
    fast_finish: true
    allow_failures:
        - rust: nightly
    # I'd love to just use travis-cargo for all this, but it's broken:
    # https://github.com/huonw/travis-cargo/pull/58
    exclude:
        - rust: stable
    include:
        - rust: stable
          env: RUSTFLAGS="-C link-dead-code"
          addons:
              apt:
                  packages:
                      - libcurl4-openssl-dev
                      - libelf-dev
                      - libdw-dev
                      - binutils-dev
          after_success:
             - |
                 # Fetch and build kcov
                 wget "https://github.com/SimonKagstrom/kcov/archive/master.zip"
                 unzip master.zip
                 mkdir kcov-master/build
                 pushd kcov-master/build
                 cmake ..
                 make
                 popd

                 # Run each binary under kcov
                 for binary in target/debug/portier_broker-*; do
                     echo "Generating coverage for $binary"
                     ./kcov-master/build/src/kcov --verify --exclude-pattern=/.cargo,target/debug target/kcov/ $binary
                 done

                 echo "Merging and uploading coverage"
                 ./kcov-master/build/src/kcov --merge --coveralls-id="$TRAVIS_JOB_ID" target/kcov-merged target/kcov/portier_broker-*

Use kcov to report test coverage to Coveralls
Use kcov to report test coverage to Coveralls

Fixes #5
