-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Closed
Labels
C-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`
Description
Problem
cargo test
only prints ok/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:
running 2 tests
test tests::test_fast ... ok
test tests::test_slow ... ok (1200ms)
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
Metadata
Metadata
Assignees
Labels
C-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`