@@ -45,20 +45,25 @@ LISTALL-SAME: unstable
45
45
LISTALL: AngryPhonebook
46
46
````
47
47
48
- ````
49
- RUN: %Benchmark_O AngryPhonebook --num-iters=1 \
50
- RUN: | %FileCheck %s --check-prefix NUMITERS1
51
- NUMITERS1: AngryPhonebook,1
52
- NUMITERS1-NOT: 0,0,0,0,0
53
- ````
48
+ ## Benchmark Selection
49
+ The logic for filtering tests based on specified names, indices and tags
50
+ is shared between the default "run" and ` --list ` commands. It is tested on
51
+ the list command, which is much faster, because it runs no benchmarks.
52
+ It provides us with ability to do a "dry run".
54
53
55
- Should run benchmark by name, even if its tags match the default skip-tags
56
- (unstable,skip). Ackermann is marked unstable
54
+ Run benchmark by name (even if its tags match the skip-tags) or test number:
57
55
58
56
````
59
- RUN: %Benchmark_O Ackermann | %FileCheck %s --check-prefix NAMEDSKIP
57
+ RUN: %Benchmark_O Ackermann --list | %FileCheck %s --check-prefix NAMEDSKIP
60
58
NAMEDSKIP: Ackermann
61
59
60
+ RUN: %Benchmark_O 1 --list | %FileCheck %s --check-prefix RUNBYNUMBER
61
+ RUNBYNUMBER: Ackermann
62
+ ````
63
+
64
+ Composition of ` tags ` and ` skip-tags ` :
65
+
66
+ ````
62
67
RUN: %Benchmark_O --list --tags=Dictionary,Array \
63
68
RUN: | %FileCheck %s --check-prefix ANDTAGS
64
69
ANDTAGS: TwoSum
@@ -80,3 +85,23 @@ ORSKIPTAGS-NOT: DictOfArraysToArrayOfDicts
80
85
ORSKIPTAGS: Fibonacci
81
86
ORSKIPTAGS-NOT: RomanNumbers
82
87
````
88
+
89
+ ## Running Benchmarks
90
+ Each real benchmark execution takes about a second. If possible, multiple checks
91
+ are combined into one run to minimize the test time.
92
+
93
+ ````
94
+ RUN: %Benchmark_O AngryPhonebook --num-iters=1 \
95
+ RUN: | %FileCheck %s --check-prefix NUMITERS1 \
96
+ RUN: --check-prefix LOGHEADER \
97
+ RUN: --check-prefix LOGBENCH
98
+ LOGHEADER-LABEL: #,TEST,SAMPLES,MIN(us),MAX(us),MEAN(us),SD(us),MEDIAN(us)
99
+ LOGBENCH: {{[0-9]+}},
100
+ NUMITERS1: AngryPhonebook,1
101
+ NUMITERS1-NOT: 0,0,0,0,0
102
+ LOGBENCH-SAME: ,{{[0-9]+}},{{[0-9]+}},{{[0-9]+}},{{[0-9]+}},{{[0-9]+}}
103
+
104
+ RUN: %Benchmark_O 1 Ackermann 1 | %FileCheck %s --check-prefix RUNJUSTONCE
105
+ RUNJUSTONCE-LABEL: 1,Ackermann
106
+ RUNJUSTONCE-NOT: 1,Ackermann
107
+ ````
0 commit comments