File tree Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -55,6 +55,7 @@ class BenchmarkDriver(object):
55
55
self .args = args
56
56
self ._subprocess = _subprocess or subprocess
57
57
self .all_tests = []
58
+ self .test_number = {}
58
59
self .tests = tests or self ._get_tests ()
59
60
self .parser = parser or LogParser ()
60
61
self .results = {}
@@ -112,6 +113,7 @@ class BenchmarkDriver(object):
112
113
]
113
114
# unzip list of pairs into 2 lists
114
115
test_numbers , self .all_tests = map (list , zip (* number_name_pairs ))
116
+ self .test_number = dict (zip (self .all_tests , test_numbers ))
115
117
if self .args .filters :
116
118
return self ._tests_matching_patterns ()
117
119
if self .args .benchmarks :
Original file line number Diff line number Diff line change @@ -181,14 +181,16 @@ def test_test_harness(self):
181
181
def test_gets_list_of_precommit_benchmarks (self ):
182
182
self .subprocess_mock .expect (
183
183
'/benchmarks/Benchmark_O --list --delim=\t ' .split (' ' ),
184
- '#\t Test\t [Tags]\n 1\t Benchmark1\t [t1, t2]\n 1 \t Benchmark2\t [t3]\n ' )
184
+ '#\t Test\t [Tags]\n 1\t Benchmark1\t [t1, t2]\n 2 \t Benchmark2\t [t3]\n ' )
185
185
driver = BenchmarkDriver (
186
186
self .args , _subprocess = self .subprocess_mock )
187
187
self .subprocess_mock .assert_called_all_expected ()
188
188
self .assertEquals (driver .tests ,
189
189
['Benchmark1' , 'Benchmark2' ])
190
190
self .assertEquals (driver .all_tests ,
191
191
['Benchmark1' , 'Benchmark2' ])
192
+ self .assertEquals (driver .test_number ['Benchmark1' ], "1" )
193
+ self .assertEquals (driver .test_number ['Benchmark2' ], "2" )
192
194
193
195
list_all_tests = (
194
196
'/benchmarks/Benchmark_O --list --delim=\t --skip-tags=' .split (' ' ),
You can’t perform that action at this time.
0 commit comments