Skip to content

Suggest --ignored when libtest ignores a test #114818

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

Open
jyn514 opened this issue Aug 14, 2023 · 1 comment
Open

Suggest --ignored when libtest ignores a test #114818

jyn514 opened this issue Aug 14, 2023 · 1 comment
Assignees
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-libtest Area: `#[test]` / the `test` library

Comments

@jyn514
Copy link
Member

jyn514 commented Aug 14, 2023

Code

; cat src/lib.rs
#[test]
#[ignore = "takes too long 😩"]
fn i_am_slow() {
    std::thread::sleep(std::time::Duration::from_secs(5));
    println!("it works!");
}
; cargo test --lib --quiet

Current output

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

test: i_am_slow, ignore_message: takes too long 😩

Desired output

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

test: i_am_slow, ignore_message: takes too long 😩

note: to run ignored tests, use `--ignored`

Rationale and extra context

See rust-lang/cargo#12494; currently this will be confusing for people using cargo so I'd like to fix that issue first.

Other cases

If no tests are ignored, this help message shouldn't be printed.

Anything else?

No response

@jyn514 jyn514 added A-diagnostics Area: Messages for errors, warnings, and lints A-libtest Area: `#[test]` / the `test` library labels Aug 14, 2023
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Aug 14, 2023
@saethlin saethlin removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Aug 15, 2023
@RickleAndMortimer
Copy link
Contributor

@rustbot claim

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-libtest Area: `#[test]` / the `test` library
Projects
Status: No status
Development

No branches or pull requests

4 participants