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
e7412ab3
Commit
e7412ab3
authored
May 31, 2014
by
Damien George
Browse files
Merge pull request #632 from stinos/tests-dir-argument
tests: Add argument to allow specifying which directories to test
parents
5b5562c1
8ac3b578
Changes
1
Hide whitespace changes
Inline
Side-by-side
tests/run-tests
View file @
e7412ab3
...
...
@@ -111,6 +111,7 @@ def run_tests(pyb, tests):
def
main
():
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
(
'-d'
,
'--test_dirs'
,
nargs
=
'*'
,
help
=
'input test directories (if no files given)'
)
cmd_parser
.
add_argument
(
'files'
,
nargs
=
'*'
,
help
=
'input test files'
)
args
=
cmd_parser
.
parse_args
()
...
...
@@ -122,12 +123,16 @@ def main():
pyb
=
None
if
len
(
args
.
files
)
==
0
:
if
pyb
is
None
:
# run PC tests
test_dirs
=
(
'basics'
,
'micropython'
,
'float'
,
'import'
,
'io'
,
'misc'
)
if
args
.
test_dirs
is
None
:
if
pyb
is
None
:
# run PC tests
test_dirs
=
(
'basics'
,
'micropython'
,
'float'
,
'import'
,
'io'
,
'misc'
)
else
:
# run pyboard tests
test_dirs
=
(
'basics'
,
'float'
,
'pyb'
,
'pybnative'
,
'inlineasm'
)
else
:
# run
pyboard
tes
t
s
test_dirs
=
(
'basics'
,
'float'
,
'pyb'
,
'pybnative'
,
'inlineasm'
)
# run
tests from
t
h
es
e directorie
s
test_dirs
=
args
.
test_dirs
tests
=
sorted
(
test_file
for
test_files
in
(
glob
(
'{}/*.py'
.
format
(
dir
))
for
dir
in
test_dirs
)
for
test_file
in
test_files
)
else
:
# tests explicitly given
...
...
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