mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-02-21 23:33:57 -04:00
autotest: cope with WriteStreaming() in doc tests
This commit is contained in:
parent
8196f422cb
commit
e6f15ed6c0
@ -1946,7 +1946,7 @@ class AutoTest(ABC):
|
||||
for message_info in message_infos:
|
||||
for define in defines:
|
||||
message_info = re.sub(define, defines[define], message_info)
|
||||
m = re.match(r'\s*LOG_\w+\s*,\s*sizeof\([^)]+\)\s*,\s*"(\w+)"\s*,\s*"(\w+)"\s*,\s*"([\w,]+)"\s*,\s*"([^"]+)"\s*,\s*"([^"]+)"\s*$', message_info) # noqa
|
||||
m = re.match(r'\s*LOG_\w+\s*,\s*sizeof\([^)]+\)\s*,\s*"(\w+)"\s*,\s*"(\w+)"\s*,\s*"([\w,]+)"\s*,\s*"([^"]+)"\s*,\s*"([^"]+)"\s*(,\s*true)?\s*$', message_info) # noqa
|
||||
if m is None:
|
||||
continue
|
||||
(name, fmt, labels, units, multipliers) = (m.group(1), m.group(2), m.group(3), m.group(4), m.group(5))
|
||||
@ -1983,8 +1983,8 @@ class AutoTest(ABC):
|
||||
if type(line) == bytes:
|
||||
line = line.decode("utf-8")
|
||||
if state == state_outside:
|
||||
if (re.match(r"\s*AP::logger\(\)[.]Write\(", line) or
|
||||
re.match(r"\s*logger[.]Write\(", line)):
|
||||
if (re.match(r"\s*AP::logger\(\)[.]Write(?:Streaming)?\(", line) or
|
||||
re.match(r"\s*logger[.]Write(?:Streaming)?\(", line)):
|
||||
state = state_inside
|
||||
line = re.sub("//.*", "", line) # trim comments
|
||||
log_write_statement = line
|
||||
@ -2008,10 +2008,10 @@ class AutoTest(ABC):
|
||||
log_write_statement = re.sub(define, defines[define], log_write_statement)
|
||||
# fair warning: order is important here because of the
|
||||
# NKT/XKT special case below....
|
||||
my_re = r' logger[.]Write\(\s*"(\w+)"\s*,\s*"([\w,]+)".*\);'
|
||||
my_re = r' logger[.]Write(?:Streaming)?\(\s*"(\w+)"\s*,\s*"([\w,]+)".*\);'
|
||||
m = re.match(my_re, log_write_statement)
|
||||
if m is None:
|
||||
my_re = r' AP::logger\(\)[.]Write\(\s*"(\w+)"\s*,\s*"([\w,]+)".*\);'
|
||||
my_re = r' AP::logger\(\)[.]Write(?:Streaming)?\(\s*"(\w+)"\s*,\s*"([\w,]+)".*\);'
|
||||
m = re.match(my_re, log_write_statement)
|
||||
if m is None:
|
||||
raise NotAchievedException("Did not match (%s) with (%s)" % (log_write_statement, str(my_re)))
|
||||
|
Loading…
Reference in New Issue
Block a user