2017-01-31 11:09:37 -06:00
|
|
|
#!/bin/bash
|
2017-01-31 11:17:33 -06:00
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
|
|
|
|
|
|
channel() {
|
|
|
|
if [ -n "${TRAVIS}" ]; then
|
|
|
|
if [ "${TRAVIS_RUST_VERSION}" = "${CHANNEL}" ]; then
|
|
|
|
pwd
|
|
|
|
(set -x; cargo "$@")
|
|
|
|
fi
|
2017-03-27 11:15:22 -05:00
|
|
|
elif [ -n "${APPVEYOR}" ]; then
|
|
|
|
if [ "${APPVEYOR_RUST_CHANNEL}" = "${CHANNEL}" ]; then
|
|
|
|
pwd
|
|
|
|
(set -x; cargo "$@")
|
|
|
|
fi
|
2017-01-31 11:09:37 -06:00
|
|
|
else
|
2017-01-31 11:17:33 -06:00
|
|
|
pwd
|
|
|
|
(set -x; cargo "+${CHANNEL}" "$@")
|
2017-01-31 11:09:37 -06:00
|
|
|
fi
|
2017-01-31 11:17:33 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
if [ -n "${CLIPPY}" ]; then
|
2017-02-01 02:38:02 -06:00
|
|
|
# cached installation will not work on a later nightly
|
|
|
|
if [ -n "${TRAVIS}" ] && ! cargo install clippy --debug --force; then
|
|
|
|
echo "COULD NOT COMPILE CLIPPY, IGNORING CLIPPY TESTS"
|
|
|
|
exit
|
2017-01-31 11:17:33 -06:00
|
|
|
fi
|
|
|
|
|
|
|
|
cd "$DIR/serde"
|
2017-04-10 19:01:11 -05:00
|
|
|
cargo clippy --features 'rc unstable' -- -Dclippy
|
2017-01-31 11:17:33 -06:00
|
|
|
|
|
|
|
cd "$DIR/serde_derive"
|
2017-04-10 19:29:54 -05:00
|
|
|
cargo clippy -- -Dclippy
|
2017-01-31 11:17:33 -06:00
|
|
|
|
2017-11-07 00:28:58 -06:00
|
|
|
cd "$DIR/serde_test"
|
|
|
|
cargo clippy -- -Dclippy
|
|
|
|
|
2017-01-31 11:17:33 -06:00
|
|
|
cd "$DIR/test_suite"
|
2017-03-08 23:02:15 -06:00
|
|
|
cargo clippy --features unstable -- -Dclippy
|
2017-01-31 11:17:33 -06:00
|
|
|
|
|
|
|
cd "$DIR/test_suite/no_std"
|
|
|
|
cargo clippy -- -Dclippy
|
2018-09-02 14:34:13 -05:00
|
|
|
elif [ -n "${EMSCRIPTEN}" ]; then
|
|
|
|
CARGO_WEB_RELEASE=$(curl -L -s -H 'Accept: application/json' https://github.com/koute/cargo-web/releases/latest)
|
|
|
|
CARGO_WEB_VERSION=$(echo "${CARGO_WEB_RELEASE}" | sed -e 's/.*"tag_name":"\([^"]*\)".*/\1/')
|
|
|
|
CARGO_WEB_URL="https://github.com/koute/cargo-web/releases/download/${CARGO_WEB_VERSION}/cargo-web-x86_64-unknown-linux-gnu.gz"
|
|
|
|
|
|
|
|
mkdir -p ~/.cargo/bin
|
|
|
|
echo "Downloading cargo-web from: ${CARGO_WEB_URL}"
|
|
|
|
curl -L "${CARGO_WEB_URL}" | gzip -d > ~/.cargo/bin/cargo-web
|
|
|
|
chmod +x ~/.cargo/bin/cargo-web
|
|
|
|
|
|
|
|
cd "$DIR/test_suite"
|
|
|
|
cargo web test --target=wasm32-unknown-emscripten --nodejs
|
2017-01-31 11:09:37 -06:00
|
|
|
else
|
2017-01-31 11:17:33 -06:00
|
|
|
CHANNEL=nightly
|
2017-07-21 01:31:47 -05:00
|
|
|
cd "$DIR"
|
2017-01-31 11:17:33 -06:00
|
|
|
cargo clean
|
|
|
|
cd "$DIR/serde"
|
|
|
|
channel build
|
|
|
|
channel build --no-default-features
|
|
|
|
channel build --no-default-features --features alloc
|
2018-08-20 20:30:43 -05:00
|
|
|
channel build --no-default-features --features 'rc alloc'
|
2017-04-10 19:01:11 -05:00
|
|
|
channel test --features 'rc unstable'
|
2017-01-31 11:17:33 -06:00
|
|
|
cd "$DIR/test_suite/deps"
|
|
|
|
channel build
|
|
|
|
cd "$DIR/test_suite"
|
2017-03-08 23:02:15 -06:00
|
|
|
channel test --features unstable
|
2018-05-21 11:23:22 -05:00
|
|
|
channel build --tests --features proc-macro2/nightly
|
2017-08-15 23:58:52 -05:00
|
|
|
if [ -z "${APPVEYOR}" ]; then
|
|
|
|
cd "$DIR/test_suite/no_std"
|
|
|
|
channel build
|
|
|
|
fi
|
2017-01-31 11:17:33 -06:00
|
|
|
|
|
|
|
CHANNEL=beta
|
2017-07-21 01:31:47 -05:00
|
|
|
cd "$DIR"
|
2017-01-31 11:17:33 -06:00
|
|
|
cargo clean
|
|
|
|
cd "$DIR/serde"
|
2017-04-10 19:01:11 -05:00
|
|
|
channel build --features rc
|
2017-01-31 11:17:33 -06:00
|
|
|
cd "$DIR/test_suite"
|
|
|
|
channel test
|
|
|
|
|
|
|
|
CHANNEL=stable
|
2017-07-21 01:31:47 -05:00
|
|
|
cd "$DIR"
|
2017-01-31 11:17:33 -06:00
|
|
|
cargo clean
|
|
|
|
cd "$DIR/serde"
|
2017-04-10 19:01:11 -05:00
|
|
|
channel build --features rc
|
2017-01-31 11:17:33 -06:00
|
|
|
channel build --no-default-features
|
2017-04-10 21:41:32 -05:00
|
|
|
cd "$DIR/serde_test"
|
|
|
|
channel build
|
2017-04-19 16:45:06 -05:00
|
|
|
channel test
|
2017-01-31 11:17:33 -06:00
|
|
|
|
|
|
|
CHANNEL=1.13.0
|
2017-07-21 01:31:47 -05:00
|
|
|
cd "$DIR"
|
2017-01-31 11:17:33 -06:00
|
|
|
cargo clean
|
|
|
|
cd "$DIR/serde"
|
2017-04-10 19:01:11 -05:00
|
|
|
channel build --features rc
|
2017-01-31 11:17:33 -06:00
|
|
|
channel build --no-default-features
|
2017-04-10 21:41:32 -05:00
|
|
|
cd "$DIR/serde_test"
|
|
|
|
channel build
|
2018-05-02 16:29:51 -05:00
|
|
|
|
|
|
|
CHANNEL=1.15.0
|
|
|
|
cd "$DIR"
|
|
|
|
cargo clean
|
|
|
|
cd "$DIR/serde_derive"
|
|
|
|
channel build
|
2018-06-03 03:26:51 -05:00
|
|
|
|
|
|
|
for CHANNEL in 1.20.0 1.21.0 1.25.0 1.26.0; do
|
|
|
|
cd "$DIR"
|
|
|
|
cargo clean
|
|
|
|
cd "$DIR/serde"
|
|
|
|
channel build --no-default-features
|
|
|
|
channel build
|
|
|
|
done
|
2017-01-31 11:17:33 -06:00
|
|
|
fi
|