aboutsummaryrefslogtreecommitdiff
path: root/ci
diff options
context:
space:
mode:
authorJorge Aparicio <jorge@japaric.io>2019-09-15 17:09:40 +0000
committerGitHub <noreply@github.com>2019-09-15 17:09:40 +0000
commit4ff28e9d13e845abf39c662643ae2ff5df57ec16 (patch)
tree7d9770cd357e584d85ef6ddc32bddd1a937d1020 /ci
parentfafeeb27270ef24fc3852711c6032f65aa7dbcc0 (diff)
parent7aa270cb92180abfc9102a69efdde378c3396b5e (diff)
Merge pull request #205 from japaric/heterogeneous
rtfm-syntax refactor + heterogeneous multi-core support
Diffstat (limited to 'ci')
-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/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/static.run2
-rw-r--r--ci/expected/task.run4
-rw-r--r--ci/install.sh9
-rw-r--r--ci/script.sh168
13 files changed, 119 insertions, 95 deletions
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/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/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..6f8d815 100644
--- a/ci/install.sh
+++ b/ci/install.sh
@@ -1,17 +1,20 @@
set -euxo pipefail
main() {
- if [ $TARGET != x86_64-unknown-linux-gnu ]; then
- rustup target add $TARGET
+ if [ $TARGET = x86_64-unknown-linux-gnu ]; then
+ ( cd .. && cargo install microamp-tools --version 0.1.0-alpha.2 -f )
+ rustup target add thumbv6m-none-eabi thumbv7m-none-eabi
fi
+ rustup target add $TARGET
+
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
# install mdbook
curl -LSfs https://japaric.github.io/trust/install.sh | \
- sh -s -- --git rust-lang-nursery/mdbook --tag v0.2.1
+ sh -s -- --git rust-lang-nursery/mdbook --tag v0.3.1
pip install linkchecker --user
}
diff --git a/ci/script.sh b/ci/script.sh
index 2292d47..9cb03fc 100644
--- a/ci/script.sh
+++ b/ci/script.sh
@@ -37,61 +37,75 @@ main() {
mkdir -p ci/builds
if [ $T = x86_64-unknown-linux-gnu ]; then
- # compile-fail and compile-pass tests
+ if [ $TRAVIS_RUST_VERSION = nightly ]; then
+ # compile-fail tests
+ cargo test --test single --target $T
- # TODO how to run a subset of these tests when timer-queue is disabled?
- cargo test --features "timer-queue" --test compiletest --target $T
+ # 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
- cargo check --target $T
- if [ $TARGET != thumbv6m-none-eabi ]; then
- cargo check --features "timer-queue" --target $T
- fi
+ popd
- if [ $TRAVIS_RUST_VERSION != nightly ]; then
- rm -f .cargo/config
- if [ $TARGET != thumbv6m-none-eabi ]; then
- cargo doc --features timer-queue
- else
+ 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/rtfm/
+ linkchecker $td/api/cortex_m_rtfm_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 --target $T --examples
- if [ $TARGET != thumbv6m-none-eabi ]; then
- cargo check --features "timer-queue" --target $T --examples
+ if [ $TARGET = thumbv6m-none-eabi ]; then
+ cargo check --target $T --examples
+ else
+ cargo check --target $T --examples --features __v7
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
@@ -103,79 +117,81 @@ main() {
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 = pool ]; then
- if [ $TARGET != thumbv6m-none-eabi ]; then
- local td=$(mktemp -d)
-
- local features="timer-queue"
- cargo run --example $ex --target $TARGET --features $features >\
- $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}_${features/,/_}_debug_1.hex
-
- cargo run --example $ex --target $TARGET --features $features --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}_${features/,/_}_release_1.hex
-
- rm -rf $td
+ 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 [ $ex != types ]; then
- arm_example "run" $ex "debug" "" "1"
+ arm_example "run" $ex "debug" "" "1"
+ if [ $ex = types ]; then
arm_example "run" $ex "release" "" "1"
- fi
-
- if [ $TARGET != thumbv6m-none-eabi ]; then
- arm_example "run" $ex "debug" "timer-queue" "1"
- arm_example "run" $ex "release" "timer-queue" "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 = types ] || [ $ex = pool ]; then
+ if [ $TARGET = thumbv6m-none-eabi ]; then
+ continue
+ fi
- if [ $ex != types ] && [ $ex != pool ]; then
+ 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
-
- built+=( $ex )
fi
- if [ $TARGET != thumbv6m-none-eabi ]; then
- arm_example "build" $ex "debug" "timer-queue" "2"
- cmp ci/builds/${ex}_timer-queue_debug_1.hex \
- ci/builds/${ex}_timer-queue_debug_2.hex
- arm_example "build" $ex "release" "timer-queue" "2"
- cmp ci/builds/${ex}_timer-queue_release_1.hex \
- ci/builds/${ex}_timer-queue_release_2.hex
- fi
+ built+=( $ex )
done
( cd target/$TARGET/release/examples/ && size ${built[@]} )