fermium 0.0.13

An opinionated crate of SDL2 bindings.
Documentation

language: rust
git:
  quiet: true

rust:
  - stable

cache:
  cargo

os:
  - linux
  - osx

before_script:
  # Make sure we have the bindgen cli program up to date
  - rustup component add rustfmt
  - (test -x $HOME/.cargo/bin/cargo-install-update || cargo install cargo-update)
  - (test -x $HOME/.cargo/bin/bindgen || cargo install bindgen)
  - cargo install-update -a
  - |

    if [[ $TRAVIS_OS == "osx" ]]
    then
      # https://formulae.brew.sh/formula/sdl2#default
      brew install sdl2
    else
      # the package managers often have very old versions of SDL2, we just build
      # the correct version from source
      sudo ./install-sdl2.sh
    fi
  - sdl2-config --cflags
  - sdl2-config --libs
  - sdl2-config --static-libs

script:
  # We cannot run doctests because rustdoc is silly and tries to interpret too
  # much stuff as code blocks and then dies when the "code blocks" don't contain
  # valid rust. https://github.com/rust-lang/rust/issues/59867 We should still
  # run all the other tests of course.

  # First we verify the pre-generated bindings.
  - cargo build
  - cargo build --examples
  - cargo test --lib --tests

  # Next we attempt with `use_bindgen_bin`
  - cargo clean
  - cargo build --features="use_bindgen_bin"
  - cargo build --features="use_bindgen_bin" --examples
  - cargo test  --features="use_bindgen_bin" --lib --tests

  # Next we attempt with `use_bindgen_lib`
  - cargo clean
  - cargo build --features="use_bindgen_lib"
  - cargo build --features="use_bindgen_lib" --examples
  - cargo test  --features="use_bindgen_lib" --lib --tests
  
  # Next we attempt with `dynamic_link` (using builtin bindings)
  - cargo clean
  - cargo build --features="dynamic_link"
  - cargo build --features="dynamic_link" --examples
  - cargo test  --features="dynamic_link" --lib --tests