dist: xenial
language: rust
rust:
- nightly
- stable
addons:
  apt:
    packages:
    - libgtk-3-dev
    - libssh2-1-dev
script:
  - test "$TRAVIS_RUST_VERSION" == "nightly" || rustup component add rustfmt clippy
  - test "$TRAVIS_RUST_VERSION" == "nightly" || cargo clippy --release
  - test "$TRAVIS_RUST_VERSION" == "nightly" || cargo fmt -- --check
  - cargo build --release
  - cargo test --release
  - git clone -q https://github.com/gtk-rs/gir-files tests/gir-files
  - ./tests/sys/test.sh
  # check if generation generated something buildable
  - git clone -q https://github.com/gtk-rs/gtk gtk-test
  - git clone -q https://github.com/gtk-rs/gir-files gtk-gir-files
  - cd gtk-test
  - ../target/release/gir -d ../gtk-gir-files/  -o .
  - rm ../Cargo.*
  - cargo build

dist: xenial
language: rust
rust:
- nightly
- stable
addons:
  apt:
    packages:
    - libgtk-3-dev
    - libssh2-1-dev
script:
  - test "$TRAVIS_RUST_VERSION" == "nightly" || rustup component add rustfmt clippy
  - test "$TRAVIS_RUST_VERSION" == "nightly" || cargo clippy --release
  - test "$TRAVIS_RUST_VERSION" == "nightly" || cargo fmt -- --check
  - cargo build --release
  - cargo test --release
  - git clone -q https://github.com/gtk-rs/gir-files tests/gir-files
  - ./tests/sys/test.sh
  # check if generation generated something buildable
  - git clone -q https://github.com/gtk-rs/gtk gtk-test
  - git clone -q https://github.com/gtk-rs/gir-files gtk-gir-files
  - cd gtk-test
  - ../target/release/gir -d ../gtk-gir-files/  -o .
  - rm ../Cargo.*
  - cargo build
  # This part is used to check that no unforeseen failures appear.
  # A good example was the transmute calls removal for callbacks.
  - cd ..
  - git clone -q https://github.com/gtk-rs/gio
  - cd gio
  - git submodule update --init
  - ../target/release/gir -d gir-files  -o .
  - cargo test

Add a check to avoid unforeseen failures
Add a check to avoid unforeseen failures
