Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
micropython
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
card10
micropython
Commits
3b064370
Commit
3b064370
authored
10 years ago
by
blmorris
Committed by
Damien George
10 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Enable device keyword option when running pyboard.py --tests and run-tests --pyboard
parent
762d5751
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
tests/run-tests
+2
-1
2 additions, 1 deletion
tests/run-tests
tools/pyboard.py
+3
-3
3 additions, 3 deletions
tools/pyboard.py
with
5 additions
and
4 deletions
tests/run-tests
+
2
−
1
View file @
3b064370
...
@@ -139,6 +139,7 @@ def run_tests(pyb, tests, args):
...
@@ -139,6 +139,7 @@ def run_tests(pyb, tests, args):
def
main
():
def
main
():
cmd_parser
=
argparse
.
ArgumentParser
(
description
=
'
Run tests for Micro Python.
'
)
cmd_parser
=
argparse
.
ArgumentParser
(
description
=
'
Run tests for Micro Python.
'
)
cmd_parser
.
add_argument
(
'
--pyboard
'
,
action
=
'
store_true
'
,
help
=
'
run the tests on the pyboard
'
)
cmd_parser
.
add_argument
(
'
--pyboard
'
,
action
=
'
store_true
'
,
help
=
'
run the tests on the pyboard
'
)
cmd_parser
.
add_argument
(
'
--device
'
,
default
=
'
/dev/ttyACM0
'
,
help
=
'
the serial device of the pyboard
'
)
cmd_parser
.
add_argument
(
'
-d
'
,
'
--test-dirs
'
,
nargs
=
'
*
'
,
help
=
'
input test directories (if no files given)
'
)
cmd_parser
.
add_argument
(
'
-d
'
,
'
--test-dirs
'
,
nargs
=
'
*
'
,
help
=
'
input test directories (if no files given)
'
)
cmd_parser
.
add_argument
(
'
--write-exp
'
,
action
=
'
store_true
'
,
help
=
'
save .exp files to run tests w/o CPython
'
)
cmd_parser
.
add_argument
(
'
--write-exp
'
,
action
=
'
store_true
'
,
help
=
'
save .exp files to run tests w/o CPython
'
)
cmd_parser
.
add_argument
(
'
--emit
'
,
default
=
'
bytecode
'
,
help
=
'
Micro Python emitter to use (bytecode or native)
'
)
cmd_parser
.
add_argument
(
'
--emit
'
,
default
=
'
bytecode
'
,
help
=
'
Micro Python emitter to use (bytecode or native)
'
)
...
@@ -147,7 +148,7 @@ def main():
...
@@ -147,7 +148,7 @@ def main():
if
args
.
pyboard
:
if
args
.
pyboard
:
import
pyboard
import
pyboard
pyb
=
pyboard
.
Pyboard
(
'
/dev/ttyACM0
'
)
pyb
=
pyboard
.
Pyboard
(
args
.
device
)
pyb
.
enter_raw_repl
()
pyb
.
enter_raw_repl
()
else
:
else
:
pyb
=
None
pyb
=
None
...
...
This diff is collapsed.
Click to expand it.
tools/pyboard.py
+
3
−
3
View file @
3b064370
...
@@ -105,12 +105,12 @@ def execfile(filename, device='/dev/ttyACM0'):
...
@@ -105,12 +105,12 @@ def execfile(filename, device='/dev/ttyACM0'):
pyb
.
exit_raw_repl
()
pyb
.
exit_raw_repl
()
pyb
.
close
()
pyb
.
close
()
def
run_test
():
def
run_test
(
device
):
device
=
'
/dev/ttyACM0
'
pyb
=
Pyboard
(
device
)
pyb
=
Pyboard
(
device
)
pyb
.
enter_raw_repl
()
pyb
.
enter_raw_repl
()
print
(
'
opened device {}
'
.
format
(
device
))
print
(
'
opened device {}
'
.
format
(
device
))
pyb
.
exec
(
'
import pyb
'
)
# module pyb no longer imported by default, required for pyboard tests
print
(
'
seconds since boot:
'
,
pyb
.
get_time
())
print
(
'
seconds since boot:
'
,
pyb
.
get_time
())
pyb
.
exec
(
'
def apply(l, f):
\r\n
for item in l:
\r\n
f(item)
\r\n
'
)
pyb
.
exec
(
'
def apply(l, f):
\r\n
for item in l:
\r\n
f(item)
\r\n
'
)
...
@@ -170,7 +170,7 @@ def main():
...
@@ -170,7 +170,7 @@ def main():
args
=
cmd_parser
.
parse_args
()
args
=
cmd_parser
.
parse_args
()
if
args
.
test
:
if
args
.
test
:
run_test
()
run_test
(
device
=
args
.
device
)
for
file
in
args
.
files
:
for
file
in
args
.
files
:
execfile
(
file
,
device
=
args
.
device
)
execfile
(
file
,
device
=
args
.
device
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment