tests: Split out test for optimisation level and line-no printing.
This commit is contained in:
parent
af20c2ead3
commit
b3152b2de7
@ -12,8 +12,3 @@ exec('print(__debug__)')
|
|||||||
micropython.opt_level(1)
|
micropython.opt_level(1)
|
||||||
exec('print(__debug__)')
|
exec('print(__debug__)')
|
||||||
exec('assert 0')
|
exec('assert 0')
|
||||||
|
|
||||||
# check that level 3 doesn't store line numbers
|
|
||||||
# the expected output is that any line is printed as "line 1"
|
|
||||||
micropython.opt_level(3)
|
|
||||||
exec('try:\n xyz\nexcept NameError as er:\n import sys\n sys.print_exception(er)')
|
|
||||||
|
@ -2,6 +2,3 @@
|
|||||||
1
|
1
|
||||||
True
|
True
|
||||||
False
|
False
|
||||||
Traceback (most recent call last):
|
|
||||||
File "<string>", line 1, in <module>
|
|
||||||
NameError: name 'xyz' isn't defined
|
|
||||||
|
6
tests/micropython/opt_level_lineno.py
Normal file
6
tests/micropython/opt_level_lineno.py
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
import micropython as micropython
|
||||||
|
|
||||||
|
# check that level 3 doesn't store line numbers
|
||||||
|
# the expected output is that any line is printed as "line 1"
|
||||||
|
micropython.opt_level(3)
|
||||||
|
exec('try:\n xyz\nexcept NameError as er:\n import sys\n sys.print_exception(er)')
|
3
tests/micropython/opt_level_lineno.py.exp
Normal file
3
tests/micropython/opt_level_lineno.py.exp
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
Traceback (most recent call last):
|
||||||
|
File "<string>", line 1, in <module>
|
||||||
|
NameError: name 'xyz' isn't defined
|
@ -377,6 +377,7 @@ def run_tests(pyb, tests, args, base_path="."):
|
|||||||
skip_tests.add('misc/sys_exc_info.py') # sys.exc_info() is not supported for native
|
skip_tests.add('misc/sys_exc_info.py') # sys.exc_info() is not supported for native
|
||||||
skip_tests.add('micropython/emg_exc.py') # because native doesn't have proper traceback info
|
skip_tests.add('micropython/emg_exc.py') # because native doesn't have proper traceback info
|
||||||
skip_tests.add('micropython/heapalloc_traceback.py') # because native doesn't have proper traceback info
|
skip_tests.add('micropython/heapalloc_traceback.py') # because native doesn't have proper traceback info
|
||||||
|
skip_tests.add('micropython/opt_level_lineno.py') # native doesn't have proper traceback info
|
||||||
skip_tests.add('micropython/schedule.py') # native code doesn't check pending events
|
skip_tests.add('micropython/schedule.py') # native code doesn't check pending events
|
||||||
|
|
||||||
for test_file in tests:
|
for test_file in tests:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user