File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed
benchmark/scripts/perf_test_driver Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change 15
15
from __future__ import print_function
16
16
17
17
import functools
18
+ import glob
18
19
import multiprocessing
19
20
import os
21
+ import platform
20
22
import re
21
23
import subprocess
22
24
@@ -80,6 +82,22 @@ def _unwrap_self(args):
80
82
return type (args [0 ]).process_input (* args )
81
83
82
84
85
+ def get_benchmark_executable (binary_dir , opt_level ):
86
+ suffix = opt_level + "-" + platform .machine () + "*"
87
+ pattern = os .path .join (binary_dir , "Benchmark_" + suffix )
88
+ executables = glob .glob (pattern )
89
+ if len (executables ) == 0 :
90
+ raise ValueError (
91
+ "No benchmark executable for file name pattern " +
92
+ pattern + " found" )
93
+ if len (executables ) > 1 :
94
+ raise ValueError (
95
+ "Multiple benchmark executables for file name pattern " +
96
+ pattern + " found\n " +
97
+ str (executables ))
98
+ return executables [0 ]
99
+
100
+
83
101
BenchmarkDriver_OptLevels = ["Onone" , "O" , "Osize" ]
84
102
85
103
@@ -92,7 +110,7 @@ def __init__(
92
110
opt_levels = BenchmarkDriver_OptLevels ,
93
111
):
94
112
self .targets = [
95
- (os . path . join (binary_dir , "Benchmark_%s" % o ), o ) for o in opt_levels
113
+ (get_benchmark_executable (binary_dir , o ), o ) for o in opt_levels
96
114
]
97
115
self .xfail_list = xfail_list
98
116
self .enable_parallel = enable_parallel
You can’t perform that action at this time.
0 commit comments