Skip to content

Commit 0a18220

Browse files
authored
ARM64 test workarounds (#1939)
* ARM64 test workarounds * Change machine test to be cross-platform
1 parent 1f8cd46 commit 0a18220

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

src/core/IronPython/Lib/iptest/test_env.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
import os
66
import sys
7+
import platform
78

89
#------------------------------------------------------------------------------
910

@@ -15,6 +16,7 @@
1516
is_linux = sys.platform == 'linux'
1617
is_osx = sys.platform == 'darwin'
1718
is_posix = is_linux or is_osx
19+
is_arm64 = platform.machine().lower() in ['aarch64', 'arm64']
1820

1921
is_netcoreapp = False
2022
is_netcoreapp21 = False

tests/suite/test_cliclass.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
import sys
66
import unittest
7-
from iptest import IronPythonTestCase, is_cli, is_debug, is_mono, is_net70, is_net80, is_netcoreapp, is_netcoreapp21, is_posix, big, run_test, skipUnlessIronPython
7+
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
88

99
if is_cli:
1010
import clr
@@ -1755,6 +1755,9 @@ def test_int_constructor_overflow(self):
17551755
from iptest import clr_int_types, myint, myfloat
17561756

17571757
val = 1 << 64
1758+
if is_mono and is_arm64:
1759+
# on Mono/ARM64, floating point rounding errors on ARM64 can cause 1 << 64 to fit in 64 bits
1760+
val += 10000
17581761
for t in clr_int_types:
17591762
self.assertRaises(OverflowError, t, val)
17601763
self.assertRaises(OverflowError, t, str(val))

tests/suite/test_datetime_stdlib.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
## Run selected tests from test_datetime from StdLib
77
##
88

9-
from iptest import is_ironpython, generate_suite, run_test
9+
from iptest import is_ironpython, is_mono, is_arm64, generate_suite, run_test
1010

1111
import test.datetimetester
1212

@@ -45,7 +45,13 @@ def load_tests(loader, standard_tests, pattern):
4545
test.datetimetester.TestTimeZone('test_constructor'),
4646
]
4747

48-
return generate_suite(tests, failing_tests)
48+
skip_tests = []
49+
if is_mono and is_arm64:
50+
skip_tests += [
51+
test.datetimetester.TestTimeDelta('test_overflow'), # rounding differences
52+
]
53+
54+
return generate_suite(tests, failing_tests, skip_tests)
4955

5056
else:
5157
return tests

0 commit comments

Comments
 (0)