Skip to content

Commit

Permalink
Merge pull request #4302 from nunit/backport-4170
Browse files Browse the repository at this point in the history
Backport PR#4224 onto v3.13.x (Add .NET7 as a build target for the test suite)
  • Loading branch information
stevenaw committed Mar 23, 2023
2 parents 5181f6a + 44a66b0 commit a1fef50
Show file tree
Hide file tree
Showing 9 changed files with 41 additions and 7 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/continuous_integration.yml
Expand Up @@ -36,6 +36,11 @@ jobs:
with:
dotnet-version: '6.0.x'

- name: 🛠️ Setup .NET Core SDK 7.0.x
uses: actions/setup-dotnet@v3
with:
dotnet-version: '7.0.x'

- name: 🛠️ Install dotnet tools
run: dotnet tool restore

Expand Down Expand Up @@ -82,6 +87,11 @@ jobs:
with:
dotnet-version: '6.0.x'

- name: 🛠️ Setup .NET Core SDK 7.0.x
uses: actions/setup-dotnet@v3
with:
dotnet-version: '7.0.x'

- name: 🛠️ Install F#
run: sudo apt-get install fsharp

Expand Down Expand Up @@ -122,6 +132,11 @@ jobs:
with:
dotnet-version: '6.0.x'

- name: 🛠️ Setup .NET Core SDK 7.0.x
uses: actions/setup-dotnet@v3
with:
dotnet-version: '7.0.x'

- name: 🛠️ Install dotnet tools
run: dotnet tool restore

Expand Down
3 changes: 2 additions & 1 deletion build.cake
Expand Up @@ -41,7 +41,8 @@ var NetCoreTests = new String[]
{
"netcoreapp3.1",
"net5.0",
"net6.0"
"net6.0",
"net7.0"
};

//////////////////////////////////////////////////////////////////////
Expand Down
2 changes: 1 addition & 1 deletion global.json
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "6.0.100",
"version": "7.0.100",
"allowPrerelease": false,
"rollForward": "major"
}
Expand Down
5 changes: 5 additions & 0 deletions nuget/nunitlite/nunitlite.nuspec
Expand Up @@ -52,6 +52,9 @@ How to use this package:
<group targetFramework="net6.0">
<dependency id="NUnit" version="[$version$]" />
</group>
<group targetFramework="net7.0">
<dependency id="NUnit" version="[$version$]" />
</group>
</dependencies>
</metadata>
<files>
Expand Down Expand Up @@ -79,6 +82,8 @@ How to use this package:
<file src="bin/net5.0/nunitlite.pdb" target="lib\net5.0" />
<file src="bin/net6.0/nunitlite.dll" target="lib\net6.0" />
<file src="bin/net6.0/nunitlite.pdb" target="lib\net6.0" />
<file src="bin/net7.0/nunitlite.dll" target="lib\net7.0" />
<file src="bin/net7.0/nunitlite.pdb" target="lib\net7.0" />
<file src="../../nuget/nunitlite/Program.cs" target="content" />
<file src="../../nuget/nunitlite/Program.vb" target="content" />
<file src="../../nuget/nunitlite/install.ps1" target="tools" />
Expand Down
4 changes: 4 additions & 0 deletions src/CommonAssemblyInfo.cs
Expand Up @@ -48,6 +48,8 @@
[assembly: AssemblyConfiguration(".NET 5.0 Debug")]
#elif NET6_0
[assembly: AssemblyConfiguration(".NET 6.0 Debug")]
#elif NET7_0
[assembly: AssemblyConfiguration(".NET 7.0 Debug")]
#else
#error Missing AssemblyConfiguration attribute for this target.
#endif
Expand All @@ -68,6 +70,8 @@
[assembly: AssemblyConfiguration(".NET 5.0")]
#elif NET6_0
[assembly: AssemblyConfiguration(".NET 6.0")]
#elif NET7_0
[assembly: AssemblyConfiguration(".NET 7.0")]
#else
#error Missing AssemblyConfiguration attribute for this target.
#endif
Expand Down
2 changes: 1 addition & 1 deletion src/NUnitFramework/Directory.Build.props
Expand Up @@ -8,7 +8,7 @@
<DisableImplicitNuGetFallbackFolder>true</DisableImplicitNuGetFallbackFolder>
<NUnitLibraryFrameworks>net35;net40;net45;netstandard2.0</NUnitLibraryFrameworks>
<OlderNUnitRuntimeFrameworks>net35;net40</OlderNUnitRuntimeFrameworks>
<NewerNUnitRuntimeFrameworks>net45;netcoreapp3.1;net5.0;net6.0</NewerNUnitRuntimeFrameworks>
<NewerNUnitRuntimeFrameworks>net45;netcoreapp3.1;net5.0;net6.0;net7.0</NewerNUnitRuntimeFrameworks>
<NUnitRuntimeFrameworks>$(OlderNUnitRuntimeFrameworks);$(NewerNunitRuntimeFrameworks)</NUnitRuntimeFrameworks>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<OutputPath>..\..\..\bin\$(Configuration)\</OutputPath>
Expand Down
8 changes: 6 additions & 2 deletions src/NUnitFramework/nunitlite.tests/TextUIReportTests.cs
Expand Up @@ -164,11 +164,15 @@ private IList<string> GetReportLines()
string line;
var lines = new List<string>();
while ((line = rdr.ReadLine()) != null)
lines.Add(line);
{
if ( !line.Contains("InvokeStub_") )
{
lines.Add(line);
}
}

return lines;
}

#endregion
}
}
5 changes: 5 additions & 0 deletions src/NUnitFramework/tests/Assertions/WarningTests.cs
Expand Up @@ -266,7 +266,12 @@ private static async Task<int> ThrowExceptionGenericTask()
[TestCase(nameof(WarningFixture.WarningSynchronous), 1)]
[TestCase(nameof(WarningFixture.WarningInThreadStart), 2)]
[TestCase(nameof(WarningFixture.WarningInBeginInvoke), 5, ExcludePlatform = "mono", Reason = "Warning has no effect inside BeginInvoke on Mono")]
#if NET7_0_OR_GREATER
[TestCase(nameof(WarningFixture.WarningInThreadPoolQueueUserWorkItem), 4, ExcludePlatform = "MacOSX")]
[TestCase(nameof(WarningFixture.WarningInThreadPoolQueueUserWorkItem), 5, IncludePlatform = "MacOSX")]
#else
[TestCase(nameof(WarningFixture.WarningInThreadPoolQueueUserWorkItem), 2)]
#endif
#if TASK_PARALLEL_LIBRARY_API
[TestCase(nameof(WarningFixture.WarningInTaskRun), 4)]
[TestCase(nameof(WarningFixture.WarningAfterAwaitTaskDelay), 5)]
Expand Down
Expand Up @@ -371,7 +371,7 @@ public void LargeStringCollectionsInSameOrder()
}

[Test(Description = "Issue #2799 - CollectionAssert.AreEquivalent is extremely slow")]
[Timeout(LARGE_COLLECTION_FAIL_TIME)]
[Timeout(LARGE_COLLECTION_FAIL_TIME * 2)]
public void LargeStringCollectionsInReversedOrder()
{
var actual = Enumerable.Range(0, SIZE).Select(i => i.ToString()).ToList();
Expand All @@ -389,7 +389,7 @@ public void LargeStringCollectionsInReversedOrder()
}

[Test(Description = "Issue #2799 - CollectionAssert.AreEquivalent is extremely slow")]
[Timeout(LARGE_COLLECTION_FAIL_TIME)]
[Timeout(LARGE_COLLECTION_FAIL_TIME * 2)]
public void LargeStringCollection()
{
var actual = new StringCollection();
Expand Down

0 comments on commit a1fef50

Please sign in to comment.