summaryrefslogtreecommitdiff
path: root/tests/cmdline
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2015-03-13 10:58:34 +0000
committerDamien George <damien.p.george@gmail.com>2015-03-13 10:58:34 +0000
commit143c34109c870544c0aabe95f376fa500dd6cd3f (patch)
tree04bbf57e3a97927b6c64e570f131441c438896a0 /tests/cmdline
parentaf43565322f5c45a1a92df1afceff24c93021998 (diff)
tests: Add ability to test uPy cmdline executable.
This allows to test options passed to cmdline executable, as well as the behaviour of the REPL.
Diffstat (limited to 'tests/cmdline')
-rw-r--r--tests/cmdline/cmd_verbose.py3
-rw-r--r--tests/cmdline/cmd_verbose.py.exp21
-rw-r--r--tests/cmdline/repl_basic.py3
-rw-r--r--tests/cmdline/repl_basic.py.exp7
4 files changed, 34 insertions, 0 deletions
diff --git a/tests/cmdline/cmd_verbose.py b/tests/cmdline/cmd_verbose.py
new file mode 100644
index 000000000..b599a7aec
--- /dev/null
+++ b/tests/cmdline/cmd_verbose.py
@@ -0,0 +1,3 @@
+# cmdline: -v -v
+# test verbose output
+print(1)
diff --git a/tests/cmdline/cmd_verbose.py.exp b/tests/cmdline/cmd_verbose.py.exp
new file mode 100644
index 000000000..d7a861180
--- /dev/null
+++ b/tests/cmdline/cmd_verbose.py.exp
@@ -0,0 +1,21 @@
+1
+File cmdline/cmd_verbose.py, code block '<module>' (descriptor: ######
+Raw bytecode (code_info_size=8, bytecode_size=13):
+ 08 82 23 83 45 43 00 00 02 00 00 1c 81 13 00 81
+ 64 01 32 11 5b
+arg names:
+(N_STATE 2)
+(N_EXC_STACK 0)
+(NUM_LOCAL 0)
+ bc=-3 line=1
+ bc=0 line=3
+00 LOAD_NAME print (cache=0)
+04 LOAD_CONST_SMALL_INT 1
+05 CALL_FUNCTION n=1 nkw=0
+07 POP_TOP
+08 LOAD_CONST_NONE
+09 RETURN_VALUE
+mem: total=######
+stack: ######
+GC: total: ######
+ No. of 1-blocks: ######
diff --git a/tests/cmdline/repl_basic.py b/tests/cmdline/repl_basic.py
new file mode 100644
index 000000000..67d18cd57
--- /dev/null
+++ b/tests/cmdline/repl_basic.py
@@ -0,0 +1,3 @@
+# basic REPL tests
+print(1)
+OA
diff --git a/tests/cmdline/repl_basic.py.exp b/tests/cmdline/repl_basic.py.exp
new file mode 100644
index 000000000..27732376a
--- /dev/null
+++ b/tests/cmdline/repl_basic.py.exp
@@ -0,0 +1,7 @@
+Micro Python ######
+>>> # basic REPL tests
+>>> print(1)
+1
+>>> print(1)
+1
+>>>