tests: Add feature check for bytearray and skip corresponding tests.
This commit is contained in:
parent
7a49fc387c
commit
6e9ba1cf4b
5
tests/feature_check/bytearray.py
Normal file
5
tests/feature_check/bytearray.py
Normal file
@ -0,0 +1,5 @@
|
||||
try:
|
||||
bytearray
|
||||
print("bytearray")
|
||||
except NameError:
|
||||
print("no")
|
0
tests/feature_check/bytearray.py.exp
Normal file
0
tests/feature_check/bytearray.py.exp
Normal file
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user