summaryrefslogtreecommitdiff
path: root/tests/run-tests.py
diff options
context:
space:
mode:
authorAngus Gratton <angus@redyak.com.au>2025-03-18 12:07:00 +1100
committerDamien George <damien@micropython.org>2025-07-18 00:10:44 +1000
commit2d8d64059fbc7cd72e40503e5af19eded73c3d47 (patch)
treeaa8e9e725611351bd2fba32726f51b2d6244c3a1 /tests/run-tests.py
parentc72a3e528d7909c212596b52de5f9a5fe0161f17 (diff)
tests: Add specific tests for "long long" 64-bit bigints.
These will run on all ports which support them, but importantly they'll also run on ports that don't support arbitrary precision but do support 64-bit long ints. Includes some test workarounds to account for things which will overflow once "long long" big integers overflow (added in follow-up commit): - uctypes_array_load_store test was failing already, now won't parse. - all the ffi_int tests contain 64-bit unsigned values, that won't parse as long long. This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton <angus@redyak.com.au>
Diffstat (limited to 'tests/run-tests.py')
-rwxr-xr-xtests/run-tests.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/tests/run-tests.py b/tests/run-tests.py
index fe338d7ff..c218afae7 100755
--- a/tests/run-tests.py
+++ b/tests/run-tests.py
@@ -628,6 +628,7 @@ def run_tests(pyb, tests, args, result_dir, num_threads=1):
skip_tests = set()
skip_native = False
skip_int_big = False
+ skip_int_64 = False
skip_bytearray = False
skip_set_type = False
skip_slice = False
@@ -658,6 +659,11 @@ def run_tests(pyb, tests, args, result_dir, num_threads=1):
if output != b"1000000000000000000000000000000000000000000000\n":
skip_int_big = True
+ # Check if 'long long' precision integers are supported, even if arbitrary precision is not
+ output = run_feature_check(pyb, args, "int_64.py")
+ if output != b"4611686018427387904\n":
+ skip_int_64 = True
+
# Check if bytearray is supported, and skip such tests if it's not
output = run_feature_check(pyb, args, "bytearray.py")
if output != b"bytearray\n":
@@ -885,7 +891,12 @@ def run_tests(pyb, tests, args, result_dir, num_threads=1):
test_name = os.path.splitext(os.path.basename(test_file))[0]
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_int_big = (
+ test_name.startswith("int_big")
+ or test_name.endswith("_intbig")
+ or test_name.startswith("ffi_int") # these tests contain large integer literals
+ )
+ is_int_64 = test_name.startswith("int_64") or test_name.endswith("_int64")
is_bytearray = test_name.startswith("bytearray") or test_name.endswith("_bytearray")
is_set_type = test_name.startswith(("set_", "frozenset")) or test_name.endswith("_set")
is_slice = test_name.find("slice") != -1 or test_name in misc_slice_tests
@@ -899,6 +910,7 @@ def run_tests(pyb, tests, args, result_dir, num_threads=1):
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_int_64 and is_int_64
skip_it |= skip_bytearray and is_bytearray
skip_it |= skip_set_type and is_set_type
skip_it |= skip_slice and is_slice