-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
cargo test
should show test execution time for slower tests
#10208
Comments
Thanks for the suggestion! I believe this is already implemented via the |
@ehuss thanks for the quick reply -- this is exactly what I was looking for! I so wish it was a bit more discoverable - I searched through the |
I don't think we want to replicate all of the help content (and I don't think we can with the built-in help), but I think adding a small mention to run |
Per rust-lang#10208, make `cargo test -- --help` more discoverable.
Thanks @ehuss , submitted. I wasn't too sure what to call those options - it is not very clear what those options are, as they are part of the rustc default test harness i guess. |
Minor docs change for `cargo test --help` Per #10208, make `cargo test -- --help` more discoverable.
Problem
cargo test
only printsok/FAILED
after each test. In some cases, it might be very useful to see the test duration, similar to mocha-js. Of course this is not as good as having a comprehensive benchmark tests, but in many cases it would give general feedback of how long each test took.Proposed Solution
Print the time each test took to run in ms, either always, or just for the tests that take longer than some magic number like 10ms:
Notes
Not sure if it would be worth it to introduce attributes to set the expected execution time, something like
#[test(slow = 5000)]
-- this would clearly be a far wider discussion.Example from the Mocha project
The text was updated successfully, but these errors were encountered: