aboutsummaryrefslogtreecommitdiff
path: root/ci
diff options
context:
space:
mode:
Diffstat (limited to 'ci')
-rw-r--r--ci/after-success.sh49
-rw-r--r--ci/expected/cfg.run2
-rw-r--r--ci/expected/generics.run6
-rw-r--r--ci/expected/hardware.run (renamed from ci/expected/interrupt.run)0
-rw-r--r--ci/expected/lock.run4
-rw-r--r--ci/expected/only-shared-access.run2
-rw-r--r--ci/expected/peripherals-taken.run0
-rw-r--r--ci/expected/pool.run2
-rw-r--r--ci/expected/preempt.run5
-rw-r--r--ci/expected/ramfunc.grep.bar4
-rw-r--r--ci/expected/ramfunc.grep.foo4
-rw-r--r--ci/expected/resource.run4
-rw-r--r--ci/expected/shared-with-init.run0
-rw-r--r--ci/expected/static.run2
-rw-r--r--ci/expected/task.run4
-rw-r--r--ci/install.sh33
-rw-r--r--ci/script.sh210
17 files changed, 221 insertions, 110 deletions
diff --git a/ci/after-success.sh b/ci/after-success.sh
index 65ddb90..bbe0522 100644
--- a/ci/after-success.sh
+++ b/ci/after-success.sh
@@ -2,20 +2,55 @@ set -euxo pipefail
main() {
local langs=( en ru )
+ local latest=0.5
+ local vers=( 0.4.x )
rm -f .cargo/config
- cargo doc --features timer-queue
+ cargo doc
local td=$(mktemp -d)
- cp -r target/doc $td/api
- mkdir $td/book/
- cp redirect.html $td/book/index.html
+
+ # build latest docs
+ mkdir -p $td/$latest/book/
+ cp -r target/doc $td/$latest/api
+ sed 's|URL|rtic/index.html|g' redirect.html > $td/$latest/api/index.html
+
+ sed 's|URL|0.5|g' redirect.html > $td/index.html
+ sed 's|URL|book/en|g' redirect.html > $td/$latest/index.html
for lang in ${langs[@]}; do
( cd book/$lang && mdbook build )
- cp -r book/$lang/book $td/book/$lang
- cp LICENSE-* $td/book/$lang/
+ cp -r book/$lang/book $td/$latest/book/$lang
+ cp LICENSE-* $td/$latest/book/$lang/
+ done
+
+ local root=$(pwd)
+ # build older docs
+ for ver in ${vers[@]}; do
+ local prefix=${ver%.*}
+
+ mkdir -p $td/$prefix/book
+ local src=$(mktemp -d)
+ curl -L https://github.com/rtic-rs/cortex-m-rtic/archive/v${ver}.tar.gz | tar xz --strip-components 1 -C $src
+
+ pushd $src
+ rm -f .cargo/config
+ cargo doc || cargo doc --features timer-queue
+ cp -r target/doc $td/$prefix/api
+ sed 's|URL|rtic/index.html|g' $root/redirect.html > $td/$prefix/api/index.html
+ for lang in ${langs[@]}; do
+ ( cd book/$lang && mdbook build )
+ cp -r book/$lang/book $td/$prefix/book/$lang
+ cp LICENSE-* $td/$prefix/book/$lang/
+ done
+ sed 's|URL|book/en|g' $root/redirect.html > $td/$prefix/index.html
+ popd
+
+ rm -rf $src
done
+ # forward CNAME file
+ cp CNAME $td/
+
mkdir ghp-import
curl -Ls https://github.com/davisp/ghp-import/archive/master.tar.gz |
tar --strip-components 1 -C ghp-import -xz
@@ -23,7 +58,7 @@ main() {
./ghp-import/ghp_import.py $td
set +x
- git push -fq https://$GH_TOKEN@github.com/$TRAVIS_REPO_SLUG.git gh-pages && echo OK
+ git push -fq https://$GH_TOKEN@github.com/rtic-rs/cortex-m-rtic.git gh-pages && echo OK
rm -rf $td
}
diff --git a/ci/expected/cfg.run b/ci/expected/cfg.run
new file mode 100644
index 0000000..b584958
--- /dev/null
+++ b/ci/expected/cfg.run
@@ -0,0 +1,2 @@
+foo has been called 1 time
+foo has been called 2 times
diff --git a/ci/expected/generics.run b/ci/expected/generics.run
index 7fa9775..fb31731 100644
--- a/ci/expected/generics.run
+++ b/ci/expected/generics.run
@@ -1,6 +1,6 @@
UART1(STATE = 0)
-SHARED: 0 -> 1
+shared: 0 -> 1
UART0(STATE = 0)
-SHARED: 1 -> 2
+shared: 1 -> 2
UART1(STATE = 1)
-SHARED: 2 -> 4
+shared: 2 -> 4
diff --git a/ci/expected/interrupt.run b/ci/expected/hardware.run
index ef00864..ef00864 100644
--- a/ci/expected/interrupt.run
+++ b/ci/expected/hardware.run
diff --git a/ci/expected/lock.run b/ci/expected/lock.run
index 156ac22..a987b37 100644
--- a/ci/expected/lock.run
+++ b/ci/expected/lock.run
@@ -1,5 +1,5 @@
A
-B - SHARED = 1
+B - shared = 1
C
-D - SHARED = 2
+D - shared = 2
E
diff --git a/ci/expected/only-shared-access.run b/ci/expected/only-shared-access.run
new file mode 100644
index 0000000..1d4eed0
--- /dev/null
+++ b/ci/expected/only-shared-access.run
@@ -0,0 +1,2 @@
+UART1(key = 0xdeadbeef)
+UART0(key = 0xdeadbeef)
diff --git a/ci/expected/peripherals-taken.run b/ci/expected/peripherals-taken.run
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/ci/expected/peripherals-taken.run
diff --git a/ci/expected/pool.run b/ci/expected/pool.run
new file mode 100644
index 0000000..040dcee
--- /dev/null
+++ b/ci/expected/pool.run
@@ -0,0 +1,2 @@
+bar(0x2000008c)
+foo(0x20000110)
diff --git a/ci/expected/preempt.run b/ci/expected/preempt.run
new file mode 100644
index 0000000..8777741
--- /dev/null
+++ b/ci/expected/preempt.run
@@ -0,0 +1,5 @@
+GPIOA - start
+ GPIOC - start
+ GPIOC - end
+ GPIOB
+GPIOA - end
diff --git a/ci/expected/ramfunc.grep.bar b/ci/expected/ramfunc.grep.bar
index 7f69d25..1fa5bad 100644
--- a/ci/expected/ramfunc.grep.bar
+++ b/ci/expected/ramfunc.grep.bar
@@ -1,3 +1 @@
-20000100 B bar::FREE_QUEUE::lk14244m263eivix
-200000dc B bar::INPUTS::mi89534s44r1mnj1
-20000000 T bar::ns9009yhw2dc2y25
+20000000 t ramfunc::bar::h9d6714fe5a3b0c89 \ No newline at end of file
diff --git a/ci/expected/ramfunc.grep.foo b/ci/expected/ramfunc.grep.foo
index a076ac0..845f277 100644
--- a/ci/expected/ramfunc.grep.foo
+++ b/ci/expected/ramfunc.grep.foo
@@ -1,3 +1 @@
-20000100 B foo::FREE_QUEUE::ujkptet2nfdw5t20
-200000dc B foo::INPUTS::thvubs85b91dg365
-000002c6 T foo::sidaht420cg1mcm8
+00000162 t ramfunc::foo::h30e7789b08c08e19 \ No newline at end of file
diff --git a/ci/expected/resource.run b/ci/expected/resource.run
index 9c70856..a587a94 100644
--- a/ci/expected/resource.run
+++ b/ci/expected/resource.run
@@ -1,2 +1,2 @@
-UART0: SHARED = 1
-UART1: SHARED = 2
+UART0: shared = 1
+UART1: shared = 2
diff --git a/ci/expected/shared-with-init.run b/ci/expected/shared-with-init.run
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/ci/expected/shared-with-init.run
diff --git a/ci/expected/static.run b/ci/expected/static.run
deleted file mode 100644
index 2c295c9..0000000
--- a/ci/expected/static.run
+++ /dev/null
@@ -1,2 +0,0 @@
-UART1(KEY = 0xdeadbeef)
-UART0(KEY = 0xdeadbeef)
diff --git a/ci/expected/task.run b/ci/expected/task.run
index 309fdb9..de45dce 100644
--- a/ci/expected/task.run
+++ b/ci/expected/task.run
@@ -1,3 +1,5 @@
-foo
+foo - start
+foo - middle
baz
+foo - end
bar
diff --git a/ci/install.sh b/ci/install.sh
index 9000772..624efd8 100644
--- a/ci/install.sh
+++ b/ci/install.sh
@@ -1,19 +1,34 @@
set -euxo pipefail
+install_crate() {
+ local pkg=$1 vers=$2
+
+ cargo install --list | grep "$pkg v$vers" || ( cd .. && cargo install -f --vers $vers $pkg )
+}
+
main() {
- if [ $TARGET != x86_64-unknown-linux-gnu ]; then
+ # these are not needed for doc builds
+ if [ $TRAVIS_BRANCH != master ] || [ $TRAVIS_PULL_REQUEST != false ]; then
+ if [ $TARGET = x86_64-unknown-linux-gnu ]; then
+ install_crate microamp-tools 0.1.0-alpha.3
+ rustup target add thumbv6m-none-eabi thumbv7m-none-eabi
+ fi
+
rustup target add $TARGET
- fi
+ 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
- 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
+ pip install linkchecker --user
+ fi
- # install mdbook
- curl -LSfs https://japaric.github.io/trust/install.sh | \
- sh -s -- --git rust-lang-nursery/mdbook --tag v0.2.1
+ # Download binary mdbook and add to path
+ curl -L https://github.com/rust-lang/mdBook/releases/download/v0.3.1/mdbook-v0.3.1-x86_64-unknown-linux-gnu.tar.gz > mdbook.tar.gz
+ tar -xf mdbook.tar.gz
+ mkdir -p mdbook-bin
+ mv mdbook mdbook-bin/
- pip install linkchecker --user
+ #install_crate mdbook 0.3.1
}
main
diff --git a/ci/script.sh b/ci/script.sh
index 7cda1e5..6c09909 100644
--- a/ci/script.sh
+++ b/ci/script.sh
@@ -33,137 +33,191 @@ arm_example() {
main() {
local T=$TARGET
- local nightly=""
-
- if [ $TRAVIS_RUST_VERSION = nightly ]; then
- nightly="nightly"
- fi
mkdir -p ci/builds
- if [ $T = x86_64-unknown-linux-gnu ]; then
- # compile-fail and compile-pass tests
- case $TRAVIS_RUST_VERSION in
- nightly*)
- # TODO how to run a subset of these tests when timer-queue is disabled?
- cargo test --features "$nightly,timer-queue" --test compiletest --target $T
- esac
+ # Current MSRV cannot handle profiles, remove compilation optimisations
+ if [[ $TRAVIS_RUST_VERSION == 1.*.* ]]; then
+ echo "Removing optimisation profiles"
+ sed -i '/^\[profile.*build-override]$/,/^$/{/^#/!{/^$/!d}}' Cargo.toml
+ fi
- cargo check --target $T
- if [ $TARGET != thumbv6m-none-eabi ]; then
- cargo check --features "$nightly,timer-queue" --target $T
+ if [ $T = x86_64-unknown-linux-gnu ]; then
+ if [[ $TRAVIS_RUST_VERSION == 1.*.* ]]; then
+ # test on a fixed version (MSRV) to avoid problems with changes in rustc diagnostics
+ # compile-fail tests
+ cargo test --test single --target $T
fi
- if [ $TRAVIS_RUST_VERSION != nightly ]; then
- rm -f .cargo/config
- if [ $TARGET != thumbv6m-none-eabi ]; then
- cargo doc --features timer-queue
- else
+ if [ $TRAVIS_RUST_VERSION = nightly ]; then
+ # Tests where required MSRV > 1.36
+ #local exs=(
+ #)
+ #for ex in ${exs[@]}; do
+ # cargo check --example $ex --target $T
+ #done
+
+ # multi-core compile-pass tests
+ pushd heterogeneous
+ local exs=(
+ smallest
+ x-init-2
+ x-init
+ x-schedule
+ x-spawn
+ )
+ for ex in ${exs[@]}; do
+ cargo microamp --example $ex --target thumbv7m-none-eabi,thumbv6m-none-eabi --check
+ done
+
+ popd
+
+ else
+ if [ $TRAVIS_RUST_VERSION != nightly ]; then
+ rm -f .cargo/config
cargo doc
+ ( cd book/en && mdbook build )
+ ( cd book/ru && mdbook build )
+
+ local td=$(mktemp -d)
+ cp -r target/doc $td/api
+ mkdir $td/book
+ cp -r book/en/book $td/book/en
+ cp -r book/ru/book $td/book/ru
+ cp LICENSE-* $td/book/en
+ cp LICENSE-* $td/book/ru
+
+ linkchecker $td/book/en/
+ linkchecker $td/book/ru/
+ linkchecker $td/api/rtic/
+ linkchecker $td/api/cortex_m_rtic_macros/
fi
- ( cd book/en && mdbook build )
- ( cd book/ru && mdbook build )
-
- local td=$(mktemp -d)
- cp -r target/doc $td/api
- mkdir $td/book
- cp -r book/en/book $td/book/en
- cp -r book/ru/book $td/book/ru
- cp LICENSE-* $td/book/en
- cp LICENSE-* $td/book/ru
-
- linkchecker $td/book/en/
- linkchecker $td/book/ru/
- linkchecker $td/api/rtfm/
- linkchecker $td/api/cortex_m_rtfm_macros/
fi
+ cargo check --target $T
+ ( cd macros && cargo test --target $T )
+
return
fi
- cargo check --features "$nightly" --target $T --examples
- if [ $TARGET != thumbv6m-none-eabi ]; then
- cargo check --features "$nightly,timer-queue" --target $T --examples
+ if [ $TARGET = thumbv6m-none-eabi ]; then
+ cargo check --target $T --examples
+
+ # Check examples with specific features not compatible with MSRV
+ if [[ $TRAVIS_RUST_VERSION != 1.*.* ]]; then
+ cargo check --target $T --examples --features __min_r1_43
+ fi
+ else
+ cargo check --target $T --examples --features __v7
+
+ # Check examples with specific features not compatible with MSRV
+ if [[ $TRAVIS_RUST_VERSION != 1.*.* ]]; then
+ cargo check --target $T --examples --features __v7,__min_r1_43
+ fi
fi
+ cargo check -p homogeneous --target $T --examples
+
# run-pass tests
case $T in
thumbv6m-none-eabi | thumbv7m-none-eabi)
local exs=(
idle
init
- interrupt
+ hardware
+ preempt
binds
resource
lock
late
- static
+ only-shared-access
task
message
capacity
- singleton
-
types
not-send
not-sync
+ shared-with-init
generics
+ cfg
+ pool
ramfunc
)
for ex in ${exs[@]}; do
- if [ $ex = ramfunc ] && [ $T = thumbv6m-none-eabi ]; then
- # LLD doesn't support this at the moment
+ if [ $ex = pool ]; then
+ if [ $TARGET = thumbv6m-none-eabi ]; then
+ continue
+ fi
+
+ local td=$(mktemp -d)
+
+ cargo run --example $ex --target $TARGET --features __v7 >\
+ $td/pool.run
+ grep 'foo(0x2' $td/pool.run
+ grep 'bar(0x2' $td/pool.run
+ arm-none-eabi-objcopy -O ihex target/$TARGET/debug/examples/$ex \
+ ci/builds/${ex}___v7_debug_1.hex
+
+ cargo run --example $ex --target $TARGET --features __v7 --release >\
+ $td/pool.run
+ grep 'foo(0x2' $td/pool.run
+ grep 'bar(0x2' $td/pool.run
+ arm-none-eabi-objcopy -O ihex target/$TARGET/release/examples/$ex \
+ ci/builds/${ex}___v7_release_1.hex
+
+ rm -rf $td
+
continue
fi
- if [ $ex != types ]; then
- arm_example "run" $ex "debug" "$nightly" "1"
- arm_example "run" $ex "release" "$nightly" "1"
+ if [ $ex = types ]; then
+ if [ $TARGET = thumbv6m-none-eabi ]; then
+ continue
+ fi
+
+ arm_example "run" $ex "debug" "__v7" "1"
+ arm_example "run" $ex "release" "__v7" "1"
+
+ continue
fi
- if [ $TARGET != thumbv6m-none-eabi ]; then
- arm_example "run" $ex "debug" "$nightly,timer-queue" "1"
- arm_example "run" $ex "release" "$nightly,timer-queue" "1"
+ arm_example "run" $ex "debug" "" "1"
+ if [ $ex = types ]; then
+ arm_example "run" $ex "release" "" "1"
+ else
+ arm_example "build" $ex "release" "" "1"
fi
done
local built=()
cargo clean
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 = singleton ]; then
- # singleton build is currently not reproducible due to
- # https://github.com/japaric/owned-singleton/issues/2
- continue
+ if [ $ex = types ] || [ $ex = pool ]; then
+ if [ $TARGET = thumbv6m-none-eabi ]; then
+ continue
+ fi
+
+ arm_example "build" $ex "debug" "__v7" "2"
+ cmp ci/builds/${ex}___v7_debug_1.hex \
+ ci/builds/${ex}___v7_debug_2.hex
+ arm_example "build" $ex "release" "__v7" "2"
+ cmp ci/builds/${ex}___v7_release_1.hex \
+ ci/builds/${ex}___v7_release_2.hex
+ else
+ arm_example "build" $ex "debug" "" "2"
+ cmp ci/builds/${ex}_debug_1.hex \
+ ci/builds/${ex}_debug_2.hex
+ arm_example "build" $ex "release" "" "2"
+ cmp ci/builds/${ex}_release_1.hex \
+ ci/builds/${ex}_release_2.hex
fi
- if [ $ex != types ]; then
- arm_example "build" $ex "debug" "$nightly" "2"
- cmp ci/builds/${ex}_${nightly/nightly/nightly_}debug_1.hex \
- ci/builds/${ex}_${nightly/nightly/nightly_}debug_2.hex
- arm_example "build" $ex "release" "$nightly" "2"
- cmp ci/builds/${ex}_${nightly/nightly/nightly_}release_1.hex \
- ci/builds/${ex}_${nightly/nightly/nightly_}release_2.hex
-
- built+=( $ex )
- fi
-
- if [ $TARGET != thumbv6m-none-eabi ]; then
- arm_example "build" $ex "debug" "$nightly,timer-queue" "2"
- cmp ci/builds/${ex}_${nightly}_timer-queue_debug_1.hex \
- ci/builds/${ex}_${nightly}_timer-queue_debug_2.hex
- arm_example "build" $ex "release" "$nightly,timer-queue" "2"
- cmp ci/builds/${ex}_${nightly}_timer-queue_release_1.hex \
- ci/builds/${ex}_${nightly}_timer-queue_release_2.hex
- fi
+ built+=( $ex )
done
( cd target/$TARGET/release/examples/ && size ${built[@]} )