File tree Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -141,6 +141,16 @@ struct TestConfig {
141
141
tags: c. tags ?? [ ] ,
142
142
skipTags: c. skipTags ?? [ . unstable, . skip] )
143
143
144
+ if logMemory && tests. count > 1 {
145
+ print (
146
+ """
147
+ warning: The memory usage of a test, reported as the change in MAX_RSS,
148
+ is based on measuring the peak memory used by the whole process.
149
+ These results are meaningful only when running a single test,
150
+ not in the batch mode!
151
+ """ )
152
+ }
153
+
144
154
if verbose {
145
155
let testList = tests. map ( { $0. 1 . name } ) . joined ( separator: " , " )
146
156
print ( """
@@ -186,7 +196,7 @@ struct TestConfig {
186
196
func byNamesOrIndices( b: BenchmarkInfo ) -> Bool {
187
197
return specifiedTests. contains ( b. name) ||
188
198
specifiedTests. contains ( indices [ b. name] !)
189
- } // !! "All registeredBenchmarks have been assigned an index"
199
+ } // !! "`allTests` have been assigned an index"
190
200
return allTests
191
201
. filter ( specifiedTests. isEmpty ? byTags : byNamesOrIndices)
192
202
. map { ( index: indices [ $0. name] !, info: $0) }
Original file line number Diff line number Diff line change @@ -188,6 +188,14 @@ BADSKIPTAG: error: 'bogus' is not a valid 'BenchmarkCategory'
188
188
189
189
````
190
190
191
+ Measuring memory use of a test with our method is valid only for single test.
192
+
193
+ ````
194
+ RUN: %Benchmark_O 1 2 --memory --list \
195
+ RUN: 2>&1 | %FileCheck %s --check-prefix WARNMEMORY
196
+ WARNMEMORY: warning:
197
+ ````
198
+
191
199
## Usage
192
200
193
201
````
You can’t perform that action at this time.
0 commit comments