This got refactored upstream. Test: checkbuild and ./run_tests.py Change-Id: I801869923cf7c51528de354f8a3da705f188ff43
25 lines
651 B
Python
25 lines
651 B
Python
import lit.util # pylint: disable=import-error
|
|
|
|
|
|
class AdbError(RuntimeError):
|
|
def __init__(self, cmd, out, err, exit_code):
|
|
super(AdbError, self).__init__(err)
|
|
self.cmd = cmd
|
|
self.out = out
|
|
self.err = err
|
|
self.exit_code = exit_code
|
|
|
|
|
|
def mkdir(path):
|
|
cmd = ['adb', 'shell', 'mkdir', path]
|
|
out, err, exit_code = lit.util.executeCommand(cmd)
|
|
if exit_code != 0:
|
|
raise AdbError(cmd, out, err, exit_code)
|
|
|
|
|
|
def push(src, dst):
|
|
cmd = ['adb', 'push', src, dst]
|
|
out, err, exit_code = lit.util.executeCommand(cmd)
|
|
if exit_code != 0:
|
|
raise AdbError(cmd, out, err, exit_code)
|