-
-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
defmt-test: Modify attributes in place and handle #[cfg] #383
Conversation
format!( | ||
"({}/{}) running `{}`...", | ||
i + 1, | ||
tests.len(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the number of tests that will run is not known in this context because cfg are evaluated after expansion
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I changed it so it gets computed at runtime (or in a const
) in adce0f3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The overall approach looks good to me but the log messages that report which test is run next should also be cfg
-ed
bors r+ |
Build succeeded: |
Closes (?) #381 (but doesn't add
#[ignore]
support)This changes the defmt-test macro to retain the
ItemFn
s and selectively delete defmt-test-specific attributes from them. The result is that the code is now simpler and arbitrary Rust attributes can be attached to tests. Doing so with#[ignore]
gives the expected "unused attribute" warning.