File tree Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change 1111// ignore-sgx no subprocess support
1212
1313#![ cfg( test) ]
14+ #![ feature( test) ]
15+
16+ extern crate test;
1417
1518use std:: io:: Write ;
1619use std:: env;
20+ use test:: Bencher ;
1721
1822#[ test]
1923fn it_works ( ) {
@@ -48,3 +52,8 @@ fn no_residual_environment() {
4852 }
4953 }
5054}
55+
56+ #[ bench]
57+ fn benchmark ( b : & mut Bencher ) {
58+ b. iter ( || assert_eq ! ( 1 + 1 , 2 ) ) ;
59+ }
Original file line number Diff line number Diff line change 11
2- running 5 tests
2+ running 6 tests
3+ test benchmark ... ok
34test it_exits ... FAILED
45test it_fails ... FAILED
56test it_panics - should panic ... ok
@@ -18,13 +19,13 @@ testing123
1819testing321
1920thread 'main' panicked at 'assertion failed: `(left == right)`
2021 left: `2`,
21- right: `5`', $DIR/test-panic-abort.rs:34 :5
22+ right: `5`', $DIR/test-panic-abort.rs:38 :5
2223note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
2324
2425
2526failures:
2627 it_exits
2728 it_fails
2829
29- test result: FAILED. 3 passed; 2 failed; 0 ignored; 0 measured; 0 filtered out; finished in $TIME
30+ test result: FAILED. 4 passed; 2 failed; 0 ignored; 0 measured; 0 filtered out; finished in $TIME
3031
You can’t perform that action at this time.
0 commit comments