From 30efcea2ee82603efdc69ad212c0dfe5abb021d4 Mon Sep 17 00:00:00 2001 From: Victor Berger Date: Fri, 29 Sep 2017 17:38:47 +0200 Subject: [PATCH] travis: test various features combination --- .travis.yml | 62 ++++++++++++++++++++++++++++++++++++++++------------- Cargo.toml | 1 - src/lib.rs | 2 -- 3 files changed, 47 insertions(+), 18 deletions(-) diff --git a/.travis.yml b/.travis.yml index b215364..db9ec9c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,10 +9,6 @@ rust: - beta - nightly -matrix: - allow_failures: - - rust: nightly - os: - linux @@ -39,35 +35,71 @@ branches: before_script: - export PATH=$HOME/.local/bin:$HOME/.cargo/bin:$PATH - | - if [ $TRAVIS_RUST_VERSION = "nightly" ]; then + if [ "$FEATURES" = "cargo-fmt" ]; then cargo install rustfmt-nightly --force; fi + - | + if [ "$FEATURES" = "cargo-clippy" ]; then + cargo install clippy --force; + fi - mkdir $(pwd)/socket - export XDG_RUNTIME_DIR="$(pwd)/socket" script: - | - if [ $TRAVIS_RUST_VERSION = "nightly" ]; then - cargo fmt -- --write-mode=diff - fi - - | - features=$([ $TRAVIS_RUST_VERSION = "nightly" ] && echo "clippy" || echo "") - cargo test --features "$features" - - | - if [ $TRAVIS_RUST_VERSION = "stable" ]; then - cargo doc --no-deps - fi + case $FEATURES in + "all") + cargo test --all-features && + cargo doc --no-deps --all-features + ;; + "default") + cargo test && + cargo doc --no-deps + ;; + "cargo-fmt") + cargo fmt -- --write-mode=diff + ;; + "cargo-clippy") + cargo clippy --all-features -- -D warnings + ;; + *) + cargo test --lib --doc --tests --no-default-features --features "$FEATURES" && + cargo doc --no-deps --no-default-features --features "$FEATURES" + esac after_success: - | [ $TRAVIS_RUST_VERSION = "stable" ] && [ $TRAVIS_BRANCH = "master" ] && [ $TRAVIS_PULL_REQUEST = "false" ] && + [ $FEATURES = "all" ] && ./doc_upload.sh env: global: - RUST_BACKTRACE=1 - secure: lJjdHvIm6Pzimdik+SafO/MOWLLGY5TJdI7hWcwQ4+XNjuwncKx9ZJ8zqr2xClUKSALvUWB+vdu7i9wTWtsOYnDpyy8wuRvBZoaD5c8H2igsnzmGPPtP5KlPi5sEYvcCRY4vf9GDrvZm6tkNwMRsJBJ+2W/dSOTudMQA9mkdQcn5x24HVUBBOKEEuNy5ZOHZIj/+tre3USC8PbVvWyC5HHHjjEMBKR3F/BoaR1BJq2u4BdyDGTkfsoUa1zaTjApcZiEEK9KhoWDentkmlJHJCHKxC/zIZGhNx8ukw2yrms6j1k94jXB3rJP97q8UyNFcCO1HVO46EdLB6sFUPAW0CuDM27xIHDv+FyU3ICZVlpKQIK8YPJuLmQbCJFpVvEgfNfCIm+7+4jDci09FmHhuW+wQrTZDsRbCQz2gtVveeoE9/cZy5qAbI+UW4F25GGg9Ycxn+VOBU6Zdg8T9MLRRbHJXCzjMmJrNwK+6fEnCsMoVxwbRF9Fsh2JXS0PFdQgJSGtYYW31HEUEu4zrUuooJtz4CAgR+vB9oBxHfu6Y9GXZFmTsrUyuvGSl5vFB3AXLK6AP3BeXu3Bq2wQDy7ClQxvxkpN/eCKKxwV9vE9nRY0eD1sc6esv2gTjlV+gqs7V7JL8VvZulzZZ2gk6S/GhImCqyhJTqziKR7RXsPRZ2Zw= + matrix: + - FEATURES="" + # test individual features + - FEATURES="backend_winit" + - FEATURES="backend_drm" + - FEATURES="backend_libinput" + - FEATURES="renderer_glium" + # test default features + - FEATURES="default" + # test all features simultaneously + - FEATURES="all" + +matrix: + include: + # special features for lint & fmt + - rust: nightly + env: FEATURES="cargo-fmt" + - rust: nightly + env: FEATURES="cargo-clippy" + allow_failures: + - rust: nightly + notifications: webhooks: diff --git a/Cargo.toml b/Cargo.toml index 7291c30..b31f128 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,7 +18,6 @@ drm = { version = "=0.2.1", optional = true } gbm = { version = "=0.2.1", optional = true } glium = { version = "0.17.1", optional = true, default-features = false } input = { version = "0.2.0", optional = true } -clippy = { version = "*", optional = true } rental = "0.4.11" wayland-protocols = { version = "0.10.2", features = ["unstable_protocols", "server"] } image = "0.15.0" diff --git a/src/lib.rs b/src/lib.rs index bb9e7a8..28c4cbe 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -4,8 +4,6 @@ //! Most entry points in the modules can take an optionnal `slog::Logger` as argument //! that will be used as a drain for logging. If `None` is provided, they'll log to `slog-stdlog`. -#![cfg_attr(feature = "clippy", feature(plugin))] -#![cfg_attr(feature = "clippy", plugin(clippy))] // `error_chain!` can recurse deeply #![recursion_limit = "1024"]