File tree 2 files changed +13
-3
lines changed
2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change 11
11
// ignore-sgx no subprocess support
12
12
13
13
#![ cfg( test) ]
14
+ #![ feature( test) ]
15
+
16
+ extern crate test;
14
17
15
18
use std:: io:: Write ;
16
19
use std:: env;
20
+ use test:: Bencher ;
17
21
18
22
#[ test]
19
23
fn it_works ( ) {
@@ -48,3 +52,8 @@ fn no_residual_environment() {
48
52
}
49
53
}
50
54
}
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 1
1
2
- running 5 tests
2
+ running 6 tests
3
+ test benchmark ... ok
3
4
test it_exits ... FAILED
4
5
test it_fails ... FAILED
5
6
test it_panics - should panic ... ok
@@ -18,13 +19,13 @@ testing123
18
19
testing321
19
20
thread 'main' panicked at 'assertion failed: `(left == right)`
20
21
left: `2`,
21
- right: `5`', $DIR/test-panic-abort.rs:34 :5
22
+ right: `5`', $DIR/test-panic-abort.rs:38 :5
22
23
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
23
24
24
25
25
26
failures:
26
27
it_exits
27
28
it_fails
28
29
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
30
31
You can’t perform that action at this time.
0 commit comments