diff --git a/src/core/IronPython.StdLib b/src/core/IronPython.StdLib index b28e7d77e..817e9c810 160000 --- a/src/core/IronPython.StdLib +++ b/src/core/IronPython.StdLib @@ -1 +1 @@ -Subproject commit b28e7d77e680a3f3e18823d1fd96b67c4c78a7a9 +Subproject commit 817e9c81088396e7dd8f495dec62d5584d940ac9 diff --git a/tests/IronPython.Tests/Cases/CPythonCases.cs b/tests/IronPython.Tests/Cases/CPythonCases.cs index a863c2549..06e2d2117 100644 --- a/tests/IronPython.Tests/Cases/CPythonCases.cs +++ b/tests/IronPython.Tests/Cases/CPythonCases.cs @@ -19,19 +19,26 @@ public override int Test(TestInfo testcase) { internal class CPythonCaseGenerator : CommonCaseGenerator { protected override IEnumerable GetTests() { var libFolder = Path.Combine("src", "core", "IronPython.StdLib", "lib"); - return GetFilenames(new [] { - System.Tuple.Create(category, Path.Combine(libFolder, "test")), - System.Tuple.Create($"{category}.ctypes", Path.Combine(libFolder, "ctypes", "test")), - System.Tuple.Create($"{category}.distutils", Path.Combine(libFolder, "distutils", "tests")), - System.Tuple.Create($"{category}.unittest", Path.Combine(libFolder, "unittest", "test")), - }) - .OrderBy(testcase => testcase.Name); + var suiteFolder = Path.Combine("tests", "suite", "stdlib"); - IEnumerable GetFilenames(IEnumerable> folders) { - foreach (var tuple in folders) { - var fullPath = Path.Combine(CaseExecuter.FindRoot(), tuple.Item2); - foreach (var filename in Directory.EnumerateFiles(fullPath, "test_*.py", SearchOption.AllDirectories)) - yield return new TestInfo(Path.GetFullPath(filename), tuple.Item1, tuple.Item2, manifest); + return GetTestInfo(category, "test") + .Concat(GetTestInfo($"{category}.ctypes", Path.Combine("ctypes", "test"))) + .Concat(GetTestInfo($"{category}.distutils", Path.Combine("distutils", "tests"))) + .Concat(GetTestInfo($"{category}.unittest", Path.Combine("unittest", "test"))) + .OrderBy(testcase => testcase.Name); + + IEnumerable GetTestInfo(string category, string folder) { + var root = CaseExecuter.FindRoot(); + var altFolder = Path.GetDirectoryName(folder); // drop the trailing test (or tests) folder + var fullPath = Path.GetFullPath(Path.Combine(root, libFolder, folder)); + var altFullPath = Path.GetFullPath(Path.Combine(root, suiteFolder, altFolder)); + foreach (var filename in Directory.EnumerateFiles(fullPath, "test_*.py", SearchOption.AllDirectories)) { + var altFilename = Path.GetFullPath(Path.Combine(altFullPath, Path.GetRelativePath(fullPath, filename))); + if (File.Exists(altFilename)) { + yield return new TestInfo(altFilename, category, Path.Combine(suiteFolder, altFolder), manifest); + } else { + yield return new TestInfo(filename, category, Path.Combine(libFolder, folder), manifest); + } } } } diff --git a/tests/IronPython.Tests/Cases/CPythonCasesManifest.ini b/tests/IronPython.Tests/Cases/CPythonCasesManifest.ini index 480ee70b6..d970bf63e 100644 --- a/tests/IronPython.Tests/Cases/CPythonCasesManifest.ini +++ b/tests/IronPython.Tests/Cases/CPythonCasesManifest.ini @@ -57,9 +57,6 @@ Ignore=true [CPython.ctypes.test_slicing] Ignore=true # https://github.com/IronLanguages/ironpython3/issues/1299 -[CPython.ctypes.test_structures] # IronPython.test_structures_ctypes_stdlib -Ignore=true - [CPython.ctypes.test_unicode] Ignore=true Reason=https://github.com/IronLanguages/ironpython2/issues/405 @@ -114,16 +111,10 @@ Ignore=true RunCondition=$(IS_OSX) Ignore=true -[CPython.test_abc] # IronPython.test_abc_stdlib -Ignore=true - [CPython.test_aifc] # Module has been removed in 3.13 - https://github.com/IronLanguages/ironpython3/issues/1352 Ignore=true Reason=ImportError: No module named audioop -[CPython.test_array] # IronPython.test_array_stdlib -Ignore=true - [CPython.test_asdl_parser] # new in 3.5 Ignore=true Reason=unittest.case.SkipTest: test irrelevant for an installed Python @@ -195,8 +186,9 @@ Ignore=true [CPython.test_binhex] # Module has been removed in 3.11 Ignore=true # blocked by https://github.com/IronLanguages/ironpython3/issues/673 -[CPython.test_builtin] # IronPython.test_builtin_stdlib -Ignore=true +[CPython.test_builtin] +RunCondition=NOT $(IS_MONO) +Reason=Exception on adding DocTestSuite [CPython.test_bufio] RetryCount=2 @@ -205,16 +197,10 @@ RetryCount=2 Arguments=-bb "$(TEST_FILE)" IsolationLevel=PROCESS # required for Arguments to have effect -[CPython.test_bz2] # IronPython.test_bz2_stdlib -Ignore=true - [CPython.test_calendar] RunCondition=$(IS_DEBUG) # https://github.com/IronLanguages/ironpython3/issues/1067 Timeout=600000 # 10 minute timeout -[CPython.test_call] # IronPython.test_call_stdlib -Ignore=true - [CPython.test_capi] Ignore=true Reason=ImportError: No module named _testcapi @@ -226,10 +212,9 @@ Reason=SystemError: The stream does not support seeking [CPython.test_cgitb] # Module has been removed in 3.13 - https://github.com/IronLanguages/ironpython3/issues/1352 Ignore=true -[CPython.test_class] # IronPython.test_class_stdlib +[CPython.test_class] IsolationLevel=ENGINE MaxRecursion=100 -Ignore=true [CPython.test_cmath] Ignore=true @@ -243,12 +228,6 @@ Ignore=true [CPython.test_code] Ignore=true -[CPython.test_code_module] # IronPython.test_code_module_stdlib -Ignore=true - -[CPython.test_codeccallbacks] # IronPython.test_codeccallbacks_stdlib -Ignore=true - [CPython.test_codecencodings_cn] Ignore=true Reason=LookupError: unknown encoding @@ -293,9 +272,6 @@ Reason=LookupError: unknown encoding Ignore=true Reason=LookupError: unknown encoding -[CPython.test_codecs] # IronPython.test_codecs_stdlib -Ignore=true - [CPython.test_codeop] Ignore=true @@ -307,9 +283,6 @@ Reason=StackOverflowException Ignore=true Reason=AttributeError: 'module' object has no attribute 'symlink' -[CPython.test_complex] # IronPython.test_complex_stdlib -Ignore=true - [CPython.test_concurrent_futures] Ignore=true Reason=ImportError: Cannot import name SemLock @@ -343,9 +316,6 @@ RunCondition=$(IS_POSIX) Ignore=true Reason=unittest.case.SkipTest: No module named _curses -[CPython.test_datetime] # IronPython.test_datetime_stdlib -Ignore=true - [CPython.test_dbm_dumb] RunCondition=NOT $(IS_POSIX) # TODO: debug @@ -364,18 +334,17 @@ Ignore=true IsolationLevel=PROCESS # https://github.com/IronLanguages/ironpython3/issues/489 RunCondition=NOT $(IS_MONO) # https://github.com/IronLanguages/ironpython3/issues/544 -[CPython.test_descr] # IronPython.test_descr_stdlib +[CPython.test_descr] IsolationLevel=ENGINE MaxRecursion=100 -Ignore=true -Reason=StackOverflowException [CPython.test_devpoll] Ignore=true Reason=unittest.case.SkipTest: test works only on Solaris OS family -[CPython.test_dict] # IronPython.test_dict_stdlib -Ignore=true +[CPython.test_dict] +IsolationLevel=ENGINE +MaxRecursion=100 [CPython.test_dict_version] # new in 3.6 Ignore=true @@ -438,7 +407,7 @@ Ignore=true Ignore=true Reason=unittest.case.SkipTest: test works only on Linux 2.6 -[CPython.test_exception_hierarchy] # used to be test_pep3151 (renamed in 3.6) +[CPython.test_exception_hierarchy] Ignore=true [CPython.test_exceptions] @@ -460,18 +429,12 @@ RunCondition=NOT $(IS_POSIX) # TODO: debug [CPython.test_filecmp] NotParallelSafe=true # Creates/deletes a directory with a static name 'dir' in $TEMP -[CPython.test_fileinput] # IronPython.test_fileinput_stdlib -Ignore=true - [CPython.test_fileio] Ignore=true [CPython.test_finalization] Ignore=true -[CPython.test_float] # IronPython.test_float_stdlib -Ignore=true - [CPython.test_flufl] Ignore=true @@ -489,9 +452,6 @@ Reason=Blocking [CPython.test_funcattrs] Ignore=true -[CPython.test_functools] # IronPython.test_functools_stdlib -Ignore=true - [CPython.test_future] Ignore=true @@ -521,9 +481,6 @@ NotParallelSafe=true # Creates/deletes a directory with static name 'xx' [CPython.test_glob] RunCondition=NOT $(IS_POSIX) # TODO: figure out -[CPython.test_grammar] # IronPython.test_grammar_stdlib -Ignore=true - [CPython.test_grp] RunCondition=$(IS_POSIX) Reason=Only valid for Unix @@ -531,13 +488,6 @@ Reason=Only valid for Unix [CPython.test_gzip] IsolationLevel=PROCESS # https://github.com/IronLanguages/ironpython3/issues/1440 -[CPython.test_heapq] # IronPython.test_heapq_stdlib -Ignore=true - -[CPython.test_httplib] # IronPython.test_httplib_stdlib -Ignore=true -Reason=Blocking - [CPython.test_httpservers] Ignore=true Reason=Blocking # works? @@ -565,8 +515,8 @@ Ignore=true Ignore=true Reason=ImportError: No module named _multiprocessing -[CPython.test_io] # IronPython.test_io_stdlib -Ignore=true +[CPython.test_io] +IsolationLevel=PROCESS # https://github.com/IronLanguages/ironpython3/issues/1808 [CPython.test_ioctl] RunCondition=$(IS_POSIX) @@ -581,9 +531,6 @@ Reason=ipaddress.AddressValueError: Expected 4 octets in '4294967295' IsolationLevel=ENGINE MaxRecursion=100 -[CPython.test_itertools] # IronPython.test_itertools_stdlib -Ignore=true - [CPython.test_json.test_enum] Ignore=true @@ -603,9 +550,6 @@ Ignore=true [CPython.test_lib2to3] Ignore=true -[CPython.test_linecache] # IronPython.test_linecache_stdlib -Ignore=true - [CPython.test_list] IsolationLevel=ENGINE MaxRecursion=100 @@ -617,9 +561,6 @@ Ignore=true Ignore=true Reason=StackOverflowException - https://github.com/IronLanguages/ironpython2/issues/182 -[CPython.test_long] # IronPython.test_long_stdlib -Ignore=true - [CPython.test_lzma] Ignore=true Reason=ImportError: No module named _lzma @@ -637,9 +578,6 @@ RunCondition=NOT $(IS_LINUX) # TODO: debug [CPython.test_marshal] Ignore=true -[CPython.test_memoryio] # IronPython.test_memoryio_stdlib -Ignore=true - [CPython.test_memoryview] RunCondition=NOT $(IS_MONO) # weakref failures; https://github.com/IronLanguages/ironpython3/issues/544 IsolationLevel=PROCESS # Also weakref failures; https://github.com/IronLanguages/ironpython3/issues/489 @@ -647,9 +585,6 @@ IsolationLevel=PROCESS # Also weakref failures; https://github.com/IronLanguages [CPython.test_metaclass] Ignore=true -[CPython.test_minidom] # IronPython.test_minidom_stdlib -Ignore=true - [CPython.test_mmap] RunCondition=NOT $(IS_MONO) AND (NOT $(IS_OSX) OR '$(FRAMEWORK)' <> '.NETCoreApp,Version=v6.0') IsolationLevel=PROCESS @@ -700,17 +635,11 @@ Ignore=true RunCondition=$(IS_WINDOWS) # TODO: failing on posix IsolationLevel=PROCESS # Manipulates environment variables -[CPython.test_opcodes] # IronPython.test_opcodes_stdlib -Ignore=true - [CPython.test_openpty] RunCondition=$(IS_POSIX) Ignore=true Reason=unittest.case.SkipTest: os.openpty() not available. -[CPython.test_ordered_dict] # IronPython.test_ordered_dict_stdlib -Ignore=true - [CPython.test_os] Ignore=true @@ -733,20 +662,6 @@ Reason=Blocking [CPython.test_peepholer] Ignore=true -[CPython.test_pep277] # renamed to test_unicode_file_functions in 3.6 -RunCondition=NOT $(IS_POSIX) # TODO: debug -NotParallelSafe=true # Renames files to/from a static name 'tmp' - -[CPython.test_pep380] # IronPython.test_yield_from_stdlib - renamed to test_yield_from in 3.6 -Ignore=true - -[CPython.test_pep3131] # renamed to test_unicode_identifiers in 3.6 -Ignore=true -Reason=SyntaxError: invalid syntax - -[CPython.test_pep3151] # renamed to test_exception_hierarchy in 3.6 -Ignore=true - [CPython.test_pickle] Ignore=true Reason=StackOverflowException @@ -769,9 +684,6 @@ Ignore=true [CPython.test_platform] RunCondition=NOT $(IS_OSX) -[CPython.test_plistlib] # IronPython.test_plistlib_stdlib -Ignore=true - [CPython.test_poll] RunCondition=$(IS_POSIX) Ignore=true @@ -789,9 +701,6 @@ Reason=AttributeError: module 'posix' has no attribute 'chown' [CPython.test_posixpath] Ignore=true -[CPython.test_print] # IronPython.test_print_stdlib -Ignore=true - [CPython.test_profile] Ignore=true @@ -822,23 +731,22 @@ Ignore=true [CPython.test_random] Ignore=true -[CPython.test_re] # IronPython.test_re_stdlib -Ignore=true -Reason=ImportError: Cannot import name Scanner +[CPython.test_re] +IsolationLevel=PROCESS # workaround for StackOverflowException on macOS on .NET 7 [CPython.test_readline] RunCondition=$(IS_POSIX) Ignore=true Reason=unittest.case.SkipTest: No module named 'readline' -[CPython.test_regrtest] # IronPython.test_regrtest_stdlib -Ignore=true +[CPython.test_regrtest] +IsolationLevel=PROCESS [CPython.test_reprlib] Ignore=true -[CPython.test_resource] # IronPython.test_resource_stdlib -Ignore=true +[CPython.test_resource] +RunCondition=$(IS_POSIX) # Module resource is Posix-specific [CPython.test_robotparser] Ignore=true @@ -848,12 +756,6 @@ Reason=StackOverflowException - https://github.com/IronLanguages/ironpython2/iss Ignore=true Reason=NotImplementedError: sys.implementation.cache_tag is None -[CPython.test_sax] # IronPython.test_sax_stdlib -Ignore=true - -[CPython.test_scope] # IronPython.test_scope_stdlib -Ignore=true - [CPython.test_script_helper] Ignore=true @@ -864,8 +766,9 @@ Ignore=true [CPython.test_selectors] Ignore=true -[CPython.test_set] # IronPython.test_set_stdlib -Ignore=true +[CPython.test_set] +RunCondition=NOT $(IS_MONO) # weakref failures; https://github.com/IronLanguages/ironpython3/issues/544 +IsolationLevel=PROCESS # Also weakref failures; https://github.com/IronLanguages/ironpython3/issues/489 [CPython.test_shelve] NotParallelSafe=true @@ -885,8 +788,9 @@ Ignore=true [CPython.test_smtplib] RunCondition=NOT $(IS_POSIX) # TODO: debug -[CPython.test_socket] # IronPython.test_socket_stdlib -Ignore=true +[CPython.test_socket] +RunCondition=NOT $(IS_MONO) # TODO: figure out +Timeout=300000 # 5 minute timeout - sometimes slow [CPython.test_socketserver] Ignore=true # blocked by https://github.com/IronLanguages/ironpython3/issues/1221 @@ -898,11 +802,9 @@ IsolationLevel=ENGINE # source file in a non-UTF-8 encoding RunCondition=$(IS_POSIX) AND NOT $(IS_OSX) # https://github.com/IronLanguages/ironpython3/issues/1545 [CPython.test_sqlite] -Ignore=true - -[CPython.test_ssl] # IronPython.test_ssl_stdlib -Ignore=true -Reason=Blocking +IsolationLevel=PROCESS +RunCondition=NOT $(IS_OSX) # https://github.com/IronLanguages/ironpython3/issues/1483 +NotParallelSafe=true [CPython.test_startfile] RunCondition=NOT $(IS_POSIX) # TODO: debug? @@ -913,23 +815,17 @@ Ignore=true [CPython.test_statistics] Ignore=true -[CPython.test_string_literals] # IronPython.test_string_literals_stdlib -Ignore=true - [CPython.test_stringprep] Ignore=true Reason=Requires unicode 3.2.0 data - https://github.com/IronLanguages/ironpython3/issues/691 -[CPython.test_strptime] # IronPython.test_strptime_stdlib -Ignore=true +[CPython.test_strptime] +RunCondition=NOT $(IS_LINUX) # fails on CI [CPython.test_strtod] Ignore=true Reason=unittest.case.SkipTest: correctly-rounded string->float conversions not available on this system -[CPython.test_struct] # IronPython.test_struct_stdlib -Ignore=true - [CPython.test_structmembers] Ignore=true Reason=ImportError: No module named '_testcapi' @@ -952,12 +848,6 @@ Reason=ImportError: No module named audioop Ignore=true Reason=ImportError: No module named _msi -[CPython.test_super] # IronPython.test_super_stdlib -Ignore=true - -[CPython.test_support] # IronPython.test_support_stdlib -Ignore=true - [CPython.test_symtable] Ignore=true Reason=ImportError: No module named _symtable @@ -1010,8 +900,9 @@ Ignore=true [CPython.test_threadedtempfile] RetryCount=2 # https://github.com/IronLanguages/ironpython3/issues/1063 -[CPython.test_threading] # IronPython.test_threading_stdlib -Ignore=true +[CPython.test_threading] +IsolationLevel=PROCESS +RunCondition=NOT $(IS_MONO) # TODO: figure out [CPython.test_threading_local] Ignore=true @@ -1021,9 +912,6 @@ RunCondition=$(IS_POSIX) Ignore=true Reason=unittest.case.SkipTest: Cant test signal on win32 -[CPython.test_time] # IronPython.test_time_stdlib -Ignore=true - [CPython.test_timeout] RunCondition=NOT $(IS_MONO) AND NOT ($(IS_POSIX) AND $(IS_NETSTANDARD)) # https://github.com/IronLanguages/ironpython3/issues/1522 + other issues? @@ -1060,27 +948,26 @@ Reason=unittest.case.SkipTest: No module named '_tkinter' Ignore=true Reason=unittest.case.SkipTest: No module named '_tkinter' -[CPython.test_types] # IronPython.test_types_stdlib -Ignore=true - -[CPython.test_typing] # IronPython.test_typing_stdlib -Ignore=true +[CPython.test_typing] +IsolationLevel=ENGINE +MaxRecursion=100 [CPython.test_ucn] Ignore=true Reason=Blocked by https://github.com/IronLanguages/ironpython3/issues/691 -[CPython.test_unicode] # IronPython.test_unicode_stdlib -Ignore=true +[CPython.test_unicode] +RunCondition=NOT $(IS_MONO) # Mono codepage 852 encoding incorrecly decodes 0xAA to '?' instead of '¬' +IsolationLevel=PROCESS # reset reporting of warnings [CPython.test_unicode_file] Ignore=true -[CPython.test_unicode_file_functions] # used to be test_pep277 (renamed in 3.6) +[CPython.test_unicode_file_functions] RunCondition=NOT $(IS_POSIX) # TODO: debug NotParallelSafe=true # Renames files to/from a static name 'tmp' -[CPython.test_unicode_identifiers] # used to be test_pep3131 (renamed in 3.6) +[CPython.test_unicode_identifiers] Ignore=true Reason=SyntaxError: invalid syntax @@ -1115,11 +1002,13 @@ Reason=https://github.com/IronLanguages/ironpython3/issues/581 IsolationLevel=ENGINE MaxRecursion=100 -[CPython.test_userlist] # IronPython.test_userlist_stdlib -Ignore=true +[CPython.test_userlist] +IsolationLevel=ENGINE +MaxRecursion=100 -[CPython.test_utf8_mode] # IronPython.test_utf8_mode_stdlib -Ignore=true +[CPython.test_utf8_mode] +Timeout=240000 # Mono is extremely slow +IsolationLevel=PROCESS [CPython.test_venv] Ignore=true @@ -1138,9 +1027,6 @@ Ignore=true [CPython.test_weakref] Ignore=true -[CPython.test_weakset] # IronPython.test_weakset_stdlib -Ignore=true - [CPython.test_winconsoleio] # new in 3.6 Ignore=true @@ -1167,9 +1053,6 @@ Ignore=true Ignore=true Reason=StackOverflowException - https://github.com/IronLanguages/ironpython2/issues/182 -[CPython.test_yield_from] # IronPython.test_yield_from_stdlib - used to be test_pep380 (renamed in 3.6) -Ignore=true - [CPython.test_zipfile] Ignore=true diff --git a/tests/IronPython.Tests/Cases/IronPythonCases.cs b/tests/IronPython.Tests/Cases/IronPythonCases.cs index 205079905..0d7e40b2c 100644 --- a/tests/IronPython.Tests/Cases/IronPythonCases.cs +++ b/tests/IronPython.Tests/Cases/IronPythonCases.cs @@ -25,8 +25,11 @@ IEnumerable GetTestSuite() { var root = CaseExecuter.FindRoot(); var folder = Path.Combine("tests", "suite"); var fullPath = Path.GetFullPath(Path.Combine(root, folder)); - foreach (var filename in Directory.EnumerateFiles(fullPath, "test_*.py", SearchOption.AllDirectories)) + var stdlibFullPath = Path.Combine(fullPath, "stdlib"); + foreach (var filename in Directory.EnumerateFiles(fullPath, "test_*.py", SearchOption.AllDirectories)) { + if (filename.StartsWith(stdlibFullPath, System.StringComparison.OrdinalIgnoreCase)) continue; yield return new TestInfo(filename, category, folder, manifest); + } } IEnumerable GetEngScripts() { diff --git a/tests/IronPython.Tests/Cases/IronPythonCasesManifest.ini b/tests/IronPython.Tests/Cases/IronPythonCasesManifest.ini index 2910bb769..8a4beeb00 100644 --- a/tests/IronPython.Tests/Cases/IronPythonCasesManifest.ini +++ b/tests/IronPython.Tests/Cases/IronPythonCasesManifest.ini @@ -9,14 +9,6 @@ Ignore=true RunCondition='$(FRAMEWORK)' <> '.NETFramework,Version=v4.6.2' Reason=Requires IAsyncEnumerable & IAsyncDisposable -[IronPython.test_builtin_stdlib] -RunCondition=NOT $(IS_MONO) -Reason=Exception on adding DocTestSuite - -[IronPython.test_class_stdlib] -IsolationLevel=ENGINE -MaxRecursion=100 # tests stack overflow handling - [IronPython.test_cliclass] IsolationLevel=PROCESS # TODO: figure out - wpf fails to load otherwise @@ -29,14 +21,6 @@ IsolationLevel=PROCESS # TODO: figure out - breaks the sys module in other tests [IronPython.test_delegate] RetryCount=2 -[IronPython.test_descr_stdlib] -IsolationLevel=ENGINE -MaxRecursion=100 - -[IronPython.test_dict_stdlib] -IsolationLevel=ENGINE -MaxRecursion=100 - [IronPython.test_dllsite] Ignore=true Reason=disabled in IronLanguages/main, needs lots of work @@ -59,9 +43,6 @@ Ignore=true Ignore=true Reason=Requires powershell -[IronPython.test_io_stdlib] -IsolationLevel=PROCESS # https://github.com/IronLanguages/ironpython3/issues/1808 - [IronPython.test_ipyc] Ignore=true Reason=New test needs to be written for new csharp version @@ -94,9 +75,6 @@ Reason=Needs to be redone as two tests Ignore=true Reason=StackOverflowException - https://github.com/IronLanguages/ironpython2/issues/182 -[IronPython.test_re_stdlib] -IsolationLevel=PROCESS # workaround for StackOverflowException on macOS on .NET 7 - [IronPython.test_regressions] IsolationLevel=PROCESS # https://github.com/IronLanguages/ironpython3/issues/489 RetryCount=2 @@ -105,22 +83,6 @@ RetryCount=2 IsolationLevel=PROCESS Arguments=-X:CompilationThreshold 0 "$(TEST_FILE)" # ensure CompilationThreshold is 0 otherwise tests are meaningless! -[IronPython.test_regrtest_stdlib] -IsolationLevel=PROCESS - -[IronPython.test_set_stdlib] -RunCondition=NOT $(IS_MONO) # weakref failures; https://github.com/IronLanguages/ironpython3/issues/544 -IsolationLevel=PROCESS # Also weakref failures; https://github.com/IronLanguages/ironpython3/issues/489 - -[IronPython.test_socket_stdlib] -RunCondition=NOT $(IS_MONO) # TODO: figure out -Timeout=300000 # 5 minute timeout - sometimes slow - -[IronPython.test_sqlite3_stdlib] -IsolationLevel=PROCESS -RunCondition=NOT $(IS_OSX) # https://github.com/IronLanguages/ironpython3/issues/1483 -NotParallelSafe=true - [IronPython.test_stdconsole] Timeout=600000 # 10 minute timeout @@ -130,9 +92,6 @@ IsolationLevel=PROCESS # for some reason this may fail without the IsolationLeve [IronPython.test_strformat] IsolationLevel=PROCESS # for some reason this may fail without the IsolationLevel -[IronPython.test_strptime_stdlib] -RunCondition=NOT $(IS_LINUX) # fails on CI - [IronPython.test_superconsole] Ignore=true Reason=Uses MAUI framework, which was MS internal? @@ -145,10 +104,6 @@ Reason=Unstable - https://github.com/IronLanguages/ironpython3/issues/1037 Ignore=true Reason=StackOverflowException - https://github.com/IronLanguages/ironpython2/issues/182 -[IronPython.test_threading_stdlib] -IsolationLevel=PROCESS -RunCondition=NOT $(IS_MONO) # TODO: figure out - [IronPython.test_threadsafety] Ignore=true @@ -156,25 +111,9 @@ Ignore=true IsolationLevel=PROCESS NotParallelSafe=true # Creates temporary fixed-name modules -[IronPython.test_typing_stdlib] -IsolationLevel=ENGINE -MaxRecursion=100 - -[IronPython.test_userlist_stdlib] -IsolationLevel=ENGINE -MaxRecursion=100 - [IronPython.test_weakref] RunCondition=NOT $(IS_MONO) # weakref failures -[IronPython.test_unicode_stdlib] -RunCondition=NOT $(IS_MONO) # Mono codepage 852 encoding incorrecly decodes 0xAA to '?' instead of '¬' -IsolationLevel=PROCESS # reset reporting of warnings - -[IronPython.test_utf8_mode_stdlib] -Timeout=240000 # Mono is extremely slow -IsolationLevel=PROCESS - [IronPython.interop.net.derivation.test_property_override] IsolationLevel=PROCESS # causes a failure in IronPython.test_statics @@ -197,9 +136,6 @@ RetryCount=2 RunCondition=NOT $(IS_POSIX) NotParallelSafe=true # Uses fixed file, directory, and environment variable names -[IronPython.modules.system_related.test_resource_stdlib] -RunCondition=$(IS_POSIX) # Module resource is Posix-specific - [IronPython.modules.system_related.test_sys_getframe] IsolationLevel=PROCESS # https://github.com/IronLanguages/ironpython3/issues/489 FullFrames=true diff --git a/tests/IronPython.Tests/IronPython.Tests.csproj b/tests/IronPython.Tests/IronPython.Tests.csproj index 8bd43e6d0..17e5d3d40 100644 --- a/tests/IronPython.Tests/IronPython.Tests.csproj +++ b/tests/IronPython.Tests/IronPython.Tests.csproj @@ -1,9 +1,12 @@ - + net462;net8.0;net10.0 IronPythonTest true + + M:System.IO.Path.GetRelativePath(System.String, System.String); + @@ -25,6 +28,13 @@ + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + diff --git a/tests/suite/test_structures_ctypes_stdlib.py b/tests/suite/stdlib/ctypes/test_structures.py similarity index 100% rename from tests/suite/test_structures_ctypes_stdlib.py rename to tests/suite/stdlib/ctypes/test_structures.py diff --git a/tests/suite/gen_stdlib_test.py b/tests/suite/stdlib/gen_stdlib_test.py similarity index 97% rename from tests/suite/gen_stdlib_test.py rename to tests/suite/stdlib/gen_stdlib_test.py index f14948f93..3de861e6a 100644 --- a/tests/suite/gen_stdlib_test.py +++ b/tests/suite/stdlib/gen_stdlib_test.py @@ -51,9 +51,9 @@ def load_tests(loader, standard_tests, pattern): package = sys.argv[2] if len(sys.argv) > 2 else None location = sys.argv[3] if len(sys.argv) > 3 else "." - filepath = os.path.join(location, name + ("_" + package if package else "") + "_stdlib.py") + filepath = os.path.join(location, name + ("_" + package if package else "") + ".py") - sys.path.insert(0, os.path.abspath(os.path.join(__file__, "../../src/core/IronPython.StdLib/lib"))) + sys.path.insert(0, os.path.abspath(os.path.join(__file__, "../../../src/core/IronPython.StdLib/lib"))) module = importlib.import_module("{package}test.{name}".format(name=name, package=package + "." if package else "")) tests = [] diff --git a/tests/suite/test_abc_stdlib.py b/tests/suite/stdlib/test_abc.py similarity index 100% rename from tests/suite/test_abc_stdlib.py rename to tests/suite/stdlib/test_abc.py diff --git a/tests/suite/test_array_stdlib.py b/tests/suite/stdlib/test_array.py similarity index 100% rename from tests/suite/test_array_stdlib.py rename to tests/suite/stdlib/test_array.py diff --git a/tests/suite/test_builtin_stdlib.py b/tests/suite/stdlib/test_builtin.py similarity index 100% rename from tests/suite/test_builtin_stdlib.py rename to tests/suite/stdlib/test_builtin.py diff --git a/tests/suite/test_bz2_stdlib.py b/tests/suite/stdlib/test_bz2.py similarity index 100% rename from tests/suite/test_bz2_stdlib.py rename to tests/suite/stdlib/test_bz2.py diff --git a/tests/suite/test_call_stdlib.py b/tests/suite/stdlib/test_call.py similarity index 100% rename from tests/suite/test_call_stdlib.py rename to tests/suite/stdlib/test_call.py diff --git a/tests/suite/test_class_stdlib.py b/tests/suite/stdlib/test_class.py similarity index 100% rename from tests/suite/test_class_stdlib.py rename to tests/suite/stdlib/test_class.py diff --git a/tests/suite/test_code_module_stdlib.py b/tests/suite/stdlib/test_code_module.py similarity index 100% rename from tests/suite/test_code_module_stdlib.py rename to tests/suite/stdlib/test_code_module.py diff --git a/tests/suite/test_codeccallbacks_stdlib.py b/tests/suite/stdlib/test_codeccallbacks.py similarity index 100% rename from tests/suite/test_codeccallbacks_stdlib.py rename to tests/suite/stdlib/test_codeccallbacks.py diff --git a/tests/suite/test_codecs_stdlib.py b/tests/suite/stdlib/test_codecs.py similarity index 100% rename from tests/suite/test_codecs_stdlib.py rename to tests/suite/stdlib/test_codecs.py diff --git a/tests/suite/test_complex_stdlib.py b/tests/suite/stdlib/test_complex.py similarity index 100% rename from tests/suite/test_complex_stdlib.py rename to tests/suite/stdlib/test_complex.py diff --git a/tests/suite/test_datetime_stdlib.py b/tests/suite/stdlib/test_datetime.py similarity index 100% rename from tests/suite/test_datetime_stdlib.py rename to tests/suite/stdlib/test_datetime.py diff --git a/tests/suite/test_descr_stdlib.py b/tests/suite/stdlib/test_descr.py similarity index 100% rename from tests/suite/test_descr_stdlib.py rename to tests/suite/stdlib/test_descr.py diff --git a/tests/suite/test_dict_stdlib.py b/tests/suite/stdlib/test_dict.py similarity index 100% rename from tests/suite/test_dict_stdlib.py rename to tests/suite/stdlib/test_dict.py diff --git a/tests/suite/test_fileinput_stdlib.py b/tests/suite/stdlib/test_fileinput.py similarity index 100% rename from tests/suite/test_fileinput_stdlib.py rename to tests/suite/stdlib/test_fileinput.py diff --git a/tests/suite/test_float_stdlib.py b/tests/suite/stdlib/test_float.py similarity index 100% rename from tests/suite/test_float_stdlib.py rename to tests/suite/stdlib/test_float.py diff --git a/tests/suite/test_functools_stdlib.py b/tests/suite/stdlib/test_functools.py similarity index 100% rename from tests/suite/test_functools_stdlib.py rename to tests/suite/stdlib/test_functools.py diff --git a/tests/suite/test_grammar_stdlib.py b/tests/suite/stdlib/test_grammar.py similarity index 100% rename from tests/suite/test_grammar_stdlib.py rename to tests/suite/stdlib/test_grammar.py diff --git a/tests/suite/test_heapq_stdlib.py b/tests/suite/stdlib/test_heapq.py similarity index 100% rename from tests/suite/test_heapq_stdlib.py rename to tests/suite/stdlib/test_heapq.py diff --git a/tests/suite/test_httplib_stdlib.py b/tests/suite/stdlib/test_httplib.py similarity index 100% rename from tests/suite/test_httplib_stdlib.py rename to tests/suite/stdlib/test_httplib.py diff --git a/tests/suite/test_io_stdlib.py b/tests/suite/stdlib/test_io.py similarity index 100% rename from tests/suite/test_io_stdlib.py rename to tests/suite/stdlib/test_io.py diff --git a/tests/suite/test_itertools_stdlib.py b/tests/suite/stdlib/test_itertools.py similarity index 100% rename from tests/suite/test_itertools_stdlib.py rename to tests/suite/stdlib/test_itertools.py diff --git a/tests/suite/test_linecache_stdlib.py b/tests/suite/stdlib/test_linecache.py similarity index 100% rename from tests/suite/test_linecache_stdlib.py rename to tests/suite/stdlib/test_linecache.py diff --git a/tests/suite/test_long_stdlib.py b/tests/suite/stdlib/test_long.py similarity index 100% rename from tests/suite/test_long_stdlib.py rename to tests/suite/stdlib/test_long.py diff --git a/tests/suite/test_memoryio_stdlib.py b/tests/suite/stdlib/test_memoryio.py similarity index 100% rename from tests/suite/test_memoryio_stdlib.py rename to tests/suite/stdlib/test_memoryio.py diff --git a/tests/suite/test_minidom_stdlib.py b/tests/suite/stdlib/test_minidom.py similarity index 100% rename from tests/suite/test_minidom_stdlib.py rename to tests/suite/stdlib/test_minidom.py diff --git a/tests/suite/test_opcodes_stdlib.py b/tests/suite/stdlib/test_opcodes.py similarity index 100% rename from tests/suite/test_opcodes_stdlib.py rename to tests/suite/stdlib/test_opcodes.py diff --git a/tests/suite/test_ordered_dict_stdlib.py b/tests/suite/stdlib/test_ordered_dict.py similarity index 100% rename from tests/suite/test_ordered_dict_stdlib.py rename to tests/suite/stdlib/test_ordered_dict.py diff --git a/tests/suite/test_plistlib_stdlib.py b/tests/suite/stdlib/test_plistlib.py similarity index 100% rename from tests/suite/test_plistlib_stdlib.py rename to tests/suite/stdlib/test_plistlib.py diff --git a/tests/suite/test_print_stdlib.py b/tests/suite/stdlib/test_print.py similarity index 100% rename from tests/suite/test_print_stdlib.py rename to tests/suite/stdlib/test_print.py diff --git a/tests/suite/test_re_stdlib.py b/tests/suite/stdlib/test_re.py similarity index 100% rename from tests/suite/test_re_stdlib.py rename to tests/suite/stdlib/test_re.py diff --git a/tests/suite/test_regrtest_stdlib.py b/tests/suite/stdlib/test_regrtest.py similarity index 100% rename from tests/suite/test_regrtest_stdlib.py rename to tests/suite/stdlib/test_regrtest.py diff --git a/tests/suite/modules/system_related/test_resource_stdlib.py b/tests/suite/stdlib/test_resource.py similarity index 100% rename from tests/suite/modules/system_related/test_resource_stdlib.py rename to tests/suite/stdlib/test_resource.py diff --git a/tests/suite/test_sax_stdlib.py b/tests/suite/stdlib/test_sax.py similarity index 100% rename from tests/suite/test_sax_stdlib.py rename to tests/suite/stdlib/test_sax.py diff --git a/tests/suite/test_scope_stdlib.py b/tests/suite/stdlib/test_scope.py similarity index 100% rename from tests/suite/test_scope_stdlib.py rename to tests/suite/stdlib/test_scope.py diff --git a/tests/suite/test_set_stdlib.py b/tests/suite/stdlib/test_set.py similarity index 100% rename from tests/suite/test_set_stdlib.py rename to tests/suite/stdlib/test_set.py diff --git a/tests/suite/test_socket_stdlib.py b/tests/suite/stdlib/test_socket.py similarity index 100% rename from tests/suite/test_socket_stdlib.py rename to tests/suite/stdlib/test_socket.py diff --git a/tests/suite/test_sqlite3_stdlib.py b/tests/suite/stdlib/test_sqlite.py similarity index 100% rename from tests/suite/test_sqlite3_stdlib.py rename to tests/suite/stdlib/test_sqlite.py diff --git a/tests/suite/test_ssl_stdlib.py b/tests/suite/stdlib/test_ssl.py similarity index 100% rename from tests/suite/test_ssl_stdlib.py rename to tests/suite/stdlib/test_ssl.py diff --git a/tests/suite/test_string_literals_stdlib.py b/tests/suite/stdlib/test_string_literals.py similarity index 100% rename from tests/suite/test_string_literals_stdlib.py rename to tests/suite/stdlib/test_string_literals.py diff --git a/tests/suite/test_strptime_stdlib.py b/tests/suite/stdlib/test_strptime.py similarity index 100% rename from tests/suite/test_strptime_stdlib.py rename to tests/suite/stdlib/test_strptime.py diff --git a/tests/suite/test_struct_stdlib.py b/tests/suite/stdlib/test_struct.py similarity index 100% rename from tests/suite/test_struct_stdlib.py rename to tests/suite/stdlib/test_struct.py diff --git a/tests/suite/test_super_stdlib.py b/tests/suite/stdlib/test_super.py similarity index 100% rename from tests/suite/test_super_stdlib.py rename to tests/suite/stdlib/test_super.py diff --git a/tests/suite/test_support_stdlib.py b/tests/suite/stdlib/test_support.py similarity index 100% rename from tests/suite/test_support_stdlib.py rename to tests/suite/stdlib/test_support.py diff --git a/tests/suite/test_sys_stdlib.py b/tests/suite/stdlib/test_sys.py similarity index 100% rename from tests/suite/test_sys_stdlib.py rename to tests/suite/stdlib/test_sys.py diff --git a/tests/suite/test_threading_stdlib.py b/tests/suite/stdlib/test_threading.py similarity index 100% rename from tests/suite/test_threading_stdlib.py rename to tests/suite/stdlib/test_threading.py diff --git a/tests/suite/test_time_stdlib.py b/tests/suite/stdlib/test_time.py similarity index 100% rename from tests/suite/test_time_stdlib.py rename to tests/suite/stdlib/test_time.py diff --git a/tests/suite/test_types_stdlib.py b/tests/suite/stdlib/test_types.py similarity index 100% rename from tests/suite/test_types_stdlib.py rename to tests/suite/stdlib/test_types.py diff --git a/tests/suite/test_typing_stdlib.py b/tests/suite/stdlib/test_typing.py similarity index 100% rename from tests/suite/test_typing_stdlib.py rename to tests/suite/stdlib/test_typing.py diff --git a/tests/suite/test_unicode_stdlib.py b/tests/suite/stdlib/test_unicode.py similarity index 100% rename from tests/suite/test_unicode_stdlib.py rename to tests/suite/stdlib/test_unicode.py diff --git a/tests/suite/test_userlist_stdlib.py b/tests/suite/stdlib/test_userlist.py similarity index 100% rename from tests/suite/test_userlist_stdlib.py rename to tests/suite/stdlib/test_userlist.py diff --git a/tests/suite/test_utf8_mode_stdlib.py b/tests/suite/stdlib/test_utf8_mode.py similarity index 100% rename from tests/suite/test_utf8_mode_stdlib.py rename to tests/suite/stdlib/test_utf8_mode.py diff --git a/tests/suite/test_weakset_stdlib.py b/tests/suite/stdlib/test_weakset.py similarity index 100% rename from tests/suite/test_weakset_stdlib.py rename to tests/suite/stdlib/test_weakset.py diff --git a/tests/suite/test_yield_from_stdlib.py b/tests/suite/stdlib/test_yield_from.py similarity index 86% rename from tests/suite/test_yield_from_stdlib.py rename to tests/suite/stdlib/test_yield_from.py index 37138adaf..ade9c8625 100644 --- a/tests/suite/test_yield_from_stdlib.py +++ b/tests/suite/stdlib/test_yield_from.py @@ -3,17 +3,15 @@ # See the LICENSE file in the project root for more information. ## -## Run selected tests from test_pep380 from StdLib +## Run selected tests from test_yield_from from StdLib ## import sys from iptest import is_ironpython, generate_suite, run_test -if sys.version_info >= (3, 6): +if is_ironpython or sys.version_info >= (3, 6): import test.test_yield_from as test_yield_from -else: - import test.test_pep380 as test_yield_from def load_tests(loader, standard_tests, pattern): tests = loader.loadTestsFromModule(test_yield_from, pattern=pattern)