tests: Add feature check for uio module and skip corresponding tests.

This commit is contained in:
Damien George 2019-10-29 22:13:38 +11:00
parent eebffb2b5b
commit 1d51115246
3 changed files with 13 additions and 0 deletions

View File

@ -0,0 +1,5 @@
try:
import uio
print("uio")
except ImportError:
print("no")

View File

View File

@ -227,6 +227,7 @@ def run_tests(pyb, tests, args, base_path="."):
skip_async = False
skip_const = False
skip_revops = False
skip_io_module = False
skip_endian = False
has_complex = True
has_coverage = False
@ -276,6 +277,11 @@ def run_tests(pyb, tests, args, base_path="."):
if output == b'TypeError\n':
skip_revops = True
# Check if uio module exists, and skip such tests if it doesn't
output = run_feature_check(pyb, args, base_path, 'uio_module.py')
if output != b'uio\n':
skip_io_module = True
# Check if emacs repl is supported, and skip such tests if it's not
t = run_feature_check(pyb, args, base_path, 'repl_emacs_check.py')
if not 'True' in str(t, 'ascii'):
@ -430,6 +436,7 @@ def run_tests(pyb, tests, args, base_path="."):
is_slice = test_name.find("slice") != -1 or test_name in misc_slice_tests
is_async = test_name.startswith("async_")
is_const = test_name.startswith("const")
is_io_module = test_name.startswith("io_")
skip_it = test_file in skip_tests
skip_it |= skip_native and is_native
@ -441,6 +448,7 @@ def run_tests(pyb, tests, args, base_path="."):
skip_it |= skip_async and is_async
skip_it |= skip_const and is_const
skip_it |= skip_revops and test_name.startswith("class_reverse_op")
skip_it |= skip_io_module and is_io_module
if args.list_tests:
if not skip_it: