diff --git a/build.cake b/build.cake index e5c9b676d..96350d17b 100644 --- a/build.cake +++ b/build.cake @@ -101,46 +101,32 @@ public void BuildSolution() { MSBuild(SOLUTION_FILE, CreateMSBuildSettings("Build").WithRestore()); - // Publishing to ensure that all references are present. Some of these - // may not be needed and are marked with a TODO comment. + // Publishing in place where needed to ensure that all references are present. - DisplayBanner("Publishing ENGINE Project"); - foreach (var framework in new[] { "netstandard2.0", "netcoreapp3.1" }) - MSBuild(ENGINE_PROJECT, CreateMSBuildSettings("Publish") - .WithProperty("TargetFramework", framework) - .WithProperty("PublishDir", BIN_DIR + framework)); + // TODO: May not be needed + DisplayBanner("Publishing ENGINE API Project for NETSTANDARD_2.0"); + MSBuild(ENGINE_API_PROJECT, CreateMSBuildSettings("Publish") + .WithProperty("TargetFramework", "netstandard2.0") + .WithProperty("PublishDir", BIN_DIR + "netstandard2.0")); + + DisplayBanner("Publishing ENGINE Project for NETSTANDARD2.0"); + MSBuild(ENGINE_PROJECT, CreateMSBuildSettings("Publish") + .WithProperty("TargetFramework", "netstandard2.0") + .WithProperty("PublishDir", BIN_DIR + "netstandard2.0")); + + DisplayBanner("Publishing ENGINE TESTS Project for NETCOREAPP2.1"); + MSBuild(ENGINE_TESTS_PROJECT, CreateMSBuildSettings("Publish") + .WithProperty("TargetFramework", "netcoreapp2.1") + .WithProperty("PublishDir", BIN_DIR + "netcoreapp2.1")); // TODO: May not be needed - DisplayBanner("Publishing AGENT Project"); foreach (var framework in new[] { "netcoreapp3.1", "net5.0" }) + { + DisplayBanner($"Publishing AGENT Project for {framework.ToUpper()}"); MSBuild(AGENT_PROJECT, CreateMSBuildSettings("Publish") .WithProperty("TargetFramework", framework) .WithProperty("PublishDir", BIN_DIR + "agents/" + framework)); - - // TODO: May not be needed - DisplayBanner("Publishing ENGINE API Project"); - foreach (var framework in new[] { "netstandard2.0" }) - MSBuild(ENGINE_API_PROJECT, CreateMSBuildSettings("Publish") - .WithProperty("TargetFramework", framework) - .WithProperty("PublishDir", BIN_DIR + framework)); - - DisplayBanner("Publishing ENGINE TESTS Project"); - foreach (var framework in new[] { "netcoreapp2.1", "netcoreapp3.1" }) - MSBuild(ENGINE_TESTS_PROJECT, CreateMSBuildSettings("Publish") - .WithProperty("TargetFramework", framework) - .WithProperty("PublishDir", BIN_DIR + framework)); - - // TODO: May not be needed - DisplayBanner("Publishing NETCORE CONSOLE RUNNER Project"); - MSBuild(CONSOLE_PROJECT, CreateMSBuildSettings("Publish") - .WithProperty("TargetFramework", "netcoreapp3.1") - .WithProperty("PublishDir", BIN_DIR + "netcoreapp3.1")); - - // TODO: May not be needed - DisplayBanner("Publishing NETCORE CONSOLE TESTS Project"); - MSBuild(CONSOLE_TESTS_PROJECT, CreateMSBuildSettings("Publish") - .WithProperty("TargetFramework", "netcoreapp3.1") - .WithProperty("PublishDir", BIN_DIR + "netcoreapp3.1")); + } } private void BuildEachProjectSeparately() @@ -152,9 +138,9 @@ private void BuildEachProjectSeparately() BuildProject(AGENT_PROJECT); BuildProject(AGENT_X86_PROJECT); - BuildProject(ENGINE_TESTS_PROJECT, "net35", "netcoreapp2.1", "netcoreapp3.1"); + BuildProject(ENGINE_TESTS_PROJECT, "net35", "netcoreapp2.1"); BuildProject(ENGINE_CORE_TESTS_PROJECT, "net35", "netcoreapp2.1", "netcoreapp3.1", "net5.0", "net6.0"); - BuildProject(CONSOLE_TESTS_PROJECT, "net35", "netcoreapp3.1"); + BuildProject(CONSOLE_TESTS_PROJECT, "net35", "net6.0"); BuildProject(MOCK_ASSEMBLY_X86_PROJECT, "net35", "net40", "netcoreapp2.1", "netcoreapp3.1"); BuildProject(NOTEST_PROJECT, "net35", "netcoreapp2.1", "netcoreapp3.1"); @@ -319,19 +305,6 @@ Task("TestNetStandard20Engine") RunDotnetNUnitLiteTests(NETCORE_ENGINE_TESTS, "netcoreapp2.1"); }); -////////////////////////////////////////////////////////////////////// -// TEST NETCORE 3.1 ENGINE -////////////////////////////////////////////////////////////////////// - -Task("TestNetCore31Engine") - .Description("Tests the .NET Core 3.1 Engine") - .IsDependentOn("Build") - .OnError(exception => { UnreportedErrors.Add(exception.Message); }) - .Does(() => - { - RunDotnetNUnitLiteTests(NETCORE_ENGINE_TESTS, "netcoreapp3.1"); - }); - ////////////////////////////////////////////////////////////////////// // TEST .NET 2.0 CONSOLE ////////////////////////////////////////////////////////////////////// @@ -346,16 +319,16 @@ Task("TestNet20Console") }); ////////////////////////////////////////////////////////////////////// -// TEST .NET CORE 3.1 CONSOLE +// TEST .NET 6.0 CONSOLE ////////////////////////////////////////////////////////////////////// -Task("TestNetCore31Console") - .Description("Tests the .NET Core 3.1 console runner") +Task("TestNet60Console") + .Description("Tests the .NET 6.0 console runner") .IsDependentOn("Build") .OnError(exception => { UnreportedErrors.Add(exception.Message); }) .Does(() => { - RunNetCoreConsole(CONSOLE_TESTS, "netcoreapp3.1"); + RunNetCoreConsole(CONSOLE_TESTS, "net6.0"); }); ////////////////////////////////////////////////////////////////////// @@ -753,7 +726,7 @@ Task("CreateProductionRelease") Task("TestConsole") .Description("Builds and tests the console runner") .IsDependentOn("TestNet20Console") - .IsDependentOn("TestNetCore31Console"); + .IsDependentOn("TestNet60Console"); Task("TestEngineCore") .Description("Builds and tests the engine core assembly") @@ -766,8 +739,7 @@ Task("TestEngineCore") Task("TestEngine") .Description("Builds and tests the engine assembly") .IsDependentOn("TestNet20Engine") - .IsDependentOn("TestNetStandard20Engine") - .IsDependentOn("TestNetCore31Engine"); + .IsDependentOn("TestNetStandard20Engine"); Task("Test") .Description("Builds and tests the engine and console runner") diff --git a/cake/constants.cake b/cake/constants.cake index a3948308f..4c3b713bc 100644 --- a/cake/constants.cake +++ b/cake/constants.cake @@ -38,7 +38,7 @@ var MOCK_ASSEMBLY_X86_PROJECT = SOURCE_DIR + "NUnitEngine/mock-assembly-x86/mock var NOTEST_PROJECT = SOURCE_DIR + "NUnitEngine/notest-assembly/notest-assembly.csproj"; // Console Runner var NET20_CONSOLE = BIN_DIR + "net20/nunit3-console.exe"; -var NETCORE31_CONSOLE = BIN_DIR + "netcoreapp3.1/nunit3-console.dll"; +var NET60_CONSOLE = BIN_DIR + "net6.0/nunit3-console.dll"; // Unit Tests var NETFX_ENGINE_CORE_TESTS = "nunit.engine.core.tests.exe"; var NETCORE_ENGINE_CORE_TESTS = "nunit.engine.core.tests.dll"; diff --git a/cake/package-checks.cake b/cake/package-checks.cake index e8eeb2deb..6c19f51b9 100644 --- a/cake/package-checks.cake +++ b/cake/package-checks.cake @@ -6,6 +6,10 @@ string[] ENGINE_FILES = { "nunit.engine.dll", "nunit.engine.core.dll", "nunit.engine.api.dll", "testcentric.engine.metadata.dll" }; string[] ENGINE_PDB_FILES = { "nunit.engine.pdb", "nunit.engine.core.pdb", "nunit.engine.api.pdb"}; +string[] ENGINE_CORE_FILES = { + "nunit.engine.core.dll", "nunit.engine.api.dll", "testcentric.engine.metadata.dll" }; +string[] ENGINE_CORE_PDB_FILES = { + "nunit.engine.core.pdb", "nunit.engine.api.pdb"}; string[] AGENT_FILES = { "nunit-agent.exe", "nunit-agent.exe.config", "nunit-agent-x86.exe", "nunit-agent-x86.exe.config", diff --git a/cake/package-definitions.cake b/cake/package-definitions.cake index 25b34ad6f..93db0d309 100644 --- a/cake/package-definitions.cake +++ b/cake/package-definitions.cake @@ -4,7 +4,7 @@ PackageDefinition NUnitConsoleNuGetPackage; PackageDefinition NUnitConsoleRunnerNuGetPackage; -PackageDefinition NUnitConsoleRunnerNetCorePackage; +PackageDefinition NUnitConsoleRunnerNet60Package; PackageDefinition NUnitEnginePackage; PackageDefinition NUnitEngineApiPackage; PackageDefinition NUnitConsoleRunnerChocolateyPackage; @@ -28,6 +28,7 @@ public void InitializePackageDefinitions(ICakeContext context) NetCore31Test, Net50Test, Net60Test, + NetCore21PlusNetCore31Test, NetCore21PlusNetCore31PlusNet50PlusNet60Test, Net40PlusNet60Test }; @@ -43,7 +44,10 @@ public void InitializePackageDefinitions(ICakeContext context) { NetCore21Test, NetCore31Test, - NetCore21PlusNetCore31Test + Net50Test, + Net60Test, + NetCore21PlusNetCore31Test, + NetCore21PlusNetCore31PlusNet50PlusNet60Test }; AllPackages.AddRange(new PackageDefinition[] { @@ -80,16 +84,19 @@ public void InitializePackageDefinitions(ICakeContext context) executable: "tools/nunit3-console.exe", tests: StandardRunnerTests), - NUnitConsoleRunnerNetCorePackage = new NuGetPackage( + NUnitConsoleRunnerNet60Package = new NuGetPackage( context: context, id: "NUnit.ConsoleRunner.NetCore", version: ProductVersion, source: NUGET_DIR + "runners/nunit.console-runner.netcore.nuspec", checks: new PackageCheck[] { HasFiles("LICENSE.txt", "NOTICES.txt"), - HasDirectory("tools/netcoreapp3.1/any").WithFiles(CONSOLE_FILES_NETCORE).AndFiles(ENGINE_FILES).AndFile("nunit.console.nuget.addins") + HasDirectory("tools/net6.0/any").WithFiles(CONSOLE_FILES_NETCORE).AndFiles(ENGINE_FILES).AndFile("nunit.console.nuget.addins") + }, + symbols: new PackageCheck[] { + HasDirectory("tools/net6.0/any").WithFile("nunit3-console.pdb").AndFiles(ENGINE_PDB_FILES) }, - executable: "tools/netcoreapp3.1/any/nunit3-console.exe", + executable: "tools/net6.0/any/nunit3-console.exe", tests: NetCoreRunnerTests), NUnitConsoleRunnerChocolateyPackage = new ChocolateyPackage( @@ -132,7 +139,7 @@ public void InitializePackageDefinitions(ICakeContext context) HasDirectory("bin/net35").WithFiles(CONSOLE_FILES).AndFiles(ENGINE_FILES).AndFile("nunit3-console.pdb").AndFiles(ENGINE_PDB_FILES), HasDirectory("bin/netstandard2.0").WithFiles(ENGINE_FILES).AndFiles(ENGINE_PDB_FILES), HasDirectory("bin/netcoreapp2.1").WithFiles(ENGINE_FILES).AndFiles(ENGINE_PDB_FILES), - HasDirectory("bin/netcoreapp3.1").WithFiles(ENGINE_FILES).AndFiles(ENGINE_PDB_FILES), + HasDirectory("bin/netcoreapp3.1").WithFiles(ENGINE_CORE_FILES).AndFiles(ENGINE_CORE_PDB_FILES), //HasDirectory("bin/net5.0").WithFiles(ENGINE_FILES).AndFiles(ENGINE_PDB_FILES), HasDirectory("bin/agents/net20").WithFiles(AGENT_FILES).AndFiles(AGENT_PDB_FILES), HasDirectory("bin/agents/net40").WithFiles(AGENT_FILES).AndFiles(AGENT_PDB_FILES), @@ -153,17 +160,14 @@ public void InitializePackageDefinitions(ICakeContext context) HasFiles("LICENSE.txt", "NOTICES.txt"), HasDirectory("lib/net20").WithFiles(ENGINE_FILES), HasDirectory("lib/netstandard2.0").WithFiles(ENGINE_FILES), - HasDirectory("lib/netcoreapp3.1").WithFiles(ENGINE_FILES), HasDirectory("contentFiles/any/lib/net20").WithFile("nunit.engine.nuget.addins"), HasDirectory("contentFiles/any/lib/netstandard2.0").WithFile("nunit.engine.nuget.addins"), - HasDirectory("contentFiles/any/lib/netcoreapp3.1").WithFile("nunit.engine.nuget.addins"), HasDirectory("contentFiles/any/agents/net20").WithFiles(AGENT_FILES).AndFile("nunit.agent.addins"), HasDirectory("contentFiles/any/agents/net40").WithFiles(AGENT_FILES).AndFile("nunit.agent.addins") }, symbols: new PackageCheck[] { HasDirectory("lib/net20").WithFiles(ENGINE_PDB_FILES), HasDirectory("lib/netstandard2.0").WithFiles(ENGINE_PDB_FILES), - HasDirectory("lib/netcoreapp3.1").WithFiles(ENGINE_PDB_FILES), HasDirectory("contentFiles/any/agents/net20").WithFiles(AGENT_PDB_FILES), HasDirectory("contentFiles/any/agents/net40").WithFiles(AGENT_PDB_FILES) }), diff --git a/cake/utilities.cake b/cake/utilities.cake index 0db572774..803c04a3a 100644 --- a/cake/utilities.cake +++ b/cake/utilities.cake @@ -180,7 +180,7 @@ void RunNetCoreConsole(string testAssembly, string targetRuntime) "dotnet", new ProcessSettings { - Arguments = $"\"{NETCORE31_CONSOLE}\" \"{assemblyPath}\" --result:{resultPath}", + Arguments = $"\"{NET60_CONSOLE}\" \"{assemblyPath}\" --result:{resultPath}", WorkingDirectory = workingDir }); diff --git a/nuget/engine/nunit.engine.nuspec b/nuget/engine/nunit.engine.nuspec index 60c86602d..271016e96 100644 --- a/nuget/engine/nunit.engine.nuspec +++ b/nuget/engine/nunit.engine.nuspec @@ -92,15 +92,6 @@ - - - - - - - - - diff --git a/nuget/runners/nunit.console-runner.netcore.nuspec b/nuget/runners/nunit.console-runner.netcore.nuspec index 4a263d355..1540808f3 100644 --- a/nuget/runners/nunit.console-runner.netcore.nuspec +++ b/nuget/runners/nunit.console-runner.netcore.nuspec @@ -29,23 +29,22 @@ - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + diff --git a/src/NUnitConsole/nunit3-console.tests/nunit3-console.tests.csproj b/src/NUnitConsole/nunit3-console.tests/nunit3-console.tests.csproj index 040fdb806..3b33d3e17 100644 --- a/src/NUnitConsole/nunit3-console.tests/nunit3-console.tests.csproj +++ b/src/NUnitConsole/nunit3-console.tests/nunit3-console.tests.csproj @@ -2,7 +2,7 @@ NUnit.ConsoleRunner.Tests - net35;netcoreapp3.1 + net35;net6.0 1685 Full diff --git a/src/NUnitConsole/nunit3-console/OptionsUtils/Options.cs b/src/NUnitConsole/nunit3-console/OptionsUtils/Options.cs index 20b0fd1c6..1e5ded4e7 100644 --- a/src/NUnitConsole/nunit3-console/OptionsUtils/Options.cs +++ b/src/NUnitConsole/nunit3-console/OptionsUtils/Options.cs @@ -785,9 +785,6 @@ public string OptionName } #if !PCL -#pragma warning disable 618 // SecurityPermissionAttribute is obsolete - [SecurityPermission(SecurityAction.LinkDemand, SerializationFormatter = true)] -#pragma warning restore 618 public override void GetObjectData(SerializationInfo info, StreamingContext context) { base.GetObjectData(info, context); diff --git a/src/NUnitConsole/nunit3-console/nunit3-console.csproj b/src/NUnitConsole/nunit3-console/nunit3-console.csproj index 0fb6796be..657ed62a3 100644 --- a/src/NUnitConsole/nunit3-console/nunit3-console.csproj +++ b/src/NUnitConsole/nunit3-console/nunit3-console.csproj @@ -4,7 +4,7 @@ Exe NUnit.ConsoleRunner nunit3-console - net20;netcoreapp3.1 + net20;net6.0 Major diff --git a/src/NUnitEngine/nunit.engine.core.tests/Services/DriverServiceTests.cs b/src/NUnitEngine/nunit.engine.core.tests/Services/DriverServiceTests.cs index 18ed20bc1..cb76a3872 100644 --- a/src/NUnitEngine/nunit.engine.core.tests/Services/DriverServiceTests.cs +++ b/src/NUnitEngine/nunit.engine.core.tests/Services/DriverServiceTests.cs @@ -52,9 +52,9 @@ public void ServiceIsStarted() [TestCase("mock-assembly.pdb", true, typeof(InvalidAssemblyFrameworkDriver))] [TestCase("junk.dll", false, typeof(InvalidAssemblyFrameworkDriver))] [TestCase("junk.dll", true, typeof(InvalidAssemblyFrameworkDriver))] - [TestCase("nunit.engine.dll", false, typeof(InvalidAssemblyFrameworkDriver))] + [TestCase("nunit.engine.core.dll", false, typeof(InvalidAssemblyFrameworkDriver))] + [TestCase("nunit.engine.core.dll", true, typeof(SkippedAssemblyFrameworkDriver))] #if !NET5_0_OR_GREATER // Not yet working - [TestCase("nunit.engine.dll", true, typeof(SkippedAssemblyFrameworkDriver))] [TestCase("notest-assembly.dll", true, typeof(SkippedAssemblyFrameworkDriver))] #endif public void CorrectDriverIsUsed(string fileName, bool skipNonTestAssemblies, Type expectedType) diff --git a/src/NUnitEngine/nunit.engine.tests/nunit.engine.tests.csproj b/src/NUnitEngine/nunit.engine.tests/nunit.engine.tests.csproj index 32c7c20f9..e586bc682 100644 --- a/src/NUnitEngine/nunit.engine.tests/nunit.engine.tests.csproj +++ b/src/NUnitEngine/nunit.engine.tests/nunit.engine.tests.csproj @@ -2,7 +2,7 @@ NUnit.Engine.Tests - net35;netcoreapp2.1;netcoreapp3.1 + net35;netcoreapp2.1 Exe true ..\..\nunit.snk @@ -28,7 +28,7 @@ - + diff --git a/src/NUnitEngine/nunit.engine/nunit.engine.csproj b/src/NUnitEngine/nunit.engine/nunit.engine.csproj index 279782078..e05330dd6 100644 --- a/src/NUnitEngine/nunit.engine/nunit.engine.csproj +++ b/src/NUnitEngine/nunit.engine/nunit.engine.csproj @@ -2,7 +2,7 @@ NUnit.Engine - net20;netstandard2.0;netcoreapp3.1 + net20;netstandard2.0 true ..\..\nunit.snk portable