Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Build/steps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,11 @@ steps:
- powershell: ./make.ps1 test-all
displayName: Test

# 32-bit tests on Windows only
- ${{ if eq(parameters.os, 'Windows') }}:
- powershell: ./make.ps1 -frameworks net462 -platform x86 test-all
displayName: Test 32-bit

- task: PublishTestResults@2
displayName: Publish Test Results
inputs:
Expand Down
5 changes: 3 additions & 2 deletions Src/IronPythonTest/Cases/CPythonCasesManifest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -476,9 +476,11 @@ RunCondition=NOT $(IS_POSIX) # TODO: figure out
RunCondition=$(IS_POSIX)
Reason=Only valid for Unix

[CPython.test_hash] # IronPython.test_hash_stdlib
Ignore=true

[CPython.test_httplib] # IronPython.test_httplib_stdlib
Ignore=true
Reason=Blocking

[CPython.test_httpservers]
Ignore=true
Expand All @@ -496,7 +498,6 @@ Reason=Blocking
RunCondition=NOT $(IS_LINUX) # TODO: debug
NotParallelSafe=true # Creates/deletes a module with a static name 'test_imp_helper'


[CPython.test_import]
Ignore=true
Reason=ImportError: No module named _multiprocessing
Expand Down
2 changes: 1 addition & 1 deletion Src/IronPythonTest/Cases/CaseExecuter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ private static string Executable {
var folder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
string runner;
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) {
runner = Path.Combine(folder, "ipy.exe");
runner = Path.Combine(folder, IntPtr.Size == 4 ? "ipy32.exe" : "ipy.exe");
if (File.Exists(runner)) return runner;
} else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux) || RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) {
runner = Path.Combine(folder, "ipy");
Expand Down
1 change: 0 additions & 1 deletion Src/StdLib/Lib/test/test_hash.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,6 @@ def test_hashes(self):
for obj in self.hashes_to_check:
self.assertEqual(hash(obj), _default_hash(obj))

@unittest.skipIf(sys.implementation.name == "ironpython", "TODO")
class HashRandomizationTests:

# Each subclass should define a field "repr_", containing the repr() of
Expand Down
9 changes: 8 additions & 1 deletion Tests/test_formatting.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import math
import os

from iptest import IronPythonTestCase, is_cli, is_netcoreapp, is_netcoreapp21, big, run_test, skipUnlessIronPython
from iptest import IronPythonTestCase, is_cli, is_cli32, is_netcoreapp, is_netcoreapp21, big, run_test, skipUnlessIronPython

class A:
def __str__(self):
Expand Down Expand Up @@ -407,6 +407,13 @@ def test_format_testfile(self):
%r 0.999999999999e-4 -> 9.99999999999e-05
%r 0.999e-4 -> 9.99e-05
%r 1e-5 -> 1e-05
""".strip().split("\n")

if is_cli32:
expected_failures += """
%r 1.0000000000000001e-4 -> 0.0001
%r 1e-4 -> 0.0001
%r 0.99999999999999999e-4 -> 0.0001
""".strip().split("\n")

if not format_rounds_to_even:
Expand Down
66 changes: 66 additions & 0 deletions Tests/test_hash_stdlib.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# Licensed to the .NET Foundation under one or more agreements.
# The .NET Foundation licenses this file to you under the Apache 2.0 License.
# See the LICENSE file in the project root for more information.

##
## Run selected tests from test_hash from StdLib
##

from iptest import is_ironpython, is_netcoreapp, is_cli32, generate_suite, run_test

import test.test_hash

def load_tests(loader, standard_tests, pattern):
tests = loader.loadTestsFromModule(test.test_hash)

if is_ironpython:
test.test_hash.BytesHashRandomizationTests('test_empty_string')
test.test_hash.BytesHashRandomizationTests('test_fixed_hash')
test.test_hash.BytesHashRandomizationTests('test_long_fixed_hash')
test.test_hash.HashBuiltinsTestCase('test_hashes')
test.test_hash.HashEqualityTestCase('test_coerced_floats')
test.test_hash.HashEqualityTestCase('test_coerced_integers')
test.test_hash.HashEqualityTestCase('test_numeric_literals')
test.test_hash.HashEqualityTestCase('test_unaligned_buffers')
test.test_hash.HashInheritanceTestCase('test_default_hash')
test.test_hash.HashInheritanceTestCase('test_error_hash')
test.test_hash.HashInheritanceTestCase('test_fixed_hash')
test.test_hash.HashInheritanceTestCase('test_hashable')
test.test_hash.HashInheritanceTestCase('test_not_hashable')
test.test_hash.MemoryviewHashRandomizationTests('test_empty_string')
test.test_hash.MemoryviewHashRandomizationTests('test_fixed_hash')
test.test_hash.MemoryviewHashRandomizationTests('test_long_fixed_hash')
test.test_hash.StrHashRandomizationTests('test_empty_string')
test.test_hash.StrHashRandomizationTests('test_fixed_hash')
test.test_hash.StrHashRandomizationTests('test_long_fixed_hash')
test.test_hash.StrHashRandomizationTests('test_ucs2_string')

failing_tests = [
test.test_hash.BytesHashRandomizationTests('test_null_hash'), # KeyError: dotnet
test.test_hash.MemoryviewHashRandomizationTests('test_null_hash'), # KeyError: dotnet
test.test_hash.StrHashRandomizationTests('test_null_hash'), # KeyError: dotnet
test.test_hash.DatetimeDateTests('test_randomized_hash'),
test.test_hash.DatetimeDatetimeTests('test_randomized_hash'),
test.test_hash.DatetimeTimeTests('test_randomized_hash'),
]

if not is_netcoreapp:
failing_tests += [
test.test_hash.BytesHashRandomizationTests('test_randomized_hash'),
test.test_hash.MemoryviewHashRandomizationTests('test_randomized_hash'),
test.test_hash.StrHashRandomizationTests('test_randomized_hash'),
]

if is_cli32:
failing_tests += [
test.test_hash.HashDistributionTestCase('test_hash_distribution'),
]

skip_tests = []

return generate_suite(tests, failing_tests, skip_tests)

else:
return tests

run_test(__name__)
14 changes: 10 additions & 4 deletions Tests/test_memoryview.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,10 +205,16 @@ def test_equality_structural(self):
self.assertFalse(mv_d == mv_f)

mv_P = mv.cast('P')
self.assertFalse(mv_P == mv_i)
self.assertFalse(mv_P == mv_L)
self.assertTrue(mv_P == mv_q)
self.assertTrue(mv_P == mv_Q)
if is_64:
self.assertFalse(mv_P == mv_i)
self.assertFalse(mv_P == mv_L)
self.assertTrue(mv_P == mv_q)
self.assertTrue(mv_P == mv_Q)
else:
self.assertTrue(mv_P == mv_i)
self.assertTrue(mv_P == mv_L)
self.assertFalse(mv_P == mv_q)
self.assertFalse(mv_P == mv_Q)

# Comparing different formats works if the values are the same
b = bytes(range(8))
Expand Down
4 changes: 3 additions & 1 deletion Tests/test_stdconsole.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import sys
import unittest

from iptest import IronPythonTestCase, is_cli, is_netcoreapp21, is_posix, run_test, skipUnlessIronPython
from iptest import IronPythonTestCase, is_cli, is_cli32, is_netcoreapp21, is_posix, run_test, skipUnlessIronPython

if is_cli:
import clr
Expand Down Expand Up @@ -82,6 +82,8 @@ def TestCommandLine(self, args, expected_output, expected_exitcode = 0):
realargs.extend(args)
exitcode = os.spawnv(0, self.batfile, realargs)
cmdline = "ipy " + ' '.join(args)
if is_cli32:
cmdline = "ipy32 " + ' '.join(args)

print('')
print(' {}'.format(cmdline))
Expand Down
8 changes: 6 additions & 2 deletions Tests/test_struct_stdlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
## Run selected tests from test_struct from StdLib
##

from iptest import is_ironpython, generate_suite, run_test
from iptest import is_ironpython, is_64, generate_suite, run_test

import test.test_struct

Expand All @@ -17,10 +17,14 @@ def load_tests(loader, standard_tests, pattern):
failing_tests = [
test.test_struct.StructTest('test_705836'), # AssertionError: OverflowError not raised by pack
test.test_struct.StructTest('test_bool'), # struct.error: expected bool value got IronPython.NewTypes.System.Object_1$1
test.test_struct.StructTest('test_calcsize'), # AssertionError: 4 not greater than or equal to 8
test.test_struct.StructTest('test_count_overflow'), # AssertionError: error not raised by calcsize
]

if is_64:
failing_tests += [
test.test_struct.StructTest('test_calcsize'), # AssertionError: 4 not greater than or equal to 8 - https://github.com/IronLanguages/ironpython3/pull/869
]

return generate_suite(tests, failing_tests)

else:
Expand Down
Loading