summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rwxr-xr-xtests/run-perfbench.py5
-rwxr-xr-xtests/run-tests.py23
2 files changed, 20 insertions, 8 deletions
diff --git a/tests/run-perfbench.py b/tests/run-perfbench.py
index 22ad6308f..a2e9e8079 100755
--- a/tests/run-perfbench.py
+++ b/tests/run-perfbench.py
@@ -120,7 +120,10 @@ def run_benchmarks(args, target, param_n, param_m, n_average, test_list):
# Process script through mpy-cross if needed
if isinstance(target, pyboard.Pyboard) or args.via_mpy:
- test_script_target = prepare_script_for_target(args, script_text=test_script)
+ crash, test_script_target = prepare_script_for_target(args, script_text=test_script)
+ if crash:
+ print("CRASH:", test_script_target)
+ continue
else:
test_script_target = test_script
diff --git a/tests/run-tests.py b/tests/run-tests.py
index 35e28aac9..1fc857601 100755
--- a/tests/run-tests.py
+++ b/tests/run-tests.py
@@ -122,11 +122,15 @@ def prepare_script_for_target(args, *, script_filename=None, script_text=None, f
else:
cleanup_script_filename = False
- subprocess.check_output(
- [MPYCROSS]
- + args.mpy_cross_flags.split()
- + ["-o", mpy_filename, "-X", "emit=" + args.emit, script_filename]
- )
+ try:
+ subprocess.check_output(
+ [MPYCROSS]
+ + args.mpy_cross_flags.split()
+ + ["-o", mpy_filename, "-X", "emit=" + args.emit, script_filename],
+ stderr=subprocess.STDOUT,
+ )
+ except subprocess.CalledProcessError as er:
+ return True, b"mpy-cross crash\n" + er.output
with open(mpy_filename, "rb") as f:
script_text = b"__buf=" + bytes(repr(f.read()), "ascii") + b"\n"
@@ -140,11 +144,16 @@ def prepare_script_for_target(args, *, script_filename=None, script_text=None, f
print("error: using emit={} must go via .mpy".format(args.emit))
sys.exit(1)
- return script_text
+ return False, script_text
def run_script_on_remote_target(pyb, args, test_file, is_special):
- script = prepare_script_for_target(args, script_filename=test_file, force_plain=is_special)
+ had_crash, script = prepare_script_for_target(
+ args, script_filename=test_file, force_plain=is_special
+ )
+ if had_crash:
+ return True, script
+
try:
had_crash = False
pyb.enter_raw_repl()