5 : ${INTEGRATION?"The INTEGRATION environment variable must be set."}
7 # FIXME: this means we can get a stale cargo-fmt from a previous run.
9 # `which rustfmt` fails if rustfmt is not found. Since we don't install
10 # `rustfmt` via `rustup`, this is the case unless we manually install it. Once
11 # that happens, `cargo install --force` will be called, which installs
12 # `rustfmt`, `cargo-fmt`, etc to `~/.cargo/bin`. This directory is cached by
13 # travis (see `.travis.yml`'s "cache" key), such that build-bots that arrive
14 # here after the first installation will find `rustfmt` and won't need to build
17 #which cargo-fmt || cargo install --force
20 echo "Integration tests for: ${INTEGRATION}"
21 cargo fmt -- --version
25 cargo fmt --all -v 2>&1 | tee rustfmt_output
26 if [[ $? != 0 ]]; then
31 ! cat rustfmt_output | grep -q "internal error"
32 if [[ $? != 0 ]]; then
35 ! cat rustfmt_output | grep -q "warning"
36 if [[ $? != 0 ]]; then
39 ! cat rustfmt_output | grep -q "Warning"
40 if [[ $? != 0 ]]; then
44 if [[ $? != 0 ]]; then
49 case ${INTEGRATION} in
51 git clone --depth=1 https://github.com/rust-lang/${INTEGRATION}.git
53 export CFG_DISABLE_CROSS_TESTS=1
58 git clone --depth=1 https://github.com/rust-lang-nursery/${INTEGRATION}.git
59 cd ${INTEGRATION}/failure-1.X
64 git clone --depth=1 https://github.com/rust-lang-nursery/${INTEGRATION}.git