diff options
Diffstat (limited to 'ci')
| -rw-r--r-- | ci/after-success.sh | 17 | ||||
| -rw-r--r-- | ci/expected/baseline.run | 4 | ||||
| -rw-r--r-- | ci/expected/capacity.run | 5 | ||||
| -rw-r--r-- | ci/expected/idle.run | 2 | ||||
| -rw-r--r-- | ci/expected/init.run | 1 | ||||
| -rw-r--r-- | ci/expected/interrupt.run | 4 | ||||
| -rw-r--r-- | ci/expected/late.run | 1 | ||||
| -rw-r--r-- | ci/expected/lock.run | 5 | ||||
| -rw-r--r-- | ci/expected/message.run | 6 | ||||
| -rw-r--r-- | ci/expected/not-send.run | 0 | ||||
| -rw-r--r-- | ci/expected/not-sync.run | 0 | ||||
| -rw-r--r-- | ci/expected/periodic.run | 3 | ||||
| -rw-r--r-- | ci/expected/ramfunc.grep.bar | 3 | ||||
| -rw-r--r-- | ci/expected/ramfunc.grep.foo | 3 | ||||
| -rw-r--r-- | ci/expected/ramfunc.run | 1 | ||||
| -rw-r--r-- | ci/expected/resource.run | 2 | ||||
| -rw-r--r-- | ci/expected/schedule.run | 3 | ||||
| -rw-r--r-- | ci/expected/singleton.run | 2 | ||||
| -rw-r--r-- | ci/expected/static.run | 2 | ||||
| -rw-r--r-- | ci/expected/task.run | 3 | ||||
| -rw-r--r-- | ci/expected/types.run | 0 | ||||
| -rw-r--r-- | ci/install.sh | 10 | ||||
| -rw-r--r-- | ci/script.sh | 96 |
23 files changed, 152 insertions, 21 deletions
diff --git a/ci/after-success.sh b/ci/after-success.sh index 4377267..f9f2522 100644 --- a/ci/after-success.sh +++ b/ci/after-success.sh @@ -1,20 +1,27 @@ set -euxo pipefail main() { - cargo doc + rm -f .cargo/config + cargo doc --features timer-queue + ( cd book && mdbook build ) - mkdir ghp-import + local td=$(mktemp -d) + cp -r target/doc $td/api + cp -r book/book $td/ + cp LICENSE-* $td/book/ + mkdir ghp-import curl -Ls https://github.com/davisp/ghp-import/archive/master.tar.gz | tar --strip-components 1 -C ghp-import -xz - ./ghp-import/ghp_import.py target/doc + ./ghp-import/ghp_import.py $td set +x git push -fq https://$GH_TOKEN@github.com/$TRAVIS_REPO_SLUG.git gh-pages && echo OK + + rm -rf $td } -# only publish on successful merges to master -if [ $TRAVIS_BRANCH = master ] && [ $TRAVIS_PULL_REQUEST = false ] && [ $TARGET = x86_64-unknown-linux-gnu ]; then +if [ $TRAVIS_BRANCH = master ] && [ $TRAVIS_PULL_REQUEST = false ]; then main fi diff --git a/ci/expected/baseline.run b/ci/expected/baseline.run new file mode 100644 index 0000000..fa3822f --- /dev/null +++ b/ci/expected/baseline.run @@ -0,0 +1,4 @@ +init(baseline = Instant(0)) +foo(baseline = Instant(0)) +UART0(baseline = Instant(904)) +foo(baseline = Instant(904))
\ No newline at end of file diff --git a/ci/expected/capacity.run b/ci/expected/capacity.run new file mode 100644 index 0000000..f96815d --- /dev/null +++ b/ci/expected/capacity.run @@ -0,0 +1,5 @@ +foo(0) +foo(1) +foo(2) +foo(3) +bar diff --git a/ci/expected/idle.run b/ci/expected/idle.run new file mode 100644 index 0000000..4307776 --- /dev/null +++ b/ci/expected/idle.run @@ -0,0 +1,2 @@ +init +idle diff --git a/ci/expected/init.run b/ci/expected/init.run new file mode 100644 index 0000000..b1b7161 --- /dev/null +++ b/ci/expected/init.run @@ -0,0 +1 @@ +init diff --git a/ci/expected/interrupt.run b/ci/expected/interrupt.run new file mode 100644 index 0000000..ef00864 --- /dev/null +++ b/ci/expected/interrupt.run @@ -0,0 +1,4 @@ +init +UART0 called 1 time +idle +UART0 called 2 times diff --git a/ci/expected/late.run b/ci/expected/late.run new file mode 100644 index 0000000..6d3d3e4 --- /dev/null +++ b/ci/expected/late.run @@ -0,0 +1 @@ +received message: 42 diff --git a/ci/expected/lock.run b/ci/expected/lock.run new file mode 100644 index 0000000..156ac22 --- /dev/null +++ b/ci/expected/lock.run @@ -0,0 +1,5 @@ +A +B - SHARED = 1 +C +D - SHARED = 2 +E diff --git a/ci/expected/message.run b/ci/expected/message.run new file mode 100644 index 0000000..11814db --- /dev/null +++ b/ci/expected/message.run @@ -0,0 +1,6 @@ +foo +bar(0) +baz(1, 2) +foo +bar(1) +baz(2, 3) diff --git a/ci/expected/not-send.run b/ci/expected/not-send.run new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/ci/expected/not-send.run diff --git a/ci/expected/not-sync.run b/ci/expected/not-sync.run new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/ci/expected/not-sync.run diff --git a/ci/expected/periodic.run b/ci/expected/periodic.run new file mode 100644 index 0000000..11414c5 --- /dev/null +++ b/ci/expected/periodic.run @@ -0,0 +1,3 @@ +foo(scheduled = Instant(8000000), now = Instant(8000196)) +foo(scheduled = Instant(16000000), now = Instant(16000196)) +foo(scheduled = Instant(24000000), now = Instant(24000196))
\ No newline at end of file diff --git a/ci/expected/ramfunc.grep.bar b/ci/expected/ramfunc.grep.bar new file mode 100644 index 0000000..7f69d25 --- /dev/null +++ b/ci/expected/ramfunc.grep.bar @@ -0,0 +1,3 @@ +20000100 B bar::FREE_QUEUE::lk14244m263eivix +200000dc B bar::INPUTS::mi89534s44r1mnj1 +20000000 T bar::ns9009yhw2dc2y25 diff --git a/ci/expected/ramfunc.grep.foo b/ci/expected/ramfunc.grep.foo new file mode 100644 index 0000000..a076ac0 --- /dev/null +++ b/ci/expected/ramfunc.grep.foo @@ -0,0 +1,3 @@ +20000100 B foo::FREE_QUEUE::ujkptet2nfdw5t20 +200000dc B foo::INPUTS::thvubs85b91dg365 +000002c6 T foo::sidaht420cg1mcm8 diff --git a/ci/expected/ramfunc.run b/ci/expected/ramfunc.run new file mode 100644 index 0000000..257cc56 --- /dev/null +++ b/ci/expected/ramfunc.run @@ -0,0 +1 @@ +foo diff --git a/ci/expected/resource.run b/ci/expected/resource.run new file mode 100644 index 0000000..9c70856 --- /dev/null +++ b/ci/expected/resource.run @@ -0,0 +1,2 @@ +UART0: SHARED = 1 +UART1: SHARED = 2 diff --git a/ci/expected/schedule.run b/ci/expected/schedule.run new file mode 100644 index 0000000..9facc71 --- /dev/null +++ b/ci/expected/schedule.run @@ -0,0 +1,3 @@ +init @ Instant(0) +bar @ Instant(4000236) +foo @ Instant(8000173)
\ No newline at end of file diff --git a/ci/expected/singleton.run b/ci/expected/singleton.run new file mode 100644 index 0000000..c55dc1a --- /dev/null +++ b/ci/expected/singleton.run @@ -0,0 +1,2 @@ +bar(2) +foo(1) diff --git a/ci/expected/static.run b/ci/expected/static.run new file mode 100644 index 0000000..2c295c9 --- /dev/null +++ b/ci/expected/static.run @@ -0,0 +1,2 @@ +UART1(KEY = 0xdeadbeef) +UART0(KEY = 0xdeadbeef) diff --git a/ci/expected/task.run b/ci/expected/task.run new file mode 100644 index 0000000..309fdb9 --- /dev/null +++ b/ci/expected/task.run @@ -0,0 +1,3 @@ +foo +baz +bar diff --git a/ci/expected/types.run b/ci/expected/types.run new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/ci/expected/types.run diff --git a/ci/install.sh b/ci/install.sh index e63e805..9a896b9 100644 --- a/ci/install.sh +++ b/ci/install.sh @@ -5,9 +5,11 @@ main() { rustup target add $TARGET fi - mkdir gcc - - curl -L https://developer.arm.com/-/media/Files/downloads/gnu-rm/7-2018q2/gcc-arm-none-eabi-7-2018-q2-update-linux.tar.bz2?revision=bc2c96c0-14b5-4bb4-9f18-bceb4050fee7?product=GNU%20Arm%20Embedded%20Toolchain,64-bit,,Linux,7-2018-q2-update | tar --strip-components=1 -C gcc -xj + mkdir qemu + curl -L https://github.com/japaric/qemu-bin/raw/master/14.04/qemu-system-arm-2.12.0 > qemu/qemu-system-arm + chmod +x qemu/qemu-system-arm } -main +if [ $TRAVIS_BRANCH != master ] || [ $TRAVIS_PULL_REQUEST = true ]; then + main +fi diff --git a/ci/script.sh b/ci/script.sh index 0d42ff3..7502b85 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 = true ]; then main fi |
