mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
benchmarks: support new executable file names in perf_test_driver
rdar://problem/65508278
This commit is contained in:
@@ -15,8 +15,10 @@
|
||||
from __future__ import print_function
|
||||
|
||||
import functools
|
||||
import glob
|
||||
import multiprocessing
|
||||
import os
|
||||
import platform
|
||||
import re
|
||||
import subprocess
|
||||
|
||||
@@ -80,6 +82,22 @@ def _unwrap_self(args):
|
||||
return type(args[0]).process_input(*args)
|
||||
|
||||
|
||||
def get_benchmark_executable(binary_dir, opt_level):
|
||||
suffix = opt_level + "-" + platform.machine() + "*"
|
||||
pattern = os.path.join(binary_dir, "Benchmark_" + suffix)
|
||||
executables = glob.glob(pattern)
|
||||
if len(executables) == 0:
|
||||
raise ValueError(
|
||||
"No benchmark executable for file name pattern " +
|
||||
pattern + " found")
|
||||
if len(executables) > 1:
|
||||
raise ValueError(
|
||||
"Multiple benchmark executables for file name pattern " +
|
||||
pattern + " found\n" +
|
||||
str(executables))
|
||||
return executables[0]
|
||||
|
||||
|
||||
BenchmarkDriver_OptLevels = ["Onone", "O", "Osize"]
|
||||
|
||||
|
||||
@@ -92,7 +110,7 @@ class BenchmarkDriver(object):
|
||||
opt_levels=BenchmarkDriver_OptLevels,
|
||||
):
|
||||
self.targets = [
|
||||
(os.path.join(binary_dir, "Benchmark_%s" % o), o) for o in opt_levels
|
||||
(get_benchmark_executable(binary_dir, o), o) for o in opt_levels
|
||||
]
|
||||
self.xfail_list = xfail_list
|
||||
self.enable_parallel = enable_parallel
|
||||
|
||||
Reference in New Issue
Block a user