Skip to content

Commit 89e570a

Browse files
committed
tests/run-tests: Check for big int availability and skip related tests.
Big aka arbitrary-precision integers (implemented by MPZ module) are used in tests starting with "int_big_" or ending with "_intbig".
1 parent 5e83a75 commit 89e570a

3 files changed

Lines changed: 10 additions & 0 deletions

File tree

‎tests/feature_check/int_big.py‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Check whether arbitrary-precision integers (MPZ) are supported
2+
1000000000000000000000000000000000000000000000

‎tests/feature_check/int_big.py.exp‎

Whitespace-only changes.

‎tests/run-tests‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ def run_tests(pyb, tests, args):
198198

199199
skip_tests = set()
200200
skip_native = False
201+
skip_int_big = False
201202
skip_set_type = False
202203
skip_async = False
203204

@@ -206,6 +207,11 @@ def run_tests(pyb, tests, args):
206207
if native == b'CRASH':
207208
skip_native = True
208209

210+
# Check if arbitrary-precision integers are supported, and skip such tests if it's not
211+
native = run_micropython(pyb, args, 'feature_check/int_big.py')
212+
if native == b'CRASH':
213+
skip_int_big = True
214+
209215
# Check if set type (and set literals) is supported, and skip such tests if it's not
210216
native = run_micropython(pyb, args, 'feature_check/set_check.py')
211217
if native == b'CRASH':
@@ -320,12 +326,14 @@ def run_tests(pyb, tests, args):
320326
test_name = os.path.splitext(test_basename)[0]
321327
is_native = test_name.startswith("native_") or test_name.startswith("viper_")
322328
is_endian = test_name.endswith("_endian")
329+
is_int_big = test_name.startswith("int_big_") or test_name.endswith("_intbig")
323330
is_set_type = test_name.startswith("set_") or test_name.startswith("frozenset")
324331
is_async = test_name.startswith("async_")
325332

326333
skip_it = test_file in skip_tests
327334
skip_it |= skip_native and is_native
328335
skip_it |= skip_endian and is_endian
336+
skip_it |= skip_int_big and is_int_big
329337
skip_it |= skip_set_type and is_set_type
330338
skip_it |= skip_async and is_async
331339

0 commit comments

Comments
 (0)