File tree Expand file tree Collapse file tree 2 files changed +12
-5
lines changed Expand file tree Collapse file tree 2 files changed +12
-5
lines changed Original file line number Diff line number Diff line change 1
1
---
2
- refs/heads/master: 6f57c61ed0e7f5c6f3b5cc9edd83c8728b2210a1
2
+ refs/heads/master: 61b1875c16de39c166b0f4d54bba19f9c6777d1a
3
3
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4
4
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
5
5
refs/heads/try: 2898dcc5d97da9427ac367542382b6239d9c0bbf
Original file line number Diff line number Diff line change @@ -11,9 +11,7 @@ import io::{reader, reader_util};
11
11
fn main ( argv : [ str ] /~) {
12
12
#macro[
13
13
[ #bench[ id] ,
14
- if tests. len ( ) == 0 || vec:: contains ( tests, #stringify ( id) ) {
15
- run_test ( #stringify ( id) , id) ;
16
- }
14
+ maybe_run_test ( argv, #stringify ( id) , id)
17
15
]
18
16
] ;
19
17
@@ -27,7 +25,16 @@ fn main(argv: [str]/~) {
27
25
#bench[ vec_push_all] ;
28
26
}
29
27
30
- fn run_test ( name : str , test : fn ( ) ) {
28
+ fn maybe_run_test ( argv : [ str ] /& , name : str , test : fn ( ) ) {
29
+ let mut run_test = false ;
30
+
31
+ if os:: getenv ( "RUST_BENCH" ) . is_some ( ) { run_test = true }
32
+ else if argv. len ( ) > 0 {
33
+ run_test = argv. contains ( "all" ) || argv. contains ( name)
34
+ }
35
+
36
+ if !run_test { ret }
37
+
31
38
let start = precise_time_s ( ) ;
32
39
test ( ) ;
33
40
let stop = precise_time_s ( ) ;
You can’t perform that action at this time.
0 commit comments