closes #32
closes #33
This commit is contained in:
Jorge Aparicio 2018-11-03 17:02:41 +01:00
parent 653338e799
commit c631049efc
154 changed files with 7538 additions and 3276 deletions

View file

@ -1,20 +1,27 @@
set -euxo pipefail
main() {
cargo doc
rm -f .cargo/config
cargo doc --features timer-queue
( cd book && mdbook build )
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

4
ci/expected/baseline.run Normal file
View file

@ -0,0 +1,4 @@
init(baseline = Instant(0))
foo(baseline = Instant(0))
UART0(baseline = Instant(904))
foo(baseline = Instant(904))

5
ci/expected/capacity.run Normal file
View file

@ -0,0 +1,5 @@
foo(0)
foo(1)
foo(2)
foo(3)
bar

2
ci/expected/idle.run Normal file
View file

@ -0,0 +1,2 @@
init
idle

1
ci/expected/init.run Normal file
View file

@ -0,0 +1 @@
init

View file

@ -0,0 +1,4 @@
init
UART0 called 1 time
idle
UART0 called 2 times

1
ci/expected/late.run Normal file
View file

@ -0,0 +1 @@
received message: 42

5
ci/expected/lock.run Normal file
View file

@ -0,0 +1,5 @@
A
B - SHARED = 1
C
D - SHARED = 2
E

6
ci/expected/message.run Normal file
View file

@ -0,0 +1,6 @@
foo
bar(0)
baz(1, 2)
foo
bar(1)
baz(2, 3)

0
ci/expected/not-send.run Normal file
View file

0
ci/expected/not-sync.run Normal file
View file

3
ci/expected/periodic.run Normal file
View file

@ -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))

View file

@ -0,0 +1,3 @@
20000100 B bar::FREE_QUEUE::lk14244m263eivix
200000dc B bar::INPUTS::mi89534s44r1mnj1
20000000 T bar::ns9009yhw2dc2y25

View file

@ -0,0 +1,3 @@
20000100 B foo::FREE_QUEUE::ujkptet2nfdw5t20
200000dc B foo::INPUTS::thvubs85b91dg365
000002c6 T foo::sidaht420cg1mcm8

1
ci/expected/ramfunc.run Normal file
View file

@ -0,0 +1 @@
foo

2
ci/expected/resource.run Normal file
View file

@ -0,0 +1,2 @@
UART0: SHARED = 1
UART1: SHARED = 2

3
ci/expected/schedule.run Normal file
View file

@ -0,0 +1,3 @@
init @ Instant(0)
bar @ Instant(4000236)
foo @ Instant(8000173)

View file

@ -0,0 +1,2 @@
bar(2)
foo(1)

2
ci/expected/static.run Normal file
View file

@ -0,0 +1,2 @@
UART1(KEY = 0xdeadbeef)
UART0(KEY = 0xdeadbeef)

3
ci/expected/task.run Normal file
View file

@ -0,0 +1,3 @@
foo
baz
bar

0
ci/expected/types.run Normal file
View file

View file

@ -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

View file

@ -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
cargo check --target $TARGET
cargo check --target $TARGET --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 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