tests/run-tests: Improve crash reporting when running on remote targets.
It is very useful to know the actual error when debugging why a test fails.
This commit is contained in:
parent
1b88433f2d
commit
055ee18919
@ -143,9 +143,12 @@ def run_micropython(pyb, args, test_file, is_special=False):
|
|||||||
pyb.enter_raw_repl()
|
pyb.enter_raw_repl()
|
||||||
try:
|
try:
|
||||||
output_mupy = pyb.execfile(test_file)
|
output_mupy = pyb.execfile(test_file)
|
||||||
except pyboard.PyboardError:
|
except pyboard.PyboardError as e:
|
||||||
had_crash = True
|
had_crash = True
|
||||||
output_mupy = b'CRASH'
|
if not is_special and e.args[0] == 'exception':
|
||||||
|
output_mupy = e.args[1] + e.args[2] + b'CRASH'
|
||||||
|
else:
|
||||||
|
output_mupy = b'CRASH'
|
||||||
|
|
||||||
# canonical form for all ports/platforms is to use \n for end-of-line
|
# canonical form for all ports/platforms is to use \n for end-of-line
|
||||||
output_mupy = output_mupy.replace(b'\r\n', b'\n')
|
output_mupy = output_mupy.replace(b'\r\n', b'\n')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user