3 The tracking issue for this feature is: [#64888]
5 [#64888]: https://github.com/rust-lang/rust/issues/64888
7 ------------------------
9 The `report-time` feature adds a possibility to report execution time of the
10 tests generated via `libtest`.
12 This is unstable feature, so you have to provide `-Zunstable-options` to get
18 ./test_executable -Zunstable-options --report-time
25 Show execution time of each test.
26 Threshold values for colorized output can be
28 `RUST_TEST_TIME_UNIT`, `RUST_TEST_TIME_INTEGRATION`
30 `RUST_TEST_TIME_DOCTEST` environment variables.
31 Expected format of environment variable is
32 `VARIABLE=WARN_TIME,CRITICAL_TIME`.
33 Not available for --format=terse
35 Treat excess of the test execution time limit as
37 Threshold values for this option can be configured via
38 `RUST_TEST_TIME_UNIT`, `RUST_TEST_TIME_INTEGRATION`
40 `RUST_TEST_TIME_DOCTEST` environment variables.
41 Expected format of environment variable is
42 `VARIABLE=WARN_TIME,CRITICAL_TIME`.
43 `CRITICAL_TIME` here means the limit that should not be
47 Example of the environment variable format:
50 RUST_TEST_TIME_UNIT=100,200
53 where 100 stands for warn time, and 200 stands for critical time.
58 cargo test --tests -- -Zunstable-options --report-time
59 Finished dev [unoptimized + debuginfo] target(s) in 0.02s
60 Running target/debug/deps/example-27fb188025bec02c
63 test tests::unit_test_quick ... ok <0.000s>
64 test tests::unit_test_warn ... ok <0.055s>
65 test tests::unit_test_critical ... ok <0.110s>
67 test result: ok. 3 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out
69 Running target/debug/deps/tests-cedb06f6526d15d9
72 test unit_test_quick ... ok <0.000s>
73 test unit_test_warn ... ok <0.550s>
74 test unit_test_critical ... ok <1.100s>
76 test result: ok. 3 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out