Skip to content

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

@ijc

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?

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