bench_dir = os.path.normpath(os.path.join(*self.path))
os.chdir(os.path.join(suite_dir, bench_dir))
- def GetCommandFlags(self):
+ def GetCommandFlags(self, extra_flags=None):
suffix = ["--"] + self.test_flags if self.test_flags else []
- return self.flags + [self.main] + suffix
+ return self.flags + (extra_flags or []) + [self.main] + suffix
- def GetCommand(self, shell_dir):
+ def GetCommand(self, shell_dir, extra_flags=None):
# TODO(machenbach): This requires +.exe if run on windows.
- return [os.path.join(shell_dir, self.binary)] + self.GetCommandFlags()
+ cmd = [os.path.join(shell_dir, self.binary)]
+ return cmd + self.GetCommandFlags(extra_flags=extra_flags)
def Run(self, runner):
"""Iterates over several runs and handles the output for all traces."""
class DesktopPlatform(Platform):
def __init__(self, options):
self.shell_dir = options.shell_dir
+ self.extra_flags = options.extra_flags.split()
def PreExecution(self):
pass
def Run(self, runnable, count):
try:
- output = commands.Execute(runnable.GetCommand(self.shell_dir),
- timeout=runnable.timeout)
+ output = commands.Execute(
+ runnable.GetCommand(self.shell_dir, self.extra_flags),
+ timeout=runnable.timeout,
+ )
except OSError as e:
print ">>> OSError (#%d):" % (count + 1)
print e
def __init__(self, options):
self.shell_dir = options.shell_dir
+ self.extra_flags = options.extra_flags.split()
LoadAndroidBuildTools(options.android_build_tools)
if not options.device:
cache = cache_control.CacheControl(self.device)
cache.DropRamCaches()
binary_on_device = AndroidPlatform.DEVICE_DIR + runnable.binary
- cmd = [binary_on_device] + runnable.GetCommandFlags()
+ cmd = [binary_on_device] + runnable.GetCommandFlags(self.extra_flags)
# Relative path to benchmark directory.
if runnable.path:
parser.add_option("--device",
help="The device ID to run Android tests on. If not given "
"it will be autodetected.")
+ parser.add_option("--extra-flags",
+ help="Additional flags to pass to the test executable",
+ default="")
parser.add_option("--json-test-results",
help="Path to a file for storing json results.")
parser.add_option("--outdir", help="Base directory with compile output",