Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
uPython-mirror
Commits
cdec7ba3
Commit
cdec7ba3
authored
Dec 22, 2016
by
Damien George
Browse files
tests: Add a coverage test for printing the parse-tree.
parent
ebb84131
Changes
5
Hide whitespace changes
Inline
Side-by-side
tests/cmdline/cmd_parsetree.py
0 → 100644
View file @
cdec7ba3
# cmdline: -v -v -v
# test printing of the parse-tree
for
i
in
():
pass
a
=
None
b
=
'str'
c
=
'a very long str that will not be interned'
d
=
b
'bytes'
e
=
b
'a very long bytes that will not be interned'
f
=
123456789012345678901234567890
tests/cmdline/cmd_parsetree.py.exp
0 → 100644
View file @
cdec7ba3
----------------
[ 4] rule(2) (n=8)
tok(5)
[ 4] rule(78) (n=4)
id(i)
[ 4] rule(131) (n=1)
NULL
[ 5] rule(42) (n=0)
NULL
[ 6] rule(32) (n=2)
id(a)
tok(15)
[ 7] rule(32) (n=2)
id(b)
str(str)
[ 8] rule(32) (n=2)
id(c)
[ 8] literal str(a very long str that will not be interned)
[ 9] rule(32) (n=2)
id(d)
bytes(bytes)
[ 10] rule(32) (n=2)
id(e)
[ 10] literal bytes(a very long bytes that will not be interned)
[ 11] rule(32) (n=2)
id(f)
[ 11] literal \.\+
----------------
File cmdline/cmd_parsetree.py, code block '<module>' (descriptor: \.\+, bytecode @\.\+ bytes)
Raw bytecode (code_info_size=\\d\+, bytecode_size=\\d\+):
########
\.\+5b
arg names:
(N_STATE 2)
(N_EXC_STACK 0)
bc=-1 line=1
bc=0 line=4
bc=9 line=5
bc=12 line=6
bc=16 line=7
bc=22 line=8
bc=27 line=9
bc=32 line=10
bc=37 line=11
00 BUILD_TUPLE 0
02 GET_ITER
03 FOR_ITER 12
06 STORE_NAME i
09 JUMP 3
12 LOAD_CONST_NONE
13 STORE_NAME a
16 LOAD_CONST_STRING 'str'
19 STORE_NAME b
22 LOAD_CONST_OBJ \.\+
24 STORE_NAME c
27 LOAD_CONST_OBJ \.\+
29 STORE_NAME d
32 LOAD_CONST_OBJ \.\+
34 STORE_NAME e
37 LOAD_CONST_OBJ \.\+
39 STORE_NAME f
42 LOAD_CONST_NONE
43 RETURN_VALUE
mem: total=\\d\+, current=\\d\+, peak=\\d\+
stack: \\d\+ out of \\d\+
GC: total: \\d\+, used: \\d\+, free: \\d\+
No. of 1-blocks: \\d\+, 2-blocks: \\d\+, max blk sz: \\d\+, max free sz: \\d\+
tests/feature_check/coverage.py
0 → 100644
View file @
cdec7ba3
try
:
extra_coverage
print
(
'coverage'
)
except
NameError
:
print
(
'no'
)
tests/feature_check/coverage.py.exp
0 → 100644
View file @
cdec7ba3
tests/run-tests
View file @
cdec7ba3
...
...
@@ -208,6 +208,7 @@ def run_tests(pyb, tests, args):
upy_byteorder
=
run_micropython
(
pyb
,
args
,
'feature_check/byteorder.py'
)
has_complex
=
run_micropython
(
pyb
,
args
,
'feature_check/complex.py'
)
==
b
'complex
\n
'
has_coverage
=
run_micropython
(
pyb
,
args
,
'feature_check/coverage.py'
)
==
b
'coverage
\n
'
cpy_byteorder
=
subprocess
.
check_output
([
CPYTHON3
,
'feature_check/byteorder.py'
])
skip_endian
=
(
upy_byteorder
!=
cpy_byteorder
)
...
...
@@ -225,6 +226,9 @@ def run_tests(pyb, tests, args):
skip_tests
.
add
(
'float/true_value.py'
)
skip_tests
.
add
(
'float/types.py'
)
if
not
has_coverage
:
skip_tests
.
add
(
'cmdline/cmd_parsetree.py'
)
# Some tests shouldn't be run on a PC
if
pyb
is
None
:
# unix build does not have the GIL so can't run thread mutation tests
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment