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

Provide ignore message when the test ignored #10250

Closed
yanganto opened this issue Jan 3, 2022 · 2 comments
Closed

Provide ignore message when the test ignored #10250

yanganto opened this issue Jan 3, 2022 · 2 comments
Labels
C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`

Comments

@yanganto
Copy link

yanganto commented Jan 3, 2022

Problem

There may be meta value as a reason for ignoring attributes on a test case.
the-ignore-attribute

#[test]
#[ignore = "not yet implemented"]
fn test_ignored() {
    // …
}

It is good to show the reason if exist on the result of cargo test.

By the way, the crate will utilize this feature to help users easily to know why the test case ignored
https://github.com/yanganto/test-with/

This is the first post for me here, if there is something I need to change, please kindly tell me thanks.

Proposed Solution

For example to show the reason if exist as following result of cargo test.

running 2 tests
test tests::test_ignored ... ignored, *not yet implemented*
test tests::test_works ... ok

test result: ok. 1 passed; 0 failed; 1 ignored; 0 measured; 0 filtered out; finished in 0.00s

Notes

This issue also opens in Rust internal
https://internals.rust-lang.org/t/pre-rfc-provide-ignore-message-when-the-test-ignored/15904

@yanganto yanganto added the C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` label Jan 3, 2022
@weihanglo
Copy link
Member

My impression is that either solving the issue in runtime or compile time, the responsibility is on test frameworks but not cargo. Do you have any advice that this should be done in cargo?

@yanganto
Copy link
Author

yanganto commented Jan 3, 2022

The issue should not open here, I misunderstood the test flow. I thought that the test cases are controled by cargo test. Thanks for reminding this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`
Projects
None yet
Development

No branches or pull requests

2 participants