Skip to content

Commit

Permalink
Mark ignored functions as used in defmt-test
Browse files Browse the repository at this point in the history
This is to not cause a `dead_code` warning when an ignored test function
is not run.
  • Loading branch information
justahero committed Oct 27, 2021
1 parent e04efed commit 9d2a885
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
3 changes: 1 addition & 2 deletions firmware/defmt-test/macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,7 @@ fn tests_impl(args: TokenStream, input: TokenStream) -> parse::Result<TokenStrea
quote!(#ident())
};
if ignore {
// we need to add a dummy statement here to keep same number of items in vec
unit_test_calls.push(quote!());
unit_test_calls.push(quote!(let _ = #call;));
} else {
unit_test_calls.push(quote!(
#krate::export::check_outcome(#call, #should_error);
Expand Down
1 change: 0 additions & 1 deletion firmware/qemu/tests/defmt-test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ mod tests {

#[test]
#[ignore]
#[allow(dead_code)]
fn ignored() -> Result<(), ()> {
Err(())
}
Expand Down

0 comments on commit 9d2a885

Please sign in to comment.