From cd14188bc8b4cd942ea7ea5cf5eb27955d8695ae Mon Sep 17 00:00:00 2001 From: Daniel Campora Date: Sun, 28 Jun 2015 14:01:27 +0200 Subject: tools: Add telnet support to pyboard.py. The adapter class "TelnetToSerial" is used to access the Telnet connection using the same API as with the serial connection. The function pyboard.run-test() has been removed to made the module generic and because this small test is no longer needed. --- tests/run-tests | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'tests') diff --git a/tests/run-tests b/tests/run-tests index bd2cbfd02..b4baff2b8 100755 --- a/tests/run-tests +++ b/tests/run-tests @@ -266,17 +266,19 @@ def run_tests(pyb, tests, args): def main(): cmd_parser = argparse.ArgumentParser(description='Run tests for Micro Python.') cmd_parser.add_argument('--target', default='unix', help='the target platform') - cmd_parser.add_argument('--device', default='/dev/ttyACM0', help='the serial device of the target board') + cmd_parser.add_argument('--device', default='/dev/ttyACM0', help='the serial device or the IP address of the pyboard') + cmd_parser.add_argument('-b', '--baudrate', default=115200, help='the baud rate of the serial device') + cmd_parser.add_argument('-u', '--user', default='micro', help='the telnet login username') + cmd_parser.add_argument('-p', '--password', default='python', help='the telnet login password') cmd_parser.add_argument('-d', '--test-dirs', nargs='*', help='input test directories (if no files given)') cmd_parser.add_argument('--write-exp', action='store_true', help='save .exp files to run tests w/o CPython') cmd_parser.add_argument('--emit', default='bytecode', help='Micro Python emitter to use (bytecode or native)') - cmd_parser.add_argument('-b', '--baudrate', default=115200, help='the baud rate of the serial device') cmd_parser.add_argument('files', nargs='*', help='input test files') args = cmd_parser.parse_args() if args.target == 'pyboard' or args.target == 'wipy': import pyboard - pyb = pyboard.Pyboard(args.device, args.baudrate) + pyb = pyboard.Pyboard(args.device, args.baudrate, args.user, args.password) pyb.enter_raw_repl() elif args.target == 'unix': pyb = None -- cgit v1.2.3