From ac3edeeefda076d9ee886b5d548d373a8c83529e Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Mon, 25 May 2026 11:41:13 +0200 Subject: [PATCH 1/6] [tests] Update NUnit packages to latest stable versions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Update the following package versions: - NUnit: 4.4.0 → 4.6.1 - NUnit3TestAdapter: 6.1.0 → 6.2.0 - NUnitAnalyzers: 4.7.0 → 4.13.0 - NUnitXmlTestLogger: 3.1.15 → 8.0.0 - NUnitLite: 3.12.0 → 4.6.1 - NUnitV2ResultWriter: 3.6.0 → 3.8.0 Also remove the tools/nunit3-console* scripts, they're no longer needed. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- Directory.Build.props | 12 ++++++------ tools/nunit3-console-3.10.0 | 10 ---------- tools/nunit3-console-3.11.1 | 10 ---------- tools/nunit3-console-3.12.0 | 10 ---------- tools/nunit3-console-3.9.0 | 10 ---------- 5 files changed, 6 insertions(+), 46 deletions(-) delete mode 100755 tools/nunit3-console-3.10.0 delete mode 100755 tools/nunit3-console-3.11.1 delete mode 100755 tools/nunit3-console-3.12.0 delete mode 100755 tools/nunit3-console-3.9.0 diff --git a/Directory.Build.props b/Directory.Build.props index f054d696a5d3..ac90e9e40ed2 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -8,7 +8,7 @@ $(MicrosoftBuildPackageVersion) $(MicrosoftBuildPackageVersion) 3.22.0 - 3.1.15 + 8.0.0 4.7.2 @@ -19,11 +19,11 @@ 21.1.8 18.0.1 0.11.6 - 6.1.0 - 4.7.0 - 4.4.0 - 3.12.0 - 3.6.0 + 6.2.0 + 4.13.0 + 4.6.1 + $(NUnitPackageVersion) + 3.8.0 latest diff --git a/tools/nunit3-console-3.10.0 b/tools/nunit3-console-3.10.0 deleted file mode 100755 index 8ddf8c438192..000000000000 --- a/tools/nunit3-console-3.10.0 +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash -eu - -# This makes it so that stack traces have source code location -if test -z "${MONO_ENV_OPTIONS:-}"; then - export MONO_ENV_OPTIONS=--debug -fi - -TOP="$(cd "$(dirname "$0")/.." && pwd)" - -exec mono --debug "$TOP"/packages/nunit.consolerunner/3.10.0/tools/nunit3-console.exe "$@" diff --git a/tools/nunit3-console-3.11.1 b/tools/nunit3-console-3.11.1 deleted file mode 100755 index 9c9a4238b79c..000000000000 --- a/tools/nunit3-console-3.11.1 +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash -eu - -# This makes it so that stack traces have source code location -if test -z "${MONO_ENV_OPTIONS:-}"; then - export MONO_ENV_OPTIONS=--debug -fi - -TOP="$(cd "$(dirname "$0")/.." && pwd)" - -exec mono --debug "$TOP"/packages/nunit.consolerunner/3.11.1/tools/nunit3-console.exe "$@" diff --git a/tools/nunit3-console-3.12.0 b/tools/nunit3-console-3.12.0 deleted file mode 100755 index 70cee8a5e84f..000000000000 --- a/tools/nunit3-console-3.12.0 +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash -eu - -# This makes it so that stack traces have source code location -if test -z "${MONO_ENV_OPTIONS:-}"; then - export MONO_ENV_OPTIONS=--debug -fi - -TOP="$(cd "$(dirname "$0")/.." && pwd)" - -exec mono --debug "$TOP"/packages/nunit.consolerunner/3.12.0/tools/nunit3-console.exe "$@" diff --git a/tools/nunit3-console-3.9.0 b/tools/nunit3-console-3.9.0 deleted file mode 100755 index 627c4900965a..000000000000 --- a/tools/nunit3-console-3.9.0 +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash -eu - -# This makes it so that stack traces have source code location -if test -z "${MONO_ENV_OPTIONS:-}"; then - export MONO_ENV_OPTIONS=--debug -fi - -TOP="$(cd "$(dirname "$0")/.." && pwd)" - -exec mono --debug "$TOP"/packages/nunit.consolerunner/3.9.0/tools/nunit3-console.exe "$@" From bbeaa3f080d99a3fa3d29e4429350251f2e8c892 Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Mon, 25 May 2026 18:45:29 +0200 Subject: [PATCH 2/6] [tests] Fix test failures from NUnit 4.6.1 version bump - Add nunit.framework.legacy.dll to BundleStructureTest expected files (NUnit 4.6.1 ships this assembly alongside nunit.framework.dll) - Add trimmer/ILC warning suppression for nunit.framework.legacy - Add --dlsym for nunit.framework.legacy.dll in nunit.framework.targets - Remove [Timeout] attributes no longer supported by NUnitLite 4.x (ObjectTest.InvokeTest and SecSharedCredentialTest methods) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- tests/common/shared-dotnet.csproj | 4 ++++ tests/dotnet/UnitTests/BundleStructureTest.cs | 1 + tests/monotouch-test/Foundation/ObjectTest.cs | 1 - tests/monotouch-test/Security/SecSharedCredentialTest.cs | 8 -------- tests/nunit.framework.targets | 2 +- 5 files changed, 6 insertions(+), 10 deletions(-) diff --git a/tests/common/shared-dotnet.csproj b/tests/common/shared-dotnet.csproj index 8c3e83197315..2793bc0b1866 100644 --- a/tests/common/shared-dotnet.csproj +++ b/tests/common/shared-dotnet.csproj @@ -101,8 +101,12 @@ true + + true + + diff --git a/tests/dotnet/UnitTests/BundleStructureTest.cs b/tests/dotnet/UnitTests/BundleStructureTest.cs index f01bbb58fd5f..20d21a660f7d 100644 --- a/tests/dotnet/UnitTests/BundleStructureTest.cs +++ b/tests/dotnet/UnitTests/BundleStructureTest.cs @@ -311,6 +311,7 @@ internal static void CheckAppBundleContents (ApplePlatform platform, IEnumerable if (platform != ApplePlatform.MacOSX) AddMultiRidAssembly (platform, expectedFiles, assemblyDirectory, "MonoTouch.Dialog", runtimeIdentifiers, forceSingleRid: (platform == ApplePlatform.MacCatalyst && !isReleaseBuild), includeDebugFiles: includeDebugFiles); expectedFiles.Add (Path.Combine (assemblyDirectory, "nunit.framework.dll")); + expectedFiles.Add (Path.Combine (assemblyDirectory, "nunit.framework.legacy.dll")); expectedFiles.Add (Path.Combine (assemblyDirectory, "nunitlite.dll")); expectedFiles.Add (Path.Combine (assemblyDirectory, "Mono.Options.dll")); AddMultiRidAssembly (platform, expectedFiles, assemblyDirectory, "Touch.Client", runtimeIdentifiers, platform == ApplePlatform.MacOSX || (platform == ApplePlatform.MacCatalyst && !isReleaseBuild), includeDebugFiles: includeDebugFiles); diff --git a/tests/monotouch-test/Foundation/ObjectTest.cs b/tests/monotouch-test/Foundation/ObjectTest.cs index 31060e58eed3..61a613419cb6 100644 --- a/tests/monotouch-test/Foundation/ObjectTest.cs +++ b/tests/monotouch-test/Foundation/ObjectTest.cs @@ -270,7 +270,6 @@ public void ObserverTest () } [Test] - [Timeout (5000)] public void InvokeTest () { var evt = new ManualResetEvent (false); diff --git a/tests/monotouch-test/Security/SecSharedCredentialTest.cs b/tests/monotouch-test/Security/SecSharedCredentialTest.cs index 0136f253edf0..11e0667623eb 100644 --- a/tests/monotouch-test/Security/SecSharedCredentialTest.cs +++ b/tests/monotouch-test/Security/SecSharedCredentialTest.cs @@ -44,9 +44,7 @@ public void AddSharedWebCredentialNullAccount () } [Test] - // We do not want to block for a long period of time if the event is not set. // We are testing the fact that the trampoline works. - [Timeout (5000)] public void AddSharedWebCredentialNotNullPassword () { Action handler = (NSError e) => { @@ -56,9 +54,7 @@ public void AddSharedWebCredentialNotNullPassword () } [Test] - // We do not want to block for a long period of time if the event is not set. // We are testing the fact that the trampoline works. - [Timeout (5000)] public void AddSharedWebCredentialNullPassword () { password = null; @@ -69,9 +65,7 @@ public void AddSharedWebCredentialNullPassword () } [Test] - // We do not want to block for a long period of time if the event is not set. // We are testing the fact that the trampoline works. - [Timeout (5000)] public void RequestSharedWebCredentialTest () { Action handler = (SecSharedCredentialInfo [] creds, NSError e) => { @@ -81,9 +75,7 @@ public void RequestSharedWebCredentialTest () } [Test] - // We do not want to block for a long period of time if the event is not set. // We are testing the fact that the trampoline works. - [Timeout (5000)] public void RequestSharedWebCredentialNullDomainAndAccountTest () { Action handler = (SecSharedCredentialInfo [] creds, NSError e) => { diff --git a/tests/nunit.framework.targets b/tests/nunit.framework.targets index bfb7b169a8b4..4cd86d4018b2 100644 --- a/tests/nunit.framework.targets +++ b/tests/nunit.framework.targets @@ -4,6 +4,6 @@ $(MSBuildThisFileDirectory)nunit.framework.xml --xml=$(XmlLinkerFile) $(AppBundleExtraOptions) - --dlsym:+nunit.framework.dll $(AppBundleExtraOptions) + --dlsym:+nunit.framework.dll --dlsym:+nunit.framework.legacy.dll $(AppBundleExtraOptions) From 26593c5f8f056fa2da06fdef997d372948430ac8 Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Wed, 27 May 2026 10:36:25 +0200 Subject: [PATCH 3/6] [tests] Preserve reflection metadata for NativeAOT to fix NUnit GetInterfaceMap NUnit 4.x's EquatablesComparer calls Type.GetInterfaceMap() which throws NotSupportedException on NativeAOT when reflection metadata is trimmed. Set IlcTrimMetadata=false and IlcGenerateCompleteTypeMetadata=true for NativeAOT test builds so that interface mapping metadata is preserved. This fixes ~120 test failures in the NativeAOT test variation caused by Assert.That(x, Is.EqualTo(y)) where x implements IEquatable. See https://github.com/nunit/nunit/issues/3970 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- tests/common/shared-dotnet.csproj | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/common/shared-dotnet.csproj b/tests/common/shared-dotnet.csproj index 2793bc0b1866..27ee7da59ae3 100644 --- a/tests/common/shared-dotnet.csproj +++ b/tests/common/shared-dotnet.csproj @@ -80,6 +80,11 @@ $(DefineConstants);NATIVEAOT false + + true + false @@ -130,6 +135,11 @@ $(DefineConstants);NATIVEAOT false + + true + false