diff options
author | Damien George <damien.p.george@gmail.com> | 2014-04-13 13:48:33 +0100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2014-04-13 13:48:33 +0100 |
commit | b636d024d2fe950d8dd643c74aa006d1ea88078d (patch) | |
tree | 13116dcb50c67bcd34c18d3783ac1cfc0caa9d55 /tests | |
parent | d240ff83c74f22385254df7a518fe5dd70f2f612 (diff) | |
download | micropython-b636d024d2fe950d8dd643c74aa006d1ea88078d.tar.gz micropython-b636d024d2fe950d8dd643c74aa006d1ea88078d.zip |
Make pyboard.py have its own exception; update run-tests for pyboard.
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/run-tests | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/tests/run-tests b/tests/run-tests index 2866a6c487..33409832ba 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()) |