From 35c97b61c17a30de675eb1c7f852a100b200a0c2 Mon Sep 17 00:00:00 2001 From: Emil Fresk Date: Sun, 8 Jan 2023 19:56:47 +0100 Subject: [PATCH] All examples pass with `cargo xtask --target all` --- ci/expected/async-task-multiple-prios.run | 9 +++++---- ci/expected/async-task.run | 3 ++- ci/expected/big-struct-opt.run | 3 +++ ci/expected/destructure.run | 4 ++-- ci/expected/extern_spawn.run | 3 +-- ci/expected/locals.run | 2 +- ci/expected/not-sync.run | 3 +++ examples/binds.rs | 3 +-- examples/extern_binds.rs | 3 +-- examples/generics.rs | 1 + examples/hardware.rs | 3 +-- examples/not-sync.rs | 2 +- xtask/src/main.rs | 10 ++++++---- 13 files changed, 28 insertions(+), 21 deletions(-) diff --git a/ci/expected/async-task-multiple-prios.run b/ci/expected/async-task-multiple-prios.run index 9b0f53365b..0b42df0afe 100644 --- a/ci/expected/async-task-multiple-prios.run +++ b/ci/expected/async-task-multiple-prios.run @@ -1,5 +1,6 @@ init -hello from normal 2 -hello from async 2 -hello from normal 1 -hello from async 1 +hello from async 3 a 1 +hello from async 4 a 2 +hello from async 1 a 3 +hello from async 2 a 4 +idle diff --git a/ci/expected/async-task.run b/ci/expected/async-task.run index f7ce3a6065..6787fa8fae 100644 --- a/ci/expected/async-task.run +++ b/ci/expected/async-task.run @@ -1,3 +1,4 @@ init -hello from normal +hello from async2 hello from async +idle diff --git a/ci/expected/big-struct-opt.run b/ci/expected/big-struct-opt.run index e69de29bb2..7fdef35dcc 100644 --- a/ci/expected/big-struct-opt.run +++ b/ci/expected/big-struct-opt.run @@ -0,0 +1,3 @@ +async_task data:[22, 22, 22, 22, 22] +uart0 data:[22, 22, 22, 22, 22] +idle diff --git a/ci/expected/destructure.run b/ci/expected/destructure.run index b9b7cc90cc..25a4b1bded 100644 --- a/ci/expected/destructure.run +++ b/ci/expected/destructure.run @@ -1,2 +1,2 @@ -foo: a = 0, b = 0, c = 0 -bar: a = 0, b = 0, c = 0 +bar: a = 0, b = 1, c = 2 +foo: a = 0, b = 1, c = 2 diff --git a/ci/expected/extern_spawn.run b/ci/expected/extern_spawn.run index 2f8c74f6a4..257cc5642c 100644 --- a/ci/expected/extern_spawn.run +++ b/ci/expected/extern_spawn.run @@ -1,2 +1 @@ -foo 1, 2 -foo 2, 3 +foo diff --git a/ci/expected/locals.run b/ci/expected/locals.run index bf1d207698..4f1d3509c2 100644 --- a/ci/expected/locals.run +++ b/ci/expected/locals.run @@ -1,3 +1,3 @@ -foo: local_to_foo = 1 bar: local_to_bar = 1 +foo: local_to_foo = 1 idle: local_to_idle = 1 diff --git a/ci/expected/not-sync.run b/ci/expected/not-sync.run index e69de29bb2..cd91476aac 100644 --- a/ci/expected/not-sync.run +++ b/ci/expected/not-sync.run @@ -0,0 +1,3 @@ +init +bar a 13 +foo a 13 diff --git a/examples/binds.rs b/examples/binds.rs index d78dffbf5f..0c1ed971bd 100644 --- a/examples/binds.rs +++ b/examples/binds.rs @@ -34,10 +34,9 @@ mod app { rtic::pend(Interrupt::UART0); - debug::exit(debug::EXIT_SUCCESS); // Exit QEMU simulator - loop { cortex_m::asm::nop(); + debug::exit(debug::EXIT_SUCCESS); // Exit QEMU simulator } } diff --git a/examples/extern_binds.rs b/examples/extern_binds.rs index 23b99d5ad5..b24e7a1929 100644 --- a/examples/extern_binds.rs +++ b/examples/extern_binds.rs @@ -40,10 +40,9 @@ mod app { rtic::pend(Interrupt::UART0); - debug::exit(debug::EXIT_SUCCESS); // Exit QEMU simulator - loop { cortex_m::asm::nop(); + debug::exit(debug::EXIT_SUCCESS); // Exit QEMU simulator } } diff --git a/examples/generics.rs b/examples/generics.rs index 7117349a1e..dfd47adfb1 100644 --- a/examples/generics.rs +++ b/examples/generics.rs @@ -39,6 +39,7 @@ mod app { rtic::pend(Interrupt::UART1); + cortex_m::asm::nop(); debug::exit(debug::EXIT_SUCCESS); // Exit QEMU simulator } diff --git a/examples/hardware.rs b/examples/hardware.rs index d3ceab9ed6..61eb6357aa 100644 --- a/examples/hardware.rs +++ b/examples/hardware.rs @@ -37,10 +37,9 @@ mod app { rtic::pend(Interrupt::UART0); - debug::exit(debug::EXIT_SUCCESS); // Exit QEMU simulator - loop { cortex_m::asm::nop(); + debug::exit(debug::EXIT_SUCCESS); // Exit QEMU simulator } } diff --git a/examples/not-sync.rs b/examples/not-sync.rs index 28a48f2321..5d868dfb52 100644 --- a/examples/not-sync.rs +++ b/examples/not-sync.rs @@ -62,6 +62,6 @@ mod app { #[task(shared = [&shared])] async fn bar(c: bar::Context) { let shared: &NotSync = c.shared.shared; - hprintln!("foo a {}", shared.data); + hprintln!("bar a {}", shared.data); } } diff --git a/xtask/src/main.rs b/xtask/src/main.rs index 76ce04bd4c..7eada91732 100644 --- a/xtask/src/main.rs +++ b/xtask/src/main.rs @@ -87,12 +87,14 @@ fn main() -> anyhow::Result<()> { let targets = [ARMV7M, ARMV6M]; let examples: Vec<_> = std::fs::read_dir("./examples")? - .filter_map(|path| { - path.map(|p| p.path().file_stem().unwrap().to_str().unwrap().to_string()) - .ok() - }) + .filter_map(|p| p.ok()) + .map(|p| p.path()) + .filter(|p| p.display().to_string().ends_with(".rs")) + .map(|path| path.file_stem().unwrap().to_str().unwrap().to_string()) .collect(); + println!("examples: {examples:?}"); + let opts = Options::from_args(); let target = &opts.target;