File tree Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -174,8 +174,9 @@ struct TestConfig {
174
174
tags: Set < BenchmarkCategory > ,
175
175
skipTags: Set < BenchmarkCategory >
176
176
) -> [ ( index: String , info: BenchmarkInfo ) ] {
177
+ let allTests = registeredBenchmarks. sorted ( )
177
178
let indices = Dictionary ( uniqueKeysWithValues:
178
- zip ( registeredBenchmarks . sorted ( ) . map { $0. name } ,
179
+ zip ( allTests . map { $0. name } ,
179
180
( 1 ... ) . lazy. map { String ( $0) } ) )
180
181
181
182
func byTags( b: BenchmarkInfo ) -> Bool {
@@ -186,7 +187,7 @@ struct TestConfig {
186
187
return specifiedTests. contains ( b. name) ||
187
188
specifiedTests. contains ( indices [ b. name] !)
188
189
} // !! "All registeredBenchmarks have been assigned an index"
189
- return registeredBenchmarks
190
+ return allTests
190
191
. filter ( specifiedTests. isEmpty ? byTags : byNamesOrIndices)
191
192
. map { ( index: indices [ $0. name] !, info: $0) }
192
193
}
Original file line number Diff line number Diff line change @@ -86,6 +86,19 @@ ORSKIPTAGS: Fibonacci
86
86
ORSKIPTAGS-NOT: RomanNumbers
87
87
````
88
88
89
+ Alphabetic sorting of tests
90
+
91
+ ````
92
+ RUN: %Benchmark_O --list \
93
+ RUN: | %FileCheck %s --check-prefix ALPHASORT
94
+ ALPHASORT: COWArrayGuaranteedParameterOverhead
95
+ ALPHASORT: COWTree
96
+ ALPHASORT: ChainedFilterMap
97
+ ALPHASORT: Chars
98
+ ALPHASORT: FatCompactMap
99
+
100
+ ````
101
+
89
102
## Running Benchmarks
90
103
Each real benchmark execution takes about a second per sample. If possible,
91
104
multiple checks are combined into one run to minimize the test time.
You can’t perform that action at this time.
0 commit comments