Add JTAG related example tests
This commit is contained in:
@@ -19,7 +19,7 @@ import pexpect
|
||||
|
||||
|
||||
class CustomProcess(object):
|
||||
def __init__(self, cmd, logfile, verbose):
|
||||
def __init__(self, cmd, logfile, verbose=True):
|
||||
self.verbose = verbose
|
||||
self.f = open(logfile, 'w')
|
||||
if self.verbose:
|
||||
@@ -68,8 +68,8 @@ class OCDProcess(CustomProcess):
|
||||
|
||||
|
||||
class GDBProcess(CustomProcess):
|
||||
def __init__(self, logfile_path, elffile_path, extra_args='', verbose=True):
|
||||
cmd = 'xtensa-esp32-elf-gdb {} {}'.format(extra_args, elffile_path)
|
||||
def __init__(self, logfile_path, elffile_path, target, extra_args='', verbose=True):
|
||||
cmd = 'xtensa-{}-elf-gdb {} {}'.format(target, extra_args, elffile_path)
|
||||
super(GDBProcess, self).__init__(cmd, logfile_path, verbose)
|
||||
|
||||
def close(self):
|
||||
@@ -82,3 +82,18 @@ class GDBProcess(CustomProcess):
|
||||
if self.verbose:
|
||||
Utility.console_log('gdb needs to be killed', 'O')
|
||||
super(GDBProcess, self).close()
|
||||
|
||||
|
||||
class TelnetProcess(CustomProcess):
|
||||
def __init__(self, logfile_path, host='localhost', port=4444, verbose=True):
|
||||
cmd = 'telnet {} {}'.format(host, port)
|
||||
super(TelnetProcess, self).__init__(cmd, logfile_path, verbose)
|
||||
|
||||
def close(self):
|
||||
try:
|
||||
self.pexpect_proc.sendline('exit')
|
||||
self.pexpect_proc.expect_exact('Connection closed by foreign host.')
|
||||
except Exception:
|
||||
if self.verbose:
|
||||
Utility.console_log('telnet needs to be killed', 'O')
|
||||
super(TelnetProcess, self).close()
|
||||
|
||||
@@ -17,7 +17,7 @@ import re
|
||||
from tiny_test_fw import TinyFW, Utility
|
||||
from .IDFApp import IDFApp, Example, LoadableElfTestApp, UT, TestApp # noqa: export all Apps for users
|
||||
from .IDFDUT import IDFDUT, ESP32DUT, ESP32S2DUT, ESP8266DUT, ESP32QEMUDUT # noqa: export DUTs for users
|
||||
from .DebugUtils import OCDProcess, GDBProcess # noqa: export DebugUtils for users
|
||||
from .DebugUtils import OCDProcess, GDBProcess, TelnetProcess, CustomProcess # noqa: export DebugUtils for users
|
||||
|
||||
|
||||
def format_case_id(chip, case_name):
|
||||
|
||||
Reference in New Issue
Block a user