From e9b8cd24860130491723a477ac15248f04b1f3b2 Mon Sep 17 00:00:00 2001 From: Jorge Aparicio Date: Thu, 17 May 2018 23:28:58 +0200 Subject: [PATCH] fix tests --- Cargo.toml | 12 ++++++++++-- ci/script.sh | 3 ++- macros/Cargo.toml | 4 ++-- tests/cfail/exception.rs | 4 ---- tests/cfail/idle.rs | 5 ++++- tests/cfail/init-resource-share-task.rs | 4 ---- tests/cfail/init.rs | 5 ----- tests/cfail/interrupt.rs | 4 ---- tests/cfail/late-resource-init.rs | 4 ---- tests/cfail/lock.rs | 4 ---- tests/cfail/priority-too-high.rs | 4 ---- tests/cfail/resource-alias.rs | 4 ---- tests/cfail/resource-not-send-sync.rs | 4 ---- tests/cfail/token-outlive.rs | 4 ---- tests/cfail/wrong-threshold.rs | 4 ---- 15 files changed, 18 insertions(+), 51 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 006998b345..cc25c529a3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -20,7 +20,10 @@ required-features = ["timer-queue"] name = "schedule-now" [[example]] -name = "empty" +name = "minimal" + +[[example]] +name = "idle" [[example]] name = "event-task" @@ -56,9 +59,14 @@ required-features = ["timer-queue"] [dependencies] cortex-m = "0.5.0" cortex-m-rtfm-macros = { path = "macros", version = "0.3.1" } -heapless = "0.3.6" +# heapless = "0.3.6" +heapless = { git = "https://github.com/japaric//heapless", branch = "object-pool" } typenum = "1.10.0" +[dependencies.stable_deref_trait] +default-features = false +version = "1" + [target.'cfg(target_arch = "x86_64")'.dev-dependencies] compiletest_rs = "0.3.5" diff --git a/ci/script.sh b/ci/script.sh index a410bd06cf..d0e584210e 100644 --- a/ci/script.sh +++ b/ci/script.sh @@ -10,7 +10,8 @@ main() { # examples that don't require the timer-queue feature local examples=( schedule-now - empty + minimal + idle event-task ) diff --git a/macros/Cargo.toml b/macros/Cargo.toml index b4040ebccf..81b788c575 100644 --- a/macros/Cargo.toml +++ b/macros/Cargo.toml @@ -13,8 +13,8 @@ version = "0.3.1" failure = "0.1.1" proc-macro2 = "0.3.6" quote = "0.5.1" -# rtfm-syntax = "0.3.0" -rtfm-syntax = { path = "../../rtfm-syntax" } +# rtfm-syntax = "0.4.0" +rtfm-syntax = { git = "https://github.com/japaric/rtfm-syntax", branch = "tq" } syn = "0.13.1" [dependencies.either] diff --git a/tests/cfail/exception.rs b/tests/cfail/exception.rs index 2adb8dbec6..894c42ae22 100644 --- a/tests/cfail/exception.rs +++ b/tests/cfail/exception.rs @@ -24,8 +24,4 @@ fn init(_ctxt: init::Context) -> init::LateResources { init::LateResources {} } -fn idle(_ctxt: idle::Context) -> ! { - loop {} -} - fn sys_tick(_ctxt: sys_tick::Context) {} diff --git a/tests/cfail/idle.rs b/tests/cfail/idle.rs index 2ccfda53f2..6de08b3720 100644 --- a/tests/cfail/idle.rs +++ b/tests/cfail/idle.rs @@ -1,3 +1,4 @@ +// error-pattern: mismatched types #![deny(unsafe_code)] #![deny(warnings)] #![feature(proc_macro)] @@ -10,8 +11,10 @@ extern crate stm32f103xx; use rtfm::app; -app! { //~ mismatched types +app! { device: stm32f103xx, + + idle: {}, } fn init(_ctxt: init::Context) -> init::LateResources { diff --git a/tests/cfail/init-resource-share-task.rs b/tests/cfail/init-resource-share-task.rs index a8db75a407..e016a18f13 100644 --- a/tests/cfail/init-resource-share-task.rs +++ b/tests/cfail/init-resource-share-task.rs @@ -34,8 +34,4 @@ fn init(_ctxt: init::Context) -> init::LateResources { init::LateResources {} } -fn idle(_ctxt: idle::Context) -> ! { - loop {} -} - fn exti0(_ctxt: exti0::Context) {} diff --git a/tests/cfail/init.rs b/tests/cfail/init.rs index aab1c06ed4..7a356e125c 100644 --- a/tests/cfail/init.rs +++ b/tests/cfail/init.rs @@ -12,13 +12,8 @@ use rtfm::app; app! { //~ error mismatched types //~^ incorrect number of function parameters - //~| note expected type `fn(init::Context) -> _ZN4init13LateResourcesE` device: stm32f103xx, } // ERROR `init` must have signature `fn (init::Peripherals)` fn init() {} - -fn idle(_ctxt: idle::Context) -> ! { - loop {} -} diff --git a/tests/cfail/interrupt.rs b/tests/cfail/interrupt.rs index d481fe512b..faeb96bd85 100644 --- a/tests/cfail/interrupt.rs +++ b/tests/cfail/interrupt.rs @@ -24,8 +24,4 @@ fn init(_ctxt: init::Context) -> init::LateResources { init::LateResources {} } -fn idle(_ctxt: idle::Context) -> ! { - loop {} -} - fn exti33(_ctxt: exti33::Context) {} diff --git a/tests/cfail/late-resource-init.rs b/tests/cfail/late-resource-init.rs index 795399aede..30ddd0a67c 100644 --- a/tests/cfail/late-resource-init.rs +++ b/tests/cfail/late-resource-init.rs @@ -41,10 +41,6 @@ fn init(ctxt: init::Context) -> init::LateResources { init::LateResources { LATE: 0 } } -fn idle(_ctxt: idle::Context) -> ! { - loop {} -} - fn exti0(_ctxt: exti0::Context) {} fn exti1(_ctxt: exti1::Context) {} diff --git a/tests/cfail/lock.rs b/tests/cfail/lock.rs index 7706bd173a..bc3c47b2f1 100644 --- a/tests/cfail/lock.rs +++ b/tests/cfail/lock.rs @@ -45,10 +45,6 @@ fn init(_ctxt: init::Context) -> init::LateResources { init::LateResources {} } -fn idle(_ctxt: idle::Context) -> ! { - loop {} -} - #[allow(non_snake_case)] fn exti0(mut ctxt: exti0::Context) { let exti0::Resources { ON, mut MAX } = ctxt.resources; diff --git a/tests/cfail/priority-too-high.rs b/tests/cfail/priority-too-high.rs index 5002f0b9f3..7092b488ea 100644 --- a/tests/cfail/priority-too-high.rs +++ b/tests/cfail/priority-too-high.rs @@ -24,8 +24,4 @@ fn init(_ctxt: init::Context) -> init::LateResources { init::LateResources {} } -fn idle(_ctxt: idle::Context) -> ! { - loop {} -} - fn exti0(_ctxt: exti0::Context) {} diff --git a/tests/cfail/resource-alias.rs b/tests/cfail/resource-alias.rs index 44a6f10153..76a043029f 100644 --- a/tests/cfail/resource-alias.rs +++ b/tests/cfail/resource-alias.rs @@ -30,7 +30,3 @@ app! { //~ error proc macro panicked } fn init(_ctxt: init::Context) -> init::LateResources {} - -fn idle(_ctxt: idle::Context) -> ! { - loop {} -} diff --git a/tests/cfail/resource-not-send-sync.rs b/tests/cfail/resource-not-send-sync.rs index 0e550daca5..4255835508 100644 --- a/tests/cfail/resource-not-send-sync.rs +++ b/tests/cfail/resource-not-send-sync.rs @@ -36,10 +36,6 @@ fn init(_ctxt: init::Context) -> init::LateResources { init::LateResources {} } -fn idle(_ctxt: idle::Context) -> ! { - loop {} -} - fn is_send(_: &T) where T: Send, diff --git a/tests/cfail/token-outlive.rs b/tests/cfail/token-outlive.rs index 74a066d89c..dde18c2a93 100644 --- a/tests/cfail/token-outlive.rs +++ b/tests/cfail/token-outlive.rs @@ -36,10 +36,6 @@ fn init(_ctxt: init::Context) -> init::LateResources { init::LateResources {} } -fn idle(_ctxt: idle::Context) -> ! { - loop {} -} - fn exti0(ctxt: exti0::Context) { // ERROR token should not outlive the critical section let op = &mut ctxt.priority; diff --git a/tests/cfail/wrong-threshold.rs b/tests/cfail/wrong-threshold.rs index 1343c0f0ba..211279801a 100644 --- a/tests/cfail/wrong-threshold.rs +++ b/tests/cfail/wrong-threshold.rs @@ -37,10 +37,6 @@ fn init(_ctxt: init::Context) -> init::LateResources { init::LateResources {} } -fn idle(_ctxt: idle::Context) -> ! { - loop {} -} - fn exti0(mut ctxt: exti0::Context) { let op = &mut ctxt.priority; let exti0::Resources { A, B } = ctxt.resources;