Skip to content

Commit fee676f

Browse files
committed
tests: subsys: swo: show more logs from jlink tool
Make failure analyze easier. Signed-off-by: Piotr Kosycarz <[email protected]>
1 parent 32b1c25 commit fee676f

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

tests/subsys/swo/pytest/test_swo.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,11 +119,11 @@ def test_swo_logging(dut: DeviceAdapter):
119119
try:
120120
logger.info(f"Executing:\n{cmd}")
121121
proc = subprocess.Popen(
122-
cmd,
122+
cmd.split(),
123+
stdin=subprocess.PIPE,
123124
stdout=subprocess.PIPE,
124125
stderr=subprocess.STDOUT,
125-
encoding="UTF-8",
126-
shell=True,
126+
encoding='UTF-8',
127127
)
128128
except OSError as exc:
129129
logger.error(f"Unable to start JLinkSWOViewerCLExe:\n{cmd=}\n{exc=}")
@@ -134,6 +134,8 @@ def test_swo_logging(dut: DeviceAdapter):
134134
pass
135135
finally:
136136
_kill(proc)
137+
outs, errs = proc.communicate()
138+
logger.info(f"{outs=}\n{errs=}")
137139

138140
# read logs
139141
with open(f"{log_filename}", errors="ignore") as log_file:

0 commit comments

Comments
 (0)