language: rust
rust:
  - stable
cache: cargo
# necessary for `travis-cargo coveralls --no-sudo`
addons:
  apt:
    packages:
      - libcurl4-openssl-dev
      - libelf-dev
      - libdw-dev
      - binutils-dev
notifications:
  slack:
    rooms:
      - way-cooler:W2vOSvJvgxGi7EiGkZCtvlB6#way-cooler
    on_success: :change
    on_failure: :change
  email: false
# load travis-cargo
before_script:
  - |
      git clone https://github.com/Timidger/travis-cargo
      (cd travis-cargo;
      pip install -e . --user &&
      export PATH=$HOME/.local/bin:$PATH)
script:
  - cargo install cargo-check
  - cargo check
  - cargo test --verbose

after_success:
  # measure code coverage and upload to coveralls.io (the verify
  # argument mitigates kcov crashes due to malformed debuginfo, at the
  # cost of some speed <https://github.com/huonw/travis-cargo/issues/12>)
  - travis-cargo coveralls --no-sudo --verify --exclude-pattern="main.rs,mod.rs,tests.rs,wayland_client_api.rs,callbacks.rs"

language: rust
rust:
  - stable
cache: cargo
# necessary for `travis-cargo coveralls --no-sudo`
addons:
  apt:
    packages:
      - libcurl4-openssl-dev
      - libelf-dev
      - libdw-dev
      - binutils-dev
notifications:
  slack:
    rooms:
      - way-cooler:W2vOSvJvgxGi7EiGkZCtvlB6#way-cooler
    on_success: :change
    on_failure: :change
  email: false
# install travis-cargo
before_script:
  - |
      git clone https://github.com/Timidger/travis-cargo
      (cd travis-cargo;
      pip install -e . --user &&
      export PATH=$HOME/.local/bin:$PATH)
script:
  - cargo install cargo-check
  - cargo check
  - cargo test --verbose

after_success:
  # Test and upload coverage to coveralls
  # Justification of excluded files:
  # main.rs: just initialization of logging, sigkill handler, and initializing lazy static objects. (Arg parsing should be moved into a different module and tested)
  # mod.rs: although at the moment we have too much code in various mod.rs's these are not really testable either way
  # tests.rs: should not be running on our tests themselves
  # wayland_client_api.rs: we really don't have a good way of testing any of this. At the moment it's simple enough that if it didn't work it would be obvious in user testing.
  # callbacks.rs: we don't have any integration tests for callbacks right now. They'd need to deal with the lazy statics that the other components of the program live in.
  - travis-cargo coveralls --no-sudo --verify --exclude-pattern="main.rs,mod.rs,tests.rs,wayland_client_api.rs,callbacks.rs"

Add some "justifications" for the excluded files
Add some "justifications" for the excluded files

At a certain point, our test stats went from "% of code lines in the program itself covered by unit tests" to "% of code lines in the parts of the program we're willing to write tests for that are covered by tests" - we have room for improvement in integration tests and should consider un-excluding the files we can't test in order to make the numbers more accurate.