Skip to content

Commit

Permalink
Drop state before checking test outcome
Browse files Browse the repository at this point in the history
  • Loading branch information
t-moe committed Dec 14, 2023
1 parent 82c36fc commit a5f4a1a
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ harness = false

[dev-dependencies]
embedded-test = {version="0.2.0", features = ["log"]} # enable log or defmt to see some debug output
panic-probe = {git = "https://github.com/t-moe/defmt"} # the upstream create does not support riscv yet
panic-probe = {git = "https://github.com/t-moe/defmt", features=["print-log"]} # the upstream create does not support riscv yet
```

Install the runner on your system:
Expand Down
2 changes: 1 addition & 1 deletion macros/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "embedded-test-macros"
description = "proc-macros for the embedded-test crate"
version = "0.2.0"
version = "0.2.1"
edition = "2021"
repository = "https://github.com/probe-rs/embedded-test"
license = "MIT OR Apache-2.0"
Expand Down
9 changes: 6 additions & 3 deletions macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -259,9 +259,12 @@ fn tests_impl(args: TokenStream, input: TokenStream) -> parse::Result<TokenStrea

let init_run_and_check = quote!(
{
let state = #init_expr; // either init() or init().await
let outcome = #run_call; // either test(state), test(state).await, test(), or test().await
#krate::export::check_outcome(outcome);
let outcome;
{
let state = #init_expr; // either init() or init().await
outcome = #run_call; // either test(state), test(state).await, test(), or test().await
}
#krate::export::check_outcome(outcome);
}
);

Expand Down

0 comments on commit a5f4a1a

Please sign in to comment.