Skip to content

Commit 2e21641

Browse files
committed
Adopt ESP32 test driver to pw_unit_test output
1 parent b274320 commit 2e21641

File tree

1 file changed

+15
-14
lines changed

1 file changed

+15
-14
lines changed

src/test_driver/esp32/run_qemu_image.py

+15-14
Original file line numberDiff line numberDiff line change
@@ -106,31 +106,32 @@ def main(log_level, no_log_timestamps, image, file_image_list, qemu, verbose):
106106

107107
# Parse output of the unit test. Generally expect things like:
108108
# I (3034) CHIP-tests: Starting CHIP tests!
109+
# INF [==========] Running all tests.
110+
# INF [ RUN ] TestASN1.NullWriter
111+
# INF [ OK ] TestASN1.NullWriter
109112
# ...
110-
# Various test lines, none ending with "] : FAILED"
111-
# ...
112-
# Failed Tests: 0 / 5
113-
# Failed Asserts: 0 / 77
114-
# I (3034) CHIP-tests: CHIP test status: 0
113+
# INF [ RUN ] TestASN1.ASN1UniversalTime
114+
# ERR src/lib/asn1/tests/TestASN1.cpp:366: Failure
115+
# ERR Expected: 1 == 5
116+
# ERR Actual: 1 == 5
117+
# ERR [ FAILED ] TestASN1.ASN1UniversalTime
118+
# INF [==========] Done running all tests.
119+
# INF [ PASSED ] 5 test(s).
120+
# ERR [ FAILED ] 1 test(s).
121+
# I (3034) CHIP-tests: CHIP test status: 1
115122
in_test = False
116123
for line in output.split('\n'):
117-
if line.endswith('CHIP-tests: Starting CHIP tests!'):
124+
if 'CHIP-tests: Starting CHIP tests!' in line:
118125
in_test = True
119126

120-
if line.startswith('Failed Tests:') and not line.startswith('Failed Tests: 0 /'):
121-
raise Exception("Tests seem failed: %s" % line)
122-
123-
if line.startswith('Failed Asserts:') and not line.startswith('Failed Asserts: 0 /'):
124-
raise Exception("Asserts seem failed: %s" % line)
125-
126127
if 'CHIP-tests: CHIP test status: 0' in line:
127128
in_test = False
128129
elif 'CHIP-tests: CHIP test status: ' in line:
129130
raise Exception("CHIP test status is NOT 0: %s" % line)
130131

131132
# Ignore FAILED messages not in the middle of a test, to reduce
132-
# the chance of false posisitves from other logging.
133-
if in_test and re.match('.*] : FAILED$', line):
133+
# the chance of false positives from other logging.
134+
if in_test and re.search(r' \[ FAILED \] ', line):
134135
raise Exception("Step failed: %s" % line)
135136

136137
# TODO: Figure out why exit(0) in man_app.cpp's tester_task is aborting and fix that.

0 commit comments

Comments
 (0)