Skip to content
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: #[ignore] attribute support #390

Closed
japaric opened this issue Feb 15, 2021 · 3 comments
Closed

defmt-test: #[ignore] attribute support #390

japaric opened this issue Feb 15, 2021 · 3 comments
Labels
difficulty: medium Somewhat difficult to solve priority: low Low priority for the Knurling team status: needs PR Issue just needs a Pull Request implementing the changes type: enhancement Enhancement or feature request

Comments

@japaric
Copy link
Member

japaric commented Feb 15, 2021

Support this

// inside the `#[defmt_test::test]` module
#[ignore] 
#[test]
fn foo() {}

Tests marked as ignore-d should be compiled but not executed.
Ignored tests should be reported on the console output but should not be account for in the progress counter (e.g. 1/3).

@japaric japaric added type: enhancement Enhancement or feature request priority: low Low priority for the Knurling team status: needs PR Issue just needs a Pull Request implementing the changes labels Feb 15, 2021
@Urhengulas Urhengulas added the difficulty: medium Somewhat difficult to solve label Mar 16, 2021
@Urhengulas
Copy link
Member

  • Clarification question: The test should get compiled, but never executed. What will then get reported in the console?
  • Also is compatibility with the --include-ignored flag desired? (link)

@japaric
Copy link
Member Author

japaric commented Mar 22, 2021

Clarification question: The test should get compiled, but never executed. What will then get reported in the console?

Ideally, something similar to what the built-in test harness reports:

test tests::it_works ... ignored

Also is compatibility with the --include-ignored flag desired?

we don't support "test" related flags in probe-run. That's blocked on this RFC

bors bot added a commit that referenced this issue Nov 9, 2021
618: Support #[ignore] attribute in defmt_test r=japaric a=justahero

This PR adds support for the `#[ignore]` attribute in `defmt_test` to solve #390. Similar to the [`ignore`](https://doc.rust-lang.org/reference/attributes/testing.html#the-ignore-attribute) attribute, tests can be annotated with the attribute to ignore particular tests.

* use [`trybuild`](https://github.com/dtolnay/trybuild) crate to check multiple conditions with the proc macro

**Note** the message is different from the suggestion in #390 and should be revised accordingly if needed

Co-authored-by: Sebastian Ziebell <sebastian.ziebell@asquera.de>
@japaric
Copy link
Member Author

japaric commented Jan 14, 2022

implemented in #618

@japaric japaric closed this as completed Jan 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
difficulty: medium Somewhat difficult to solve priority: low Low priority for the Knurling team status: needs PR Issue just needs a Pull Request implementing the changes type: enhancement Enhancement or feature request
Projects
None yet
Development

No branches or pull requests

2 participants