summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2019-10-18 19:48:15 +1100
committerDamien George <damien.p.george@gmail.com>2019-10-29 22:22:37 +1100
commit6e9ba1cf4b0cd8e2986e9abe9a8a66c43a43c63a (patch)
tree50eb636adadc21b3d0402a4534458457bf814598
parent7a49fc387c2ecbc374967f1ebc221770c2ca4b7a (diff)
downloadmicropython-6e9ba1cf4b0cd8e2986e9abe9a8a66c43a43c63a.tar.gz
micropython-6e9ba1cf4b0cd8e2986e9abe9a8a66c43a43c63a.zip
tests: Add feature check for bytearray and skip corresponding tests.
-rw-r--r--tests/feature_check/bytearray.py5
-rw-r--r--tests/feature_check/bytearray.py.exp0
-rwxr-xr-xtests/run-tests8
3 files changed, 13 insertions, 0 deletions
diff --git a/tests/feature_check/bytearray.py b/tests/feature_check/bytearray.py
new file mode 100644
index 0000000000..601ef4597c
--- /dev/null
+++ b/tests/feature_check/bytearray.py
@@ -0,0 +1,5 @@
+try:
+ bytearray
+ print("bytearray")
+except NameError:
+ print("no")
diff --git a/tests/feature_check/bytearray.py.exp b/tests/feature_check/bytearray.py.exp
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tests/feature_check/bytearray.py.exp
diff --git a/tests/run-tests b/tests/run-tests
index b22d067192..9e98125797 100755
--- a/tests/run-tests
+++ b/tests/run-tests
@@ -221,6 +221,7 @@ def run_tests(pyb, tests, args, base_path="."):
skip_tests = set()
skip_native = False
skip_int_big = False
+ skip_bytearray = False
skip_set_type = False
skip_async = False
skip_const = False
@@ -244,6 +245,11 @@ def run_tests(pyb, tests, args, base_path="."):
if output != b'1000000000000000000000000000000000000000000000\n':
skip_int_big = True
+ # Check if bytearray is supported, and skip such tests if it's not
+ output = run_feature_check(pyb, args, base_path, 'bytearray.py')
+ if output != b'bytearray\n':
+ skip_bytearray = True
+
# Check if set type (and set literals) is supported, and skip such tests if it's not
output = run_feature_check(pyb, args, base_path, 'set_check.py')
if output == b'CRASH':
@@ -397,6 +403,7 @@ def run_tests(pyb, tests, args, base_path="."):
is_native = test_name.startswith("native_") or test_name.startswith("viper_")
is_endian = test_name.endswith("_endian")
is_int_big = test_name.startswith("int_big") or test_name.endswith("_intbig")
+ is_bytearray = test_name.startswith("bytearray") or test_name.endswith("_bytearray")
is_set_type = test_name.startswith("set_") or test_name.startswith("frozenset")
is_async = test_name.startswith("async_")
is_const = test_name.startswith("const")
@@ -405,6 +412,7 @@ def run_tests(pyb, tests, args, base_path="."):
skip_it |= skip_native and is_native
skip_it |= skip_endian and is_endian
skip_it |= skip_int_big and is_int_big
+ skip_it |= skip_bytearray and is_bytearray
skip_it |= skip_set_type and is_set_type
skip_it |= skip_async and is_async
skip_it |= skip_const and is_const