From 1d511152467ad2d21f874c9bbe05f8f117424d3e Mon Sep 17 00:00:00 2001 From: Damien George Date: Tue, 29 Oct 2019 22:13:38 +1100 Subject: [PATCH] tests: Add feature check for uio module and skip corresponding tests. --- tests/feature_check/uio_module.py | 5 +++++ tests/feature_check/uio_module.py.exp | 0 tests/run-tests | 8 ++++++++ 3 files changed, 13 insertions(+) create mode 100644 tests/feature_check/uio_module.py create mode 100644 tests/feature_check/uio_module.py.exp diff --git a/tests/feature_check/uio_module.py b/tests/feature_check/uio_module.py new file mode 100644 index 0000000000..1031cba909 --- /dev/null +++ b/tests/feature_check/uio_module.py @@ -0,0 +1,5 @@ +try: + import uio + print("uio") +except ImportError: + print("no") diff --git a/tests/feature_check/uio_module.py.exp b/tests/feature_check/uio_module.py.exp new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/run-tests b/tests/run-tests index 5a2086c5a8..77667c2711 100755 --- a/tests/run-tests +++ b/tests/run-tests @@ -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: