summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2016-09-20 11:33:19 +1000
committerDamien George <damien.p.george@gmail.com>2016-09-20 11:33:19 +1000
commitbb954d80a4bd467fc321df90cea2b248a90d1570 (patch)
tree1847cb981b585471c96db1c099d694a2502b97dc
parentfbddea929d28fa75ecc4e964500eca3f2ac32e4b (diff)
downloadmicropython-bb954d80a4bd467fc321df90cea2b248a90d1570.tar.gz
micropython-bb954d80a4bd467fc321df90cea2b248a90d1570.zip
tests: Get cmdline verbose tests running again.
The showbc function now no longer uses the system printf so works correctly.
-rw-r--r--tests/cmdline/cmd_showbc.py.exp32
-rw-r--r--tests/cmdline/cmd_verbose.py.exp8
-rwxr-xr-xtests/run-tests5
3 files changed, 19 insertions, 26 deletions
diff --git a/tests/cmdline/cmd_showbc.py.exp b/tests/cmdline/cmd_showbc.py.exp
index 10be688388..7d2eaeb85f 100644
--- a/tests/cmdline/cmd_showbc.py.exp
+++ b/tests/cmdline/cmd_showbc.py.exp
@@ -5,7 +5,7 @@ Raw bytecode (code_info_size=\\d\+, bytecode_size=\\d\+):
arg names:
(N_STATE 3)
(N_EXC_STACK 0)
- bc=-3 line=1
+ bc=-1 line=1
########
bc=\\d\+ line=134
00 MAKE_FUNCTION \.\+
@@ -34,7 +34,7 @@ arg names:
(INIT_CELL 14)
(INIT_CELL 15)
(INIT_CELL 16)
- bc=-6 line=1
+ bc=-4 line=1
########
bc=\\d\+ line=118
00 LOAD_CONST_NONE
@@ -86,8 +86,7 @@ arg names:
\\d\+ UNARY_OP 4
\\d\+ STORE_FAST 9
\\d\+ LOAD_FAST 0
-\\d\+ UNARY_OP 0
-\\d\+ NOT
+\\d\+ UNARY_OP 6
\\d\+ STORE_FAST 10
\\d\+ LOAD_FAST 0
\\d\+ LOAD_DEREF 14
@@ -108,8 +107,7 @@ arg names:
\\d\+ LOAD_DEREF 14
\\d\+ LOAD_FAST 1
\\d\+ BINARY_OP 27 __eq__
-\\d\+ UNARY_OP 0
-\\d\+ NOT
+\\d\+ UNARY_OP 6
\\d\+ STORE_FAST 10
\\d\+ LOAD_DEREF 14
\\d\+ LOAD_ATTR c (cache=0)
@@ -318,7 +316,7 @@ Raw bytecode (code_info_size=\\d\+, bytecode_size=\\d\+):
arg names:
(N_STATE 2)
(N_EXC_STACK 0)
- bc=-3 line=1
+ bc=-1 line=1
bc=0 line=129
bc=3 line=130
bc=6 line=131
@@ -342,14 +340,14 @@ Raw bytecode (code_info_size=\\d\+, bytecode_size=\\d\+):
arg names:
(N_STATE 1)
(N_EXC_STACK 0)
- bc=-3 line=1
- bc=10 line=135
+ bc=-1 line=1
+ bc=13 line=135
00 LOAD_NAME __name__ (cache=0)
-03 STORE_NAME __module__
-05 LOAD_CONST_STRING 'Class'
-08 STORE_NAME __qualname__
-10 LOAD_CONST_NONE
-11 RETURN_VALUE
+04 STORE_NAME __module__
+07 LOAD_CONST_STRING 'Class'
+10 STORE_NAME __qualname__
+13 LOAD_CONST_NONE
+14 RETURN_VALUE
File cmdline/cmd_showbc.py, code block '<genexpr>' (descriptor: \.\+, bytecode @\.\+ bytes)
Raw bytecode (code_info_size=\\d\+, bytecode_size=\\d\+):
########
@@ -384,7 +382,7 @@ arg names: * * *
07 LOAD_DEREF 1
09 POP_JUMP_IF_FALSE 3
12 LOAD_DEREF 0
-14 LIST_APPEND 2
+14 STORE_COMP 8
16 JUMP 3
19 RETURN_VALUE
File cmdline/cmd_showbc.py, code block '<dictcomp>' (descriptor: \.\+, bytecode @\.\+ bytes)
@@ -404,7 +402,7 @@ arg names: * * *
09 POP_JUMP_IF_FALSE 3
12 LOAD_DEREF 0
14 LOAD_DEREF 0
-16 MAP_ADD 2
+16 STORE_COMP 13
18 JUMP 3
21 RETURN_VALUE
File cmdline/cmd_showbc.py, code block 'closure' (descriptor: \.\+, bytecode @\.\+ bytes)
@@ -443,4 +441,4 @@ arg names: * b
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\+
+ No. of 1-blocks: \\d\+, 2-blocks: \\d\+, max blk sz: \\d\+, max free sz: \\d\+
diff --git a/tests/cmdline/cmd_verbose.py.exp b/tests/cmdline/cmd_verbose.py.exp
index 3e115f9ae6..f56226129e 100644
--- a/tests/cmdline/cmd_verbose.py.exp
+++ b/tests/cmdline/cmd_verbose.py.exp
@@ -1,13 +1,12 @@
-1
File cmdline/cmd_verbose.py, code block '<module>' (descriptor: \.\+, bytecode \.\+ bytes)
Raw bytecode (code_info_size=\\d\+, bytecode_size=\\d\+):
- 08 \.\+
+ 02 \.\+
########
\.\+5b
arg names:
(N_STATE 2)
(N_EXC_STACK 0)
- bc=-3 line=1
+ bc=-1 line=1
bc=0 line=3
00 LOAD_NAME print (cache=0)
04 LOAD_CONST_SMALL_INT 1
@@ -15,7 +14,8 @@ arg names:
07 POP_TOP
08 LOAD_CONST_NONE
09 RETURN_VALUE
+1
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\+
+ No. of 1-blocks: \\d\+, 2-blocks: \\d\+, max blk sz: \\d\+, max free sz: \\d\+
diff --git a/tests/run-tests b/tests/run-tests
index 059e4e910f..e69e537230 100755
--- a/tests/run-tests
+++ b/tests/run-tests
@@ -187,11 +187,6 @@ def run_tests(pyb, tests, args):
if not 'True' in str(t, 'ascii'):
skip_tests.add('cmdline/repl_emacs_keys.py')
- # These tests are now broken because showbc uses buffered printf
- if True:
- skip_tests.add('cmdline/cmd_verbose.py')
- skip_tests.add('cmdline/cmd_showbc.py')
-
upy_byteorder = run_micropython(pyb, args, 'feature_check/byteorder.py')
has_complex = run_micropython(pyb, args, 'feature_check/complex.py') == b'complex\n'
cpy_byteorder = subprocess.check_output([CPYTHON3, 'feature_check/byteorder.py'])