aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools
diff options
context:
space:
mode:
authorGravatar Kevin Lubick <kjlubick@google.com>2017-10-13 08:15:09 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-10-13 13:13:47 +0000
commitcccaef1667857432a68051000ab3f338fc2e64b6 (patch)
treef7d3a2527cdc874969a06a1aea93ea36f7dd7408 /tools
parentbd27d1de7ac766de3eaf596eb82c6b2ab7f7677b (diff)
Modify skpbench to use newer adb version
Bug: skia: NOTRY=true Change-Id: Ib630d352b6922280ef5772e6843f8f031baeffaf Reviewed-on: https://skia-review.googlesource.com/59161 Reviewed-by: Eric Boren <borenet@google.com> Commit-Queue: Kevin Lubick <kjlubick@google.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/skpbench/_adb.py4
-rw-r--r--tools/skpbench/_adb_path.py4
-rwxr-xr-xtools/skpbench/skpbench.py11
3 files changed, 11 insertions, 8 deletions
diff --git a/tools/skpbench/_adb.py b/tools/skpbench/_adb.py
index 66ef623fa5..b3b10b7bad 100644
--- a/tools/skpbench/_adb.py
+++ b/tools/skpbench/_adb.py
@@ -9,8 +9,8 @@ import subprocess
import sys
class Adb:
- def __init__(self, device_serial=None, echo=False):
- self.__invocation = ['adb']
+ def __init__(self, device_serial=None, adb_binary=None, echo=False):
+ self.__invocation = [adb_binary]
if device_serial:
self.__invocation.extend(['-s', device_serial])
self.__echo = echo
diff --git a/tools/skpbench/_adb_path.py b/tools/skpbench/_adb_path.py
index 4d8bce4425..dc23fc5895 100644
--- a/tools/skpbench/_adb_path.py
+++ b/tools/skpbench/_adb_path.py
@@ -9,9 +9,9 @@ import subprocess
__ADB = None
-def init(device_serial):
+def init(device_serial, adb_binary):
global __ADB
- __ADB = Adb(device_serial)
+ __ADB = Adb(device_serial, adb_binary)
def join(*pathnames):
return '/'.join(pathnames)
diff --git a/tools/skpbench/skpbench.py b/tools/skpbench/skpbench.py
index ef44577c53..6b4c555a76 100755
--- a/tools/skpbench/skpbench.py
+++ b/tools/skpbench/skpbench.py
@@ -61,11 +61,13 @@ __argparse.add_argument('-a', '--resultsfile',
__argparse.add_argument('skps',
nargs='+',
help=".skp files or directories to expand for .skp files")
+__argparse.add_argument('--adb_binary', default='adb',
+ help="The name of the adb binary to use.")
FLAGS = __argparse.parse_args()
if FLAGS.adb:
import _adb_path as _path
- _path.init(FLAGS.device_serial)
+ _path.init(FLAGS.device_serial, FLAGS.adb_binary)
else:
import _os_path as _path
@@ -110,9 +112,9 @@ class SKPBench:
ARGV.extend(['--fps', 'true'])
if FLAGS.adb:
if FLAGS.device_serial is None:
- ARGV[:0] = ['adb', 'shell']
+ ARGV[:0] = [FLAGS.adb_binary, 'shell']
else:
- ARGV[:0] = ['adb', '-s', FLAGS.device_serial, 'shell']
+ ARGV[:0] = [FLAGS.adb_binary, '-s', FLAGS.device_serial, 'shell']
@classmethod
def get_header(cls, outfile=sys.stdout):
@@ -278,7 +280,8 @@ def main():
skps = _path.find_skps(FLAGS.skps)
if FLAGS.adb:
- adb = Adb(FLAGS.device_serial, echo=(FLAGS.verbosity >= 5))
+ adb = Adb(FLAGS.device_serial, FLAGS.adb_binary,
+ echo=(FLAGS.verbosity >= 5))
model = adb.check('getprop ro.product.model').strip()
if model == 'Pixel C':
from _hardware_pixel_c import HardwarePixelC