-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Closed
Description
(Originally filed as rust-lang/cargo#3009.)
I'm worried that it's very easy to misspell a test's name, see the (zero tests) success output from cargo, and miss the fact that your test didn't run. Here's a couple examples from my project. First the correct spelling:
$ cargo test test_file
Running target/debug/duct-0b3d1841f083e660
running 1 test
test test::test_file ... ok
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured
Doc-tests duct
running 0 tests
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured
And misspelled, so that no tests actually run:
$ cargo test tast_file
Running target/debug/duct-0b3d1841f083e660
running 0 tests
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured
Doc-tests duct
running 0 tests
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured
You can't see it here on GitHub, but the strongest detail in the terminal is that most of the green colored text (the ok's) is the same in both examples. Also because doc tests come after, and I have no doc tests in this project, the last three lines are also the same.
I can't think of a use case where you'd want the test runner to silently do nothing. Can we make running no tests an error?
Metadata
Metadata
Assignees
Labels
No labels