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
43d4a6fa
Commit
43d4a6fa
authored
May 10, 2014
by
Paul Sokolovsky
Browse files
run-tests: Add support for skipping tests.
MicrpPython test should print single "SKIP" line for test to be skipped.
parent
0f14fdea
Changes
1
Hide whitespace changes
Inline
Side-by-side
tests/run-tests
View file @
43d4a6fa
...
...
@@ -25,6 +25,7 @@ def run_tests(pyb, tests):
testcase_count
=
0
passed_count
=
0
failed_tests
=
[]
skipped_tests
=
[]
running_under_travis
=
os
.
getenv
(
'TRAVIS'
)
==
'true'
...
...
@@ -34,6 +35,7 @@ def run_tests(pyb, tests):
for
test_file
in
tests
:
if
running_under_travis
and
test_file
in
skip_travis_tests
:
print
(
"skip "
,
test_file
)
skipped_tests
.
append
(
test_name
)
continue
# get expected output
...
...
@@ -64,10 +66,16 @@ def run_tests(pyb, tests):
except
pyboard
.
PyboardError
:
output_mupy
=
b
'CRASH'
testcase_count
+=
len
(
output_expected
.
splitlines
())
test_basename
=
os
.
path
.
basename
(
test_file
)
test_name
=
os
.
path
.
splitext
(
test_basename
)[
0
]
if
output_mupy
==
b
'SKIP
\n
'
:
print
(
"skip "
,
test_file
)
skipped_tests
.
append
(
test_name
)
continue
testcase_count
+=
len
(
output_expected
.
splitlines
())
filename_expected
=
test_basename
+
".exp"
filename_mupy
=
test_basename
+
".out"
...
...
@@ -89,6 +97,8 @@ def run_tests(pyb, tests):
print
(
"{} tests performed ({} individual testcases)"
.
format
(
test_count
,
testcase_count
))
print
(
"{} tests passed"
.
format
(
passed_count
))
if
len
(
skipped_tests
)
>
0
:
print
(
"{} tests skipped: {}"
.
format
(
len
(
skipped_tests
),
' '
.
join
(
skipped_tests
)))
if
len
(
failed_tests
)
>
0
:
print
(
"{} tests failed: {}"
.
format
(
len
(
failed_tests
),
' '
.
join
(
failed_tests
)))
return
False
...
...
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