@@ -106,16 +106,16 @@ class BenchmarkDriver(object):
106
106
107
107
def _get_tests (self ):
108
108
"""Return a list of performance tests to run."""
109
- index_name_pairs = [
109
+ number_name_pairs = [
110
110
line .split ('\t ' )[:2 ] for line in
111
111
self ._invoke (self ._cmd_list_benchmarks ).split ('\n ' )[1 :- 1 ]
112
112
]
113
113
# unzip list of pairs into 2 lists
114
- indices , self .all_tests = map (list , zip (* index_name_pairs ))
114
+ test_numbers , self .all_tests = map (list , zip (* number_name_pairs ))
115
115
if self .args .filters :
116
116
return self ._tests_matching_patterns ()
117
117
if self .args .benchmarks :
118
- return self ._tests_by_name_or_index ( indices )
118
+ return self ._tests_by_name_or_number ( test_numbers )
119
119
return self .all_tests
120
120
121
121
def _tests_matching_patterns (self ):
@@ -124,13 +124,14 @@ class BenchmarkDriver(object):
124
124
for name in self .all_tests
125
125
if pattern .match (name )])))
126
126
127
- def _tests_by_name_or_index (self , indices ):
127
+ def _tests_by_name_or_number (self , test_numbers ):
128
128
benchmarks = set (self .args .benchmarks )
129
- index_to_name = dict (zip (indices , self .all_tests ))
130
- indexed_names = [index_to_name [i ]
131
- for i in benchmarks .intersection (set (indices ))]
132
- return sorted (list (
133
- benchmarks .intersection (set (self .all_tests )).union (indexed_names )))
129
+ number_to_name = dict (zip (test_numbers , self .all_tests ))
130
+ tests_by_number = [number_to_name [i ]
131
+ for i in benchmarks .intersection (set (test_numbers ))]
132
+ return sorted (list (benchmarks
133
+ .intersection (set (self .all_tests ))
134
+ .union (tests_by_number )))
134
135
135
136
def run (self , test = None , num_samples = None , num_iters = None ,
136
137
sample_time = None , verbose = None , measure_memory = False ,
0 commit comments