diff options
| author | bors[bot] <bors[bot]@users.noreply.github.com> | 2018-11-03 16:31:11 +0000 |
|---|---|---|
| committer | bors[bot] <bors[bot]@users.noreply.github.com> | 2018-11-03 16:31:11 +0000 |
| commit | 777765e522949ebf84d05d4db075132172d81494 (patch) | |
| tree | 41bc00739da8f832eb5ba68ef99ec8b9d06111a4 /ci/script.sh | |
| parent | 653338e7997a0cdc5deaed98b1bb5f60006717ed (diff) | |
| parent | 3a867e70c3b1afc4943ec597e4f188432fba5a8b (diff) | |
Merge #97
97: v0.4.0 r=japaric a=japaric
closes #32
closes #33
Co-authored-by: Jorge Aparicio <jorge@japaric.io>
Diffstat (limited to 'ci/script.sh')
| -rw-r--r-- | ci/script.sh | 96 |
1 files changed, 84 insertions, 12 deletions
diff --git a/ci/script.sh b/ci/script.sh index 0d42ff3..5fc3ca2 100644 --- a/ci/script.sh +++ b/ci/script.sh @@ -1,23 +1,95 @@ set -euxo pipefail main() { - if [ $TARGET = x86_64-unknown-linux-gnu ]; then - cargo build - cargo test --test cfail + local T=$TARGET + + if [ $T = x86_64-unknown-linux-gnu ]; then + # compile-fail and compile-pass tests + if [ $TRAVIS_RUST_VERSION = nightly ]; then + # TODO how to run a subset of these tests when timer-queue is disabled? + cargo test --features timer-queue --test compiletest --target $T + fi + + cargo check --target $T + cargo check --features timer-queue --target $T return fi - case $TARGET in - thumbv7em-none-eabi*) - cargo check --target $TARGET --features cm7-r0p1 - cargo check --target $TARGET --features cm7-r0p1 --examples - ;; - esac + cargo check --target $T --examples + cargo check --features timer-queue --target $T --examples + + # 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 + + 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 - - cargo check --target $TARGET - cargo check --target $TARGET --examples + cargo run --example $ex --target $T --release | \ + diff -u ci/expected/$ex.run - + fi + + cargo run --features timer-queue --example $ex --target $T | \ + diff -u ci/expected/$ex.run - + + cargo run --features timer-queue --example $ex --target $T --release | \ + diff -u ci/expected/$ex.run - + done + esac } -if [ $TRAVIS_BRANCH != master ]; then +# 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 + +if [ $TRAVIS_BRANCH != master ] || [ $TRAVIS_PULL_REQUEST != false ]; then main fi |
