2017-07-27 22:02:25 +02:00
|
|
|
set -euxo pipefail
|
2017-04-12 06:12:06 +02:00
|
|
|
|
|
|
|
main() {
|
2018-11-03 17:02:41 +01:00
|
|
|
local T=$TARGET
|
|
|
|
|
|
|
|
if [ $T = x86_64-unknown-linux-gnu ]; then
|
|
|
|
# compile-fail and compile-pass tests
|
2018-12-15 21:17:14 +01:00
|
|
|
case $TRAVIS_RUST_VERSION in
|
|
|
|
nightly*)
|
|
|
|
# TODO how to run a subset of these tests when timer-queue is disabled?
|
|
|
|
cargo test --features timer-queue --test compiletest --target $T
|
|
|
|
esac
|
2018-11-03 17:02:41 +01:00
|
|
|
|
|
|
|
cargo check --target $T
|
2018-12-16 19:34:16 +01:00
|
|
|
if [ $TARGET != thumbv6m-none-eabi ]; then
|
|
|
|
cargo check --features timer-queue --target $T
|
|
|
|
fi
|
2018-11-03 19:47:28 +01:00
|
|
|
|
2018-12-16 19:34:16 +01:00
|
|
|
if [ $TRAVIS_RUST_VERSION != nightly ]; then
|
2018-11-03 19:47:28 +01:00
|
|
|
rm -f .cargo/config
|
2018-12-16 19:34:16 +01:00
|
|
|
if [ $TARGET != thumbv6m-none-eabi ]; then
|
|
|
|
cargo doc --features timer-queue
|
|
|
|
else
|
|
|
|
cargo doc
|
|
|
|
fi
|
2018-11-03 19:47:28 +01:00
|
|
|
( cd book && mdbook build )
|
2019-02-08 19:58:55 +01:00
|
|
|
( cd ru && mdbook build )
|
2018-11-03 19:47:28 +01:00
|
|
|
|
|
|
|
local td=$(mktemp -d)
|
|
|
|
cp -r target/doc $td/api
|
|
|
|
cp -r book/book $td/
|
|
|
|
cp LICENSE-* $td/book/
|
|
|
|
|
|
|
|
linkchecker $td/book/
|
|
|
|
linkchecker $td/api/rtfm/
|
|
|
|
linkchecker $td/api/cortex_m_rtfm_macros/
|
|
|
|
fi
|
|
|
|
|
2017-04-12 06:12:06 +02:00
|
|
|
return
|
|
|
|
fi
|
|
|
|
|
2018-11-03 17:02:41 +01:00
|
|
|
cargo check --target $T --examples
|
2018-12-16 19:34:16 +01:00
|
|
|
if [ $TARGET != thumbv6m-none-eabi ]; then
|
|
|
|
cargo check --features timer-queue --target $T --examples
|
|
|
|
fi
|
2018-11-03 17:02:41 +01:00
|
|
|
|
|
|
|
# run-pass tests
|
|
|
|
case $T in
|
|
|
|
thumbv6m-none-eabi | thumbv7m-none-eabi)
|
|
|
|
local exs=(
|
|
|
|
idle
|
|
|
|
init
|
|
|
|
interrupt
|
|
|
|
|
|
|
|
resource
|
|
|
|
lock
|
|
|
|
late
|
|
|
|
static
|
|
|
|
|
|
|
|
task
|
|
|
|
message
|
|
|
|
capacity
|
|
|
|
|
|
|
|
singleton
|
|
|
|
|
|
|
|
types
|
|
|
|
not-send
|
|
|
|
not-sync
|
|
|
|
|
2018-11-04 18:50:42 +01:00
|
|
|
generics
|
2018-11-03 17:02:41 +01:00
|
|
|
ramfunc
|
|
|
|
)
|
|
|
|
|
|
|
|
for ex in ${exs[@]}; do
|
|
|
|
if [ $ex = ramfunc ] && [ $T = thumbv6m-none-eabi ]; then
|
|
|
|
# LLD doesn't support this at the moment
|
|
|
|
continue
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ $ex != types ]; then
|
|
|
|
cargo run --example $ex --target $T | \
|
|
|
|
diff -u ci/expected/$ex.run -
|
2017-12-23 21:34:24 +01:00
|
|
|
|
2018-11-03 17:02:41 +01:00
|
|
|
cargo run --example $ex --target $T --release | \
|
|
|
|
diff -u ci/expected/$ex.run -
|
|
|
|
fi
|
|
|
|
|
2018-12-16 19:34:16 +01:00
|
|
|
if [ $TARGET != thumbv6m-none-eabi ]; then
|
|
|
|
cargo run --features timer-queue --example $ex --target $T | \
|
|
|
|
diff -u ci/expected/$ex.run -
|
2018-11-03 17:02:41 +01:00
|
|
|
|
2018-12-16 19:34:16 +01:00
|
|
|
cargo run --features timer-queue --example $ex --target $T --release | \
|
|
|
|
diff -u ci/expected/$ex.run -
|
|
|
|
fi
|
2018-11-03 17:02:41 +01:00
|
|
|
done
|
|
|
|
esac
|
2017-04-12 06:12:06 +02:00
|
|
|
}
|
|
|
|
|
2018-11-03 17:02:41 +01:00
|
|
|
# fake Travis variables to be able to run this on a local machine
|
|
|
|
if [ -z ${TRAVIS_BRANCH-} ]; then
|
|
|
|
TRAVIS_BRANCH=auto
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -z ${TRAVIS_PULL_REQUEST-} ]; then
|
|
|
|
TRAVIS_PULL_REQUEST=false
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -z ${TRAVIS_RUST_VERSION-} ]; then
|
|
|
|
case $(rustc -V) in
|
|
|
|
*nightly*)
|
|
|
|
TRAVIS_RUST_VERSION=nightly
|
|
|
|
;;
|
|
|
|
*beta*)
|
|
|
|
TRAVIS_RUST_VERSION=beta
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
TRAVIS_RUST_VERSION=stable
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
fi
|
|
|
|
|
2019-02-08 11:54:41 +01:00
|
|
|
if [ -z ${TARGET-} ]; then
|
|
|
|
TARGET=$(rustc -Vv | grep host | cut -d ' ' -f2)
|
|
|
|
fi
|
|
|
|
|
2018-11-03 17:23:04 +01:00
|
|
|
if [ $TRAVIS_BRANCH != master ] || [ $TRAVIS_PULL_REQUEST != false ]; then
|
2018-08-27 14:45:43 +02:00
|
|
|
main
|
|
|
|
fi
|