From b636d024d2fe950d8dd643c74aa006d1ea88078d Mon Sep 17 00:00:00 2001 From: Damien George Date: Sun, 13 Apr 2014 13:48:33 +0100 Subject: Make pyboard.py have its own exception; update run-tests for pyboard. --- tests/run-tests | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'tests') diff --git a/tests/run-tests b/tests/run-tests index 2866a6c48..33409832b 100755 --- a/tests/run-tests +++ b/tests/run-tests @@ -46,14 +46,21 @@ for test_file in tests: output_expected = b'CPYTHON3 CRASH' # run Micro Python - try: - if test_on_pyboard: - pyb.enter_raw_repl() - output_mupy = pyb.execfile(test_file).replace(b'\r\n', b'\n') - else: + if test_on_pyboard: + pyb.enter_raw_repl() + try: + if test_file == 'basics/math-fun.py': + # this test crashes the pyboard + output_mupy = b'CRASH' + else: + output_mupy = pyb.execfile(test_file).replace(b'\r\n', b'\n') + except pyboard.PyboardError: + output_mupy = b'CRASH\n' + output_mupy + else: + try: output_mupy = subprocess.check_output([MP_PY, '-X', 'emit=bytecode', test_file]) - except subprocess.CalledProcessError: - output_mupy = b'CRASH' + except subprocess.CalledProcessError: + output_mupy = b'CRASH' testcase_count += len(output_expected.splitlines()) -- cgit v1.2.3