diff --git a/src/core/IronPython/Lib/iptest/test_env.py b/src/core/IronPython/Lib/iptest/test_env.py index bbcd239b5..6e22556dc 100644 --- a/src/core/IronPython/Lib/iptest/test_env.py +++ b/src/core/IronPython/Lib/iptest/test_env.py @@ -4,6 +4,7 @@ import os import sys +import platform #------------------------------------------------------------------------------ @@ -15,6 +16,7 @@ is_linux = sys.platform == 'linux' is_osx = sys.platform == 'darwin' is_posix = is_linux or is_osx +is_arm64 = platform.machine().lower() in ['aarch64', 'arm64'] is_netcoreapp = False is_netcoreapp21 = False diff --git a/tests/suite/test_cliclass.py b/tests/suite/test_cliclass.py index 0306a9205..5c081f382 100644 --- a/tests/suite/test_cliclass.py +++ b/tests/suite/test_cliclass.py @@ -4,7 +4,7 @@ import sys import unittest -from iptest import IronPythonTestCase, is_cli, is_debug, is_mono, is_net70, is_net80, is_netcoreapp, is_netcoreapp21, is_posix, big, run_test, skipUnlessIronPython +from iptest import IronPythonTestCase, is_cli, is_debug, is_mono, is_net70, is_net80, is_netcoreapp, is_netcoreapp21, is_posix, is_arm64, big, run_test, skipUnlessIronPython if is_cli: import clr @@ -1755,6 +1755,9 @@ def test_int_constructor_overflow(self): from iptest import clr_int_types, myint, myfloat val = 1 << 64 + if is_mono and is_arm64: + # on Mono/ARM64, floating point rounding errors on ARM64 can cause 1 << 64 to fit in 64 bits + val += 10000 for t in clr_int_types: self.assertRaises(OverflowError, t, val) self.assertRaises(OverflowError, t, str(val)) diff --git a/tests/suite/test_datetime_stdlib.py b/tests/suite/test_datetime_stdlib.py index b8f11237a..d1d23a2dd 100644 --- a/tests/suite/test_datetime_stdlib.py +++ b/tests/suite/test_datetime_stdlib.py @@ -6,7 +6,7 @@ ## Run selected tests from test_datetime from StdLib ## -from iptest import is_ironpython, generate_suite, run_test +from iptest import is_ironpython, is_mono, is_arm64, generate_suite, run_test import test.datetimetester @@ -45,7 +45,13 @@ def load_tests(loader, standard_tests, pattern): test.datetimetester.TestTimeZone('test_constructor'), ] - return generate_suite(tests, failing_tests) + skip_tests = [] + if is_mono and is_arm64: + skip_tests += [ + test.datetimetester.TestTimeDelta('test_overflow'), # rounding differences + ] + + return generate_suite(tests, failing_tests, skip_tests) else: return tests