diff --git a/.travis.yml b/.travis.yml index a1be31d67f4..21dfc6c7bec 100644 --- a/.travis.yml +++ b/.travis.yml @@ -31,10 +31,9 @@ matrix: - env: INTEGRATION=rand - env: INTEGRATION=rust-clippy - env: INTEGRATION=rust-semverver - - env: INTEGRATION=stdsimd - env: INTEGRATION=tempdir allow_failures: - # Need to run an lalrpop build step before testing? + # See: https://github.com/rust-lang-nursery/rustfmt/issues/2789 - env: INTEGRATION=chalk # PR sent - env: INTEGRATION=crater @@ -42,8 +41,8 @@ matrix: - env: INTEGRATION=rand # Doesn't build - env: INTEGRATION=rust-clippy - # Doesn't build - - env: INTEGRATION=rust-semverver + # See: https://github.com/rust-lang-nursery/rustfmt/issues/2787 + - env: INTEGRATION=stdsimd before_script: - | diff --git a/ci/integration.sh b/ci/integration.sh index 0bce1671d4e..461effbf557 100755 --- a/ci/integration.sh +++ b/ci/integration.sh @@ -20,10 +20,15 @@ cargo install --force echo "Integration tests for: ${INTEGRATION}" cargo fmt -- --version +# Checks that: +# +# * `cargo fmt --all` succeeds without any warnings or errors +# * `cargo fmt --all -- --check` after formatting returns success +# * `cargo test -all` still passes (formatting did not break the build) function check_fmt { touch rustfmt.toml - cargo fmt --all -v 2>&1 | tee rustfmt_output - if [[ $? != 0 ]]; then + cargo fmt --all -v |& tee rustfmt_output + if [[ ${PIPESTATUS[0]} != 0 ]]; then cat rustfmt_output return 1 fi @@ -40,6 +45,11 @@ function check_fmt { if [[ $? != 0 ]]; then return 1 fi + cargo fmt --all -- --check |& tee rustfmt_check_output + if [[ ${PIPESTATUS[0]} != 0 ]]; then + cat rustfmt_check_output + return 1 + fi cargo test --all if [[ $? != 0 ]]; then return $?