defmt-test: Modify attributes in place and handle #[cfg]#383
Merged
bors[bot] merged 2 commits intoknurling-rs:mainfrom Feb 10, 2021
jonas-schievink:test-attrs
Merged
defmt-test: Modify attributes in place and handle #[cfg]#383bors[bot] merged 2 commits intoknurling-rs:mainfrom jonas-schievink:test-attrs
bors[bot] merged 2 commits intoknurling-rs:mainfrom
jonas-schievink:test-attrs
Conversation
japaric
reviewed
Feb 10, 2021
| format!( | ||
| "({}/{}) running `{}`...", | ||
| i + 1, | ||
| tests.len(), |
Member
There was a problem hiding this comment.
the number of tests that will run is not known in this context because cfg are evaluated after expansion
Contributor
Author
There was a problem hiding this comment.
Yeah, I changed it so it gets computed at runtime (or in a const) in adce0f3
japaric
reviewed
Feb 10, 2021
japaric
approved these changes
Feb 10, 2021
Member
japaric
left a comment
There was a problem hiding this comment.
The overall approach looks good to me but the log messages that report which test is run next should also be cfg-ed
Member
|
bors r+ |
Contributor
|
Build succeeded: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes (?) #381 (but doesn't add
#[ignore]support)This changes the defmt-test macro to retain the
ItemFns 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.