Skip to content

Support a string argument to "ignore" describing the reason #102

Description

@ijc

Since Rust 1.61.0 the argument to an ignore attribute has been printed as part of the test output. So:

#[test]
#[ignore = "Some reason"]
fn something() {...}

Will result in:

$ cargo test 
...
test something ... ignored, Some reason

I believe the syntax has been valid for some releases prior to 1.61.0 (I'm afraid I don't know since when) but was ignored.

It would be great if test_case's ignore modifier (and inconclusive I suppose) could similarly take an option reason and propagate it so that cargo test will show it.

I'm not sure that #[test_case(INPUT => ignore = "Some reason" OUTPUT)] will fit the current syntax but perhaps #[test_case(INPUT => ignore("Some reason") OUTPUT)] could work?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions