diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 0b1bb6459..5551e96fb 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -11,13 +11,6 @@ jobs: steps: - - task: UseDotNet@2 - displayName: 'Install .NET Core 1.1.2' - inputs: - packageType: runtime - version: 1.1.2 - installationPath: C:/Program Files/dotnet - - powershell: .\build.ps1 -Target Test -Configuration Release displayName: Build and test @@ -30,14 +23,6 @@ jobs: mergeTestResults: true testRunTitle: net35/Windows condition: succeededOrFailed() - - task: PublishTestResults@2 - displayName: Publish netcoreapp1.1 test results - inputs: - testResultsFormat: NUnit - testResultsFiles: test-results\netcoreapp1.1\*.xml - mergeTestResults: true - testRunTitle: netcoreapp1.1/Windows - condition: succeededOrFailed() - task: PublishTestResults@2 displayName: Publish netcoreapp2.1 test results inputs: @@ -66,7 +51,6 @@ jobs: sudo dpkg -i packages-microsoft-prod.deb sudo apt-get install apt-transport-https sudo apt-get update - sudo apt-get install dotnet-sharedframework-microsoft.netcore.app-1.1.2 sudo apt-get install dotnet-sdk-2.2 sudo apt-get install dotnet-runtime-5.0 ./build.sh --target=Test --configuration=Release @@ -81,14 +65,6 @@ jobs: mergeTestResults: true testRunTitle: net35/Linux condition: succeededOrFailed() - - task: PublishTestResults@2 - displayName: Publish netcoreapp1.1 test results - inputs: - testResultsFormat: NUnit - testResultsFiles: test-results/netcoreapp1.1/*.xml - mergeTestResults: true - testRunTitle: netcoreapp1.1/Linux - condition: succeededOrFailed() - task: PublishTestResults@2 displayName: Publish netcoreapp2.1 test results inputs: @@ -120,12 +96,6 @@ jobs: packageType: runtime version: 2.1.x - - task: UseDotNet@2 - displayName: 'Install .NET Core runtime 1.1' - inputs: - packageType: runtime - version: 1.1.x - - bash: | dotnet tool install --global Cake.Tool dotnet cake --target=Test --configuration=Release @@ -140,14 +110,6 @@ jobs: mergeTestResults: true testRunTitle: net35/macOS condition: succeededOrFailed() - - task: PublishTestResults@2 - displayName: Publish netcoreapp1.1 test results - inputs: - testResultsFormat: NUnit - testResultsFiles: test-results/netcoreapp1.1/*.xml - mergeTestResults: true - testRunTitle: netcoreapp1.1/macOS - condition: succeededOrFailed() - task: PublishTestResults@2 displayName: Publish netcoreapp2.1 test results inputs: diff --git a/build.cake b/build.cake index 55063b8e2..9dad7aed9 100644 --- a/build.cake +++ b/build.cake @@ -34,7 +34,6 @@ var PROJECT_DIR = Context.Environment.WorkingDirectory.FullPath + "/"; var PACKAGE_DIR = Argument("artifact-dir", PROJECT_DIR + "package") + "/"; var BIN_DIR = PROJECT_DIR + "bin/" + configuration + "/"; var NET35_BIN_DIR = BIN_DIR + "net35/"; -var NETCOREAPP11_BIN_DIR = BIN_DIR + "netcoreapp1.1/"; var NETCOREAPP21_BIN_DIR = BIN_DIR + "netcoreapp2.1/"; var NETCOREAPP31_BIN_DIR = BIN_DIR + "netcoreapp3.1/"; var CHOCO_DIR = PROJECT_DIR + "choco/"; @@ -142,6 +141,17 @@ Task("Clean") CleanDirectory(PACKAGE_DIR); }); +// Not currently used in CI but useful for cleaning your local obj +// directories, particularly after changing the target of a project. +Task("CleanAll") + .Description("Cleans obj directories in additon to standard clean") + .IsDependentOn("Clean") + .Does(() => + { + foreach (var dir in GetDirectories(PROJECT_DIR + "src/**/obj/")) + DeleteDirectory(dir, new DeleteDirectorySettings() { Recursive = true }); + }); + ////////////////////////////////////////////////////////////////////// // INITIALIZE FOR BUILD ////////////////////////////////////////////////////////////////////// @@ -192,7 +202,7 @@ MSBuildSettings CreateMSBuildSettings(string target) } Task("Build") - .Description("Builds the engine and console") + .Description("Builds the engine and console") .IsDependentOn("UpdateAssemblyInfo") .Does(() => { @@ -200,17 +210,17 @@ Task("Build") Information("Publishing .NET Core & Standard projects so that dependencies are present..."); - foreach(var framework in new [] { "netstandard1.6", "netstandard2.0", "netcoreapp3.1" }) - MSBuild(ENGINE_CSPROJ, CreateMSBuildSettings("Publish") - .WithProperty("TargetFramework", framework) - .WithProperty("PublishDir", BIN_DIR + framework)); + foreach(var framework in new [] { "netstandard2.0", "netcoreapp3.1" }) + MSBuild(ENGINE_CSPROJ, CreateMSBuildSettings("Publish") + .WithProperty("TargetFramework", framework) + .WithProperty("PublishDir", BIN_DIR + framework)); - foreach(var framework in new [] { "netstandard1.6", "netstandard2.0" }) + foreach (var framework in new [] { "netstandard2.0" }) MSBuild(ENGINE_API_CSPROJ, CreateMSBuildSettings("Publish") .WithProperty("TargetFramework", framework) .WithProperty("PublishDir", BIN_DIR + framework)); - foreach(var framework in new [] { "netcoreapp1.1", "netcoreapp2.1", "netcoreapp3.1" }) + foreach(var framework in new [] { "netcoreapp2.1", "netcoreapp3.1" }) MSBuild(ENGINE_TESTS_CSPROJ, CreateMSBuildSettings("Publish") .WithProperty("TargetFramework", framework) .WithProperty("PublishDir", BIN_DIR + framework)); @@ -300,24 +310,6 @@ Task("TestNetCore31Console") } }); -////////////////////////////////////////////////////////////////////// -// TEST NETSTANDARD 1.6 ENGINE -////////////////////////////////////////////////////////////////////// - -Task("TestNetStandard16Engine") - .Description("Tests the .NET Standard Engine") - .IsDependentOn("Build") - .WithCriteria(!BuildSystem.IsRunningOnAzurePipelines) //Unable to find Azure build supporting both .NET Core 1.1 and .NET Core 3.1 - .OnError(exception => { ErrorDetail.Add(exception.Message); }) - .Does(() => - { - RunDotnetCoreNUnitLiteTests( - NETCOREAPP11_BIN_DIR + ENGINE_TESTS, - NETCOREAPP11_BIN_DIR, - "netcoreapp1.1", - ref ErrorDetail); - }); - ////////////////////////////////////////////////////////////////////// // TEST NETSTANDARD 2.0 ENGINE ////////////////////////////////////////////////////////////////////// @@ -826,7 +818,6 @@ Task("TestConsole") Task("TestEngine") .Description("Builds and tests the engine") .IsDependentOn("TestNet20Engine") - .IsDependentOn("TestNetStandard16Engine") .IsDependentOn("TestNetStandard20Engine") .IsDependentOn("TestNetCore31Engine"); diff --git a/nuget/engine/nunit.engine.api.nuspec b/nuget/engine/nunit.engine.api.nuspec index 1314b3fe8..9ebbd591d 100644 --- a/nuget/engine/nunit.engine.api.nuspec +++ b/nuget/engine/nunit.engine.api.nuspec @@ -20,11 +20,6 @@ Copyright (c) 2020 Charlie Poole, Rob Prouse - - - - - @@ -33,7 +28,6 @@ - diff --git a/nuget/engine/nunit.engine.nuspec b/nuget/engine/nunit.engine.nuspec index 8292339b1..3c7bf58b5 100644 --- a/nuget/engine/nunit.engine.nuspec +++ b/nuget/engine/nunit.engine.nuspec @@ -20,14 +20,6 @@ Copyright (c) 2020 Charlie Poole, Rob Prouse - - - - - - - - @@ -72,11 +64,6 @@ - - - - - diff --git a/package-checks.cake b/package-checks.cake index 3f234b635..a52152807 100644 --- a/package-checks.cake +++ b/package-checks.cake @@ -27,10 +27,8 @@ public void CheckAllPackages() CheckNuGetPackage("NUnit.Engine", HasFiles("LICENSE.txt", "NOTICES.txt", "CHANGES.txt"), HasDirectory("lib/net20").WithFiles(ENGINE_FILES), - HasDirectory("lib/netstandard1.6").WithFiles(ENGINE_FILES), HasDirectory("lib/netstandard2.0").WithFiles(ENGINE_FILES), HasDirectory("contentFiles/any/lib/net20").WithFile("nunit.engine.nuget.addins"), - HasDirectory("contentFiles/any/lib/netstandard1.6").WithFile("nunit.engine.nuget.addins"), HasDirectory("contentFiles/any/lib/netstandard2.0").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")) & @@ -38,7 +36,6 @@ public void CheckAllPackages() "NUnit.Engine.Api", HasFile("LICENSE.txt"), HasDirectory("lib/net20").WithFile("nunit.engine.api.dll"), - HasDirectory("lib/netstandard1.6").WithFile("nunit.engine.api.dll"), HasDirectory("lib/netstandard2.0").WithFile("nunit.engine.api.dll")) & CheckNuGetPackage( "NUnit.Runners", @@ -56,10 +53,8 @@ public void CheckAllPackages() HasFiles("LICENSE.txt", "license.rtf", "NOTICES.txt", "CHANGES.txt"), HasDirectory("bin/net20").WithFiles("nunit3-console.exe", "nunit3-console.exe.config").AndFiles(ENGINE_FILES), HasDirectory("bin/net35").WithFiles("nunit3-console.exe", "nunit3-console.exe.config").AndFiles(ENGINE_FILES), - HasDirectory("bin/netstandard1.6").WithFiles(ENGINE_FILES), HasDirectory("bin/netstandard2.0").WithFiles(ENGINE_FILES), - HasDirectory("bin/netcoreapp1.1").WithFiles(ENGINE_FILES), - HasDirectory("bin/netcoreapp1.1").WithFiles(ENGINE_FILES), + HasDirectory("bin/netcoreapp2.1").WithFiles(ENGINE_FILES), HasDirectory("bin/agents/net20").WithFiles(AGENT_FILES), HasDirectory("bin/agents/net40").WithFiles(AGENT_FILES)) & CheckMsiPackage("NUnit.Console", diff --git a/src/CommonAssemblyInfo.cs b/src/CommonAssemblyInfo.cs index ec57abb9b..4ae1df67a 100644 --- a/src/CommonAssemblyInfo.cs +++ b/src/CommonAssemblyInfo.cs @@ -35,8 +35,6 @@ [assembly: AssemblyConfiguration(".NET 3.5 Debug")] #elif NET20 [assembly: AssemblyConfiguration(".NET 2.0 Debug")] -#elif NETSTANDARD1_6 || NETCOREAPP1_1 -[assembly: AssemblyConfiguration(".NET Standard 1.6 Debug")] #elif NETSTANDARD2_0 || NETCOREAPP2_1 [assembly: AssemblyConfiguration(".NET Standard 2.0 Debug")] #else @@ -47,8 +45,6 @@ [assembly: AssemblyConfiguration(".NET 3.5")] #elif NET20 [assembly: AssemblyConfiguration(".NET 2.0")] -#elif NETSTANDARD1_6 || NETCOREAPP1_1 -[assembly: AssemblyConfiguration(".NET Standard 1.6")] #elif NETSTANDARD2_0 || NETCOREAPP2_1 [assembly: AssemblyConfiguration(".NET Standard 2.0")] #else diff --git a/src/NUnitEngine/EngineApiVersion.cs b/src/NUnitEngine/EngineApiVersion.cs index a9811c855..c15b8ec22 100644 --- a/src/NUnitEngine/EngineApiVersion.cs +++ b/src/NUnitEngine/EngineApiVersion.cs @@ -25,5 +25,5 @@ [assembly: AssemblyProduct("NUnit Engine API")] [assembly: AssemblyVersion("3.0.0.0")] -[assembly: AssemblyInformationalVersion("3.12.0")] +[assembly: AssemblyInformationalVersion("3.12.0-beta1")] [assembly: AssemblyFileVersion("3.12.0")] diff --git a/src/NUnitEngine/mock-assembly/MockAssembly.cs b/src/NUnitEngine/mock-assembly/MockAssembly.cs index e41bb9f10..d387fa835 100644 --- a/src/NUnitEngine/mock-assembly/MockAssembly.cs +++ b/src/NUnitEngine/mock-assembly/MockAssembly.cs @@ -112,9 +112,7 @@ public class MockAssembly public const int Inconclusive = MockTestFixture.Inconclusive; -#if !NETCOREAPP1_1 public static readonly string AssemblyPath = AssemblyHelper.GetAssemblyPath(typeof(MockAssembly).Assembly); -#endif } [TestFixture(Description="Fake Test Fixture")] diff --git a/src/NUnitEngine/mock-assembly/mock-assembly.csproj b/src/NUnitEngine/mock-assembly/mock-assembly.csproj index ce57f7d15..50a51f8d4 100644 --- a/src/NUnitEngine/mock-assembly/mock-assembly.csproj +++ b/src/NUnitEngine/mock-assembly/mock-assembly.csproj @@ -1,14 +1,11 @@  NUnit.Tests - net35;netcoreapp1.1;netcoreapp2.1;netcoreapp3.1 + net35;netcoreapp2.1;netcoreapp3.1 true ..\..\nunit.snk - - - - + diff --git a/src/NUnitEngine/notest-assembly/notest-assembly.csproj b/src/NUnitEngine/notest-assembly/notest-assembly.csproj index 5c1f1c720..bcb8fe9c3 100644 --- a/src/NUnitEngine/notest-assembly/notest-assembly.csproj +++ b/src/NUnitEngine/notest-assembly/notest-assembly.csproj @@ -1,12 +1,9 @@  notest_assembly - net35;netcoreapp1.1;netcoreapp2.1;netcoreapp3.1 + net35;netcoreapp2.1;netcoreapp3.1 - - - - + \ No newline at end of file diff --git a/src/NUnitEngine/nunit.engine.api/Exceptions/NUnitEngineException.cs b/src/NUnitEngine/nunit.engine.api/Exceptions/NUnitEngineException.cs index a399c5439..13f17d066 100644 --- a/src/NUnitEngine/nunit.engine.api/Exceptions/NUnitEngineException.cs +++ b/src/NUnitEngine/nunit.engine.api/Exceptions/NUnitEngineException.cs @@ -22,9 +22,7 @@ // *********************************************************************** using System; -#if !NETSTANDARD1_6 using System.Runtime.Serialization; -#endif namespace NUnit.Engine { @@ -33,9 +31,7 @@ namespace NUnit.Engine /// called with improper values or when a particular facility /// is not available. /// -#if !NETSTANDARD1_6 [Serializable] -#endif public class NUnitEngineException : Exception { /// @@ -52,11 +48,9 @@ public NUnitEngineException(string message, Exception innerException) : base(mes { } -#if !NETSTANDARD1_6 /// /// Serialization constructor /// public NUnitEngineException(SerializationInfo info, StreamingContext context) : base(info, context) { } -#endif } } diff --git a/src/NUnitEngine/nunit.engine.api/Exceptions/NUnitEngineNotFoundException.cs b/src/NUnitEngine/nunit.engine.api/Exceptions/NUnitEngineNotFoundException.cs index 778c6c12a..b23bf9275 100644 --- a/src/NUnitEngine/nunit.engine.api/Exceptions/NUnitEngineNotFoundException.cs +++ b/src/NUnitEngine/nunit.engine.api/Exceptions/NUnitEngineNotFoundException.cs @@ -28,9 +28,7 @@ namespace NUnit.Engine /// /// The exception that is thrown if a valid test engine is not found /// -#if !NETSTANDARD1_6 [Serializable] -#endif public class NUnitEngineNotFoundException : Exception { /// diff --git a/src/NUnitEngine/nunit.engine.api/Exceptions/NUnitEngineUnloadException.cs b/src/NUnitEngine/nunit.engine.api/Exceptions/NUnitEngineUnloadException.cs index 02f632619..e10de803a 100644 --- a/src/NUnitEngine/nunit.engine.api/Exceptions/NUnitEngineUnloadException.cs +++ b/src/NUnitEngine/nunit.engine.api/Exceptions/NUnitEngineUnloadException.cs @@ -23,9 +23,7 @@ using System; using System.Collections.Generic; -#if !NETSTANDARD1_6 using System.Runtime.Serialization; -#endif namespace NUnit.Engine { @@ -35,9 +33,7 @@ namespace NUnit.Engine /// but one or more errors were encountered when attempting to unload /// and shut down the test run cleanly. /// -#if !NETSTANDARD1_6 [Serializable] -#endif public class NUnitEngineUnloadException : NUnitEngineException //Inherits from NUnitEngineException for backwards compatibility of calling runners { private const string AggregatedExceptionsMsg = @@ -66,12 +62,10 @@ public NUnitEngineUnloadException(ICollection aggregatedExceptions) : AggregatedExceptions = aggregatedExceptions; } -#if !NETSTANDARD1_6 /// /// Serialization constructor. /// public NUnitEngineUnloadException(SerializationInfo info, StreamingContext context) : base(info, context) { } -#endif /// /// Gets the collection of exceptions . diff --git a/src/NUnitEngine/nunit.engine.api/Extensibility/IDriverFactory.cs b/src/NUnitEngine/nunit.engine.api/Extensibility/IDriverFactory.cs index c6d846b9e..c2a880c02 100644 --- a/src/NUnitEngine/nunit.engine.api/Extensibility/IDriverFactory.cs +++ b/src/NUnitEngine/nunit.engine.api/Extensibility/IDriverFactory.cs @@ -40,7 +40,7 @@ public interface IDriverFactory /// An AssemblyName referring to the possible test framework. bool IsSupportedTestFramework(AssemblyName reference); -#if NETSTANDARD1_6 || NETSTANDARD2_0 +#if NETSTANDARD2_0 /// /// Gets a driver for a given test assembly and a framework /// which the assembly is already known to reference. diff --git a/src/NUnitEngine/nunit.engine.api/ITestRunner.cs b/src/NUnitEngine/nunit.engine.api/ITestRunner.cs index 763076292..c56207268 100644 --- a/src/NUnitEngine/nunit.engine.api/ITestRunner.cs +++ b/src/NUnitEngine/nunit.engine.api/ITestRunner.cs @@ -77,7 +77,6 @@ public interface ITestRunner : IDisposable /// An XmlNode giving the result of the test execution XmlNode Run(ITestEventListener listener, TestFilter filter); -#if !NETSTANDARD1_6 /// /// Start a run of the tests in the loaded TestPackage. The tests are run /// asynchronously and the listener interface is notified as it progresses. @@ -86,7 +85,6 @@ public interface ITestRunner : IDisposable /// A TestFilter used to select tests /// ITestRun RunAsync(ITestEventListener listener, TestFilter filter); -#endif /// /// Cancel the ongoing test run. If no test is running, the call is ignored. diff --git a/src/NUnitEngine/nunit.engine.api/TestEngineActivator.cs b/src/NUnitEngine/nunit.engine.api/TestEngineActivator.cs index 076187a55..2b886b8b4 100644 --- a/src/NUnitEngine/nunit.engine.api/TestEngineActivator.cs +++ b/src/NUnitEngine/nunit.engine.api/TestEngineActivator.cs @@ -38,22 +38,7 @@ public static class TestEngineActivator private const string DefaultAssemblyName = "nunit.engine.dll"; internal const string DefaultTypeName = "NUnit.Engine.TestEngine"; -#if NETSTANDARD1_6 - /// - /// Create an instance of the test engine. - /// - /// An - public static ITestEngine CreateInstance() - { - var apiLocation = typeof(TestEngineActivator).GetTypeInfo().Assembly.Location; - var directoryName = Path.GetDirectoryName(apiLocation); - var enginePath = directoryName == null ? DefaultAssemblyName : Path.Combine(directoryName, DefaultAssemblyName); - var assemblyName = System.Runtime.Loader.AssemblyLoadContext.GetAssemblyName(enginePath); - var assembly = Assembly.Load(assemblyName); - var engineType = assembly.GetType(DefaultTypeName); - return Activator.CreateInstance(engineType) as ITestEngine; - } -#elif NETSTANDARD2_0 +#if NETSTANDARD2_0 /// /// Create an instance of the test engine. /// diff --git a/src/NUnitEngine/nunit.engine.api/TestFilter.cs b/src/NUnitEngine/nunit.engine.api/TestFilter.cs index 3e56506c6..f1bc9da00 100644 --- a/src/NUnitEngine/nunit.engine.api/TestFilter.cs +++ b/src/NUnitEngine/nunit.engine.api/TestFilter.cs @@ -32,9 +32,7 @@ namespace NUnit.Engine /// In the console runner, filters serve only to carry this /// XML representation, as all filtering is done by the engine. /// -#if !NETSTANDARD1_6 [Serializable] -#endif public class TestFilter { /// diff --git a/src/NUnitEngine/nunit.engine.api/TestPackage.cs b/src/NUnitEngine/nunit.engine.api/TestPackage.cs index 078fa88f8..9d9b58ae5 100644 --- a/src/NUnitEngine/nunit.engine.api/TestPackage.cs +++ b/src/NUnitEngine/nunit.engine.api/TestPackage.cs @@ -43,9 +43,7 @@ namespace NUnit.Engine /// package, changing settings as needed. This gives the best chance for the /// tests in the reloaded assembly to match those originally loaded. /// -#if !NETSTANDARD1_6 [Serializable] -#endif public class TestPackage { /// diff --git a/src/NUnitEngine/nunit.engine.api/TestSelectionParserException.cs b/src/NUnitEngine/nunit.engine.api/TestSelectionParserException.cs index 4b4684b17..6be423d1e 100644 --- a/src/NUnitEngine/nunit.engine.api/TestSelectionParserException.cs +++ b/src/NUnitEngine/nunit.engine.api/TestSelectionParserException.cs @@ -22,9 +22,7 @@ // *********************************************************************** using System; -#if !NETSTANDARD1_6 using System.Runtime.Serialization; -#endif namespace NUnit.Engine { @@ -32,9 +30,7 @@ namespace NUnit.Engine /// TestSelectionParserException is thrown when an error /// is found while parsing the selection expression. /// -#if !NETSTANDARD1_6 [Serializable] -#endif public class TestSelectionParserException : Exception { /// @@ -49,11 +45,9 @@ public class TestSelectionParserException : Exception /// public TestSelectionParserException(string message, Exception innerException) : base(message, innerException) { } -#if !NETSTANDARD1_6 /// /// Serialization constructor /// public TestSelectionParserException(SerializationInfo info, StreamingContext context) : base(info, context) { } -#endif } } diff --git a/src/NUnitEngine/nunit.engine.api/nunit.engine.api.csproj b/src/NUnitEngine/nunit.engine.api/nunit.engine.api.csproj index acaca9ffd..09b8dafdf 100644 --- a/src/NUnitEngine/nunit.engine.api/nunit.engine.api.csproj +++ b/src/NUnitEngine/nunit.engine.api/nunit.engine.api.csproj @@ -1,7 +1,7 @@  NUnit.Engine - net20;netstandard1.6;netstandard2.0 + net20;netstandard2.0 true ..\..\nunit.snk true @@ -9,10 +9,7 @@ - - - - + diff --git a/src/NUnitEngine/nunit.engine.core/Agents/TestAgent.cs b/src/NUnitEngine/nunit.engine.core/Agents/TestAgent.cs index b4d52e04c..f6f3fe670 100644 --- a/src/NUnitEngine/nunit.engine.core/Agents/TestAgent.cs +++ b/src/NUnitEngine/nunit.engine.core/Agents/TestAgent.cs @@ -21,7 +21,7 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // *********************************************************************** -#if !NETSTANDARD1_6 && !NETSTANDARD2_0 +#if !NETSTANDARD2_0 using System; namespace NUnit.Engine.Agents diff --git a/src/NUnitEngine/nunit.engine.core/AsyncTestEngineResult.cs b/src/NUnitEngine/nunit.engine.core/AsyncTestEngineResult.cs index 642f04e1b..501ef261c 100644 --- a/src/NUnitEngine/nunit.engine.core/AsyncTestEngineResult.cs +++ b/src/NUnitEngine/nunit.engine.core/AsyncTestEngineResult.cs @@ -31,9 +31,7 @@ namespace NUnit.Engine /// /// The TestRun class encapsulates an ongoing test run. /// -#if !NETSTANDARD1_6 [Serializable] -#endif public class AsyncTestEngineResult : ITestRun { private volatile TestEngineResult _result; diff --git a/src/NUnitEngine/nunit.engine.core/CoreEngine.cs b/src/NUnitEngine/nunit.engine.core/CoreEngine.cs index db9dd0833..10e3e0726 100644 --- a/src/NUnitEngine/nunit.engine.core/CoreEngine.cs +++ b/src/NUnitEngine/nunit.engine.core/CoreEngine.cs @@ -40,11 +40,7 @@ public class CoreEngine public CoreEngine() { Services = new ServiceContext(); -#if NETSTANDARD1_6 - WorkDirectory = NUnitConfiguration.ApplicationDirectory; -#else WorkDirectory = Environment.CurrentDirectory; -#endif InternalTraceLevel = InternalTraceLevel.Default; } @@ -101,9 +97,7 @@ public void InitializeServices() // For example, ResultService uses ExtensionService, so ExtensionService is added // later. Services.Add(new DriverService()); -#if !NETSTANDARD1_6 Services.Add(new ExtensionService()); -#endif #if NETFRAMEWORK Services.Add(new DomainManager()); #endif diff --git a/src/NUnitEngine/nunit.engine.core/Extensibility/ExtensionAssembly.cs b/src/NUnitEngine/nunit.engine.core/Extensibility/ExtensionAssembly.cs index 6fbdef2c2..04e03e474 100644 --- a/src/NUnitEngine/nunit.engine.core/Extensibility/ExtensionAssembly.cs +++ b/src/NUnitEngine/nunit.engine.core/Extensibility/ExtensionAssembly.cs @@ -21,7 +21,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // *********************************************************************** -#if !NETSTANDARD1_6 using System; using System.IO; using Mono.Cecil; @@ -75,4 +74,3 @@ private AssemblyDefinition GetAssemblyDefinition() } } } -#endif \ No newline at end of file diff --git a/src/NUnitEngine/nunit.engine.core/Extensibility/ExtensionNode.cs b/src/NUnitEngine/nunit.engine.core/Extensibility/ExtensionNode.cs index 0dd4cd478..5a69a180a 100644 --- a/src/NUnitEngine/nunit.engine.core/Extensibility/ExtensionNode.cs +++ b/src/NUnitEngine/nunit.engine.core/Extensibility/ExtensionNode.cs @@ -21,7 +21,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // *********************************************************************** -#if !NETSTANDARD1_6 using System; using System.Collections.Generic; using System.Reflection; @@ -172,4 +171,3 @@ public override string ToString() } } } -#endif \ No newline at end of file diff --git a/src/NUnitEngine/nunit.engine.core/Extensibility/ExtensionPoint.cs b/src/NUnitEngine/nunit.engine.core/Extensibility/ExtensionPoint.cs index 95817ce84..4b4348cb0 100644 --- a/src/NUnitEngine/nunit.engine.core/Extensibility/ExtensionPoint.cs +++ b/src/NUnitEngine/nunit.engine.core/Extensibility/ExtensionPoint.cs @@ -21,7 +21,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // *********************************************************************** -#if !NETSTANDARD1_6 using System; using System.Collections.Generic; @@ -105,4 +104,3 @@ public void Remove(ExtensionNode extension) } } } -#endif \ No newline at end of file diff --git a/src/NUnitEngine/nunit.engine.core/Extensibility/ExtensionSelector.cs b/src/NUnitEngine/nunit.engine.core/Extensibility/ExtensionSelector.cs index 720fc7078..5fa1de158 100644 --- a/src/NUnitEngine/nunit.engine.core/Extensibility/ExtensionSelector.cs +++ b/src/NUnitEngine/nunit.engine.core/Extensibility/ExtensionSelector.cs @@ -21,7 +21,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // *********************************************************************** -#if !NETSTANDARD1_6 using System; using NUnit.Common; @@ -77,4 +76,3 @@ public static bool IsBetterVersionOf(this IExtensionAssembly first, IExtensionAs } } } -#endif \ No newline at end of file diff --git a/src/NUnitEngine/nunit.engine.core/Extensibility/IExtensionAssembly.cs b/src/NUnitEngine/nunit.engine.core/Extensibility/IExtensionAssembly.cs index 51b17d005..d49386651 100644 --- a/src/NUnitEngine/nunit.engine.core/Extensibility/IExtensionAssembly.cs +++ b/src/NUnitEngine/nunit.engine.core/Extensibility/IExtensionAssembly.cs @@ -21,7 +21,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // *********************************************************************** -#if !NETSTANDARD1_6 using System; namespace NUnit.Engine.Extensibility @@ -36,4 +35,3 @@ internal interface IExtensionAssembly #endif } } -#endif \ No newline at end of file diff --git a/src/NUnitEngine/nunit.engine.core/IDriverService.cs b/src/NUnitEngine/nunit.engine.core/IDriverService.cs index 6edc436b7..7114a58db 100644 --- a/src/NUnitEngine/nunit.engine.core/IDriverService.cs +++ b/src/NUnitEngine/nunit.engine.core/IDriverService.cs @@ -32,15 +32,6 @@ namespace NUnit.Engine /// public interface IDriverService { -#if NETSTANDARD1_6 - /// - /// Get a driver suitable for use with a particular test assembly. - /// - /// The full path to the test assembly - /// True if non-test assemblies should simply be skipped rather than reporting an error - /// - IFrameworkDriver GetDriver(string assemblyPath, bool skipNonTestAssemblies); -#else /// /// Get a driver suitable for loading and running tests in the specified assembly. /// @@ -50,6 +41,5 @@ public interface IDriverService /// True if non-test assemblies should simply be skipped rather than reporting an error /// IFrameworkDriver GetDriver(AppDomain domain, string assemblyPath, string targetFramework, bool skipNonTestAssemblies); -#endif } } diff --git a/src/NUnitEngine/nunit.engine.core/ITestEngineRunner.cs b/src/NUnitEngine/nunit.engine.core/ITestEngineRunner.cs index a0b896a79..a2621595b 100644 --- a/src/NUnitEngine/nunit.engine.core/ITestEngineRunner.cs +++ b/src/NUnitEngine/nunit.engine.core/ITestEngineRunner.cs @@ -68,7 +68,6 @@ public interface ITestEngineRunner : IDisposable /// A TestEngineResult giving the result of the test execution TestEngineResult Run(ITestEventListener listener, TestFilter filter); -#if !NETSTANDARD1_6 /// /// Start a run of the tests in the loaded TestPackage. The tests are run /// asynchronously and the listener interface is notified as it progresses. @@ -77,7 +76,6 @@ public interface ITestEngineRunner : IDisposable /// A TestFilter used to select tests /// An that will provide the result of the test execution AsyncTestEngineResult RunAsync(ITestEventListener listener, TestFilter filter); -#endif /// /// Cancel the current test run. If no test is running, diff --git a/src/NUnitEngine/nunit.engine.core/Internal/AssemblyHelper.cs b/src/NUnitEngine/nunit.engine.core/Internal/AssemblyHelper.cs index 5db8b4cd6..220d6254e 100644 --- a/src/NUnitEngine/nunit.engine.core/Internal/AssemblyHelper.cs +++ b/src/NUnitEngine/nunit.engine.core/Internal/AssemblyHelper.cs @@ -21,7 +21,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // *********************************************************************** -#if !NETSTANDARD1_6 using System; using System.IO; using System.Reflection; @@ -93,4 +92,3 @@ public static string GetAssemblyPathFromCodeBase(string codeBase) } } } -#endif \ No newline at end of file diff --git a/src/NUnitEngine/nunit.engine.core/Internal/DomainDetailsBuilder.cs b/src/NUnitEngine/nunit.engine.core/Internal/DomainDetailsBuilder.cs index 6c1c29f8a..a99c553f6 100644 --- a/src/NUnitEngine/nunit.engine.core/Internal/DomainDetailsBuilder.cs +++ b/src/NUnitEngine/nunit.engine.core/Internal/DomainDetailsBuilder.cs @@ -21,7 +21,7 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // *********************************************************************** -#if !NETSTANDARD1_6 && !NETSTANDARD2_0 +#if !NETSTANDARD2_0 using System; using System.Collections.Generic; using System.Reflection; diff --git a/src/NUnitEngine/nunit.engine.core/Internal/DomainUsage.cs b/src/NUnitEngine/nunit.engine.core/Internal/DomainUsage.cs index b28332977..8f75c0746 100644 --- a/src/NUnitEngine/nunit.engine.core/Internal/DomainUsage.cs +++ b/src/NUnitEngine/nunit.engine.core/Internal/DomainUsage.cs @@ -21,7 +21,7 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // *********************************************************************** -#if !NETSTANDARD1_6 && !NETSTANDARD2_0 +#if !NETSTANDARD2_0 namespace NUnit.Engine.Internal { /// diff --git a/src/NUnitEngine/nunit.engine.core/Internal/NUnitConfiguration.cs b/src/NUnitEngine/nunit.engine.core/Internal/NUnitConfiguration.cs index 1fd60f236..2e94cca02 100644 --- a/src/NUnitEngine/nunit.engine.core/Internal/NUnitConfiguration.cs +++ b/src/NUnitEngine/nunit.engine.core/Internal/NUnitConfiguration.cs @@ -34,8 +34,6 @@ namespace NUnit.Engine.Internal /// public static class NUnitConfiguration { -#if !NETSTANDARD1_6 - private static string _engineDirectory; public static string EngineDirectory { @@ -49,8 +47,6 @@ public static string EngineDirectory } } -#endif - private static string _applicationDirectory; public static string ApplicationDirectory { @@ -59,11 +55,7 @@ public static string ApplicationDirectory if (_applicationDirectory == null) { _applicationDirectory = Path.Combine( -#if NETSTANDARD1_6 - Environment.GetEnvironmentVariable(RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "LocalAppData" : "HOME"), -#else - Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), -#endif + Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "NUnit"); } diff --git a/src/NUnitEngine/nunit.engine.core/Internal/ProvidedPathsAssemblyResolver.cs b/src/NUnitEngine/nunit.engine.core/Internal/ProvidedPathsAssemblyResolver.cs index 8e2aa0f96..49baf7d8e 100644 --- a/src/NUnitEngine/nunit.engine.core/Internal/ProvidedPathsAssemblyResolver.cs +++ b/src/NUnitEngine/nunit.engine.core/Internal/ProvidedPathsAssemblyResolver.cs @@ -21,7 +21,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // *********************************************************************** -#if !NETSTANDARD1_6 using System; using System.Collections.Generic; using System.Reflection; @@ -96,4 +95,3 @@ Assembly AssemblyResolve(object sender, ResolveEventArgs args) List _resolutionPaths; } } -#endif \ No newline at end of file diff --git a/src/NUnitEngine/nunit.engine.core/Properties/AssemblyInfo.cs b/src/NUnitEngine/nunit.engine.core/Properties/AssemblyInfo.cs index 010878b10..2f3f43e40 100644 --- a/src/NUnitEngine/nunit.engine.core/Properties/AssemblyInfo.cs +++ b/src/NUnitEngine/nunit.engine.core/Properties/AssemblyInfo.cs @@ -5,11 +5,7 @@ // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. -#if NETSTANDARD1_6 -[assembly: AssemblyTitle("NUnit .NET Standard Engine Core")] -#else [assembly: AssemblyTitle("NUnit Engine Core")] -#endif [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible diff --git a/src/NUnitEngine/nunit.engine.core/Runners/AbstractTestRunner.cs b/src/NUnitEngine/nunit.engine.core/Runners/AbstractTestRunner.cs index 0ca6519a2..92e2642ff 100644 --- a/src/NUnitEngine/nunit.engine.core/Runners/AbstractTestRunner.cs +++ b/src/NUnitEngine/nunit.engine.core/Runners/AbstractTestRunner.cs @@ -99,7 +99,6 @@ public virtual void UnloadPackage() /// A TestEngineResult giving the result of the test execution protected abstract TestEngineResult RunTests(ITestEventListener listener, TestFilter filter); -#if !NETSTANDARD1_6 /// /// Start a run of the tests in the loaded TestPackage, returning immediately. /// The tests are run asynchronously and the listener interface is notified @@ -124,7 +123,6 @@ protected virtual AsyncTestEngineResult RunTestsAsync(ITestEventListener listene return testRun; } -#endif /// /// Cancel the ongoing test run. If no test is running, the call is ignored. @@ -191,7 +189,6 @@ public TestEngineResult Run(ITestEventListener listener, TestFilter filter) return RunTests(listener, filter); } -#if !NETSTANDARD1_6 /// /// Start a run of the tests in the loaded TestPackage. The tests are run /// asynchronously and the listener interface is notified as it progresses. @@ -203,7 +200,6 @@ public AsyncTestEngineResult RunAsync(ITestEventListener listener, TestFilter fi { return RunTestsAsync(listener, filter); } -#endif public void Dispose() { diff --git a/src/NUnitEngine/nunit.engine.core/Runners/AggregatingTestRunner.cs b/src/NUnitEngine/nunit.engine.core/Runners/AggregatingTestRunner.cs index d9ce062b0..1759c3120 100644 --- a/src/NUnitEngine/nunit.engine.core/Runners/AggregatingTestRunner.cs +++ b/src/NUnitEngine/nunit.engine.core/Runners/AggregatingTestRunner.cs @@ -168,9 +168,6 @@ protected override TestEngineResult RunTests(ITestEventListener listener, TestFi bool disposeRunners = TestPackage.GetSetting(EnginePackageSettings.DisposeRunners, false); -#if NETSTANDARD1_6 - RunTestsSequentially(listener, filter, results, disposeRunners); -#else if (LevelOfParallelism <= 1) { RunTestsSequentially(listener, filter, results, disposeRunners); @@ -179,7 +176,7 @@ protected override TestEngineResult RunTests(ITestEventListener listener, TestFi { RunTestsInParallel(listener, filter, results, disposeRunners); } -#endif + if (disposeRunners) Runners.Clear(); return ResultHelper.Merge(results); @@ -195,7 +192,6 @@ private void RunTestsSequentially(ITestEventListener listener, TestFilter filter } } -#if !NETSTANDARD1_6 private void RunTestsInParallel(ITestEventListener listener, TestFilter filter, List results, bool disposeRunners) { var workerPool = new ParallelTaskWorkerPool(LevelOfParallelism); @@ -214,7 +210,6 @@ private void RunTestsInParallel(ITestEventListener listener, TestFilter filter, foreach (var task in tasks) LogResultsFromTask(task, results, _unloadExceptions); } -#endif /// /// Cancel the ongoing test run. If no test is running, the call is ignored. diff --git a/src/NUnitEngine/nunit.engine.core/Runners/DirectTestRunner.cs b/src/NUnitEngine/nunit.engine.core/Runners/DirectTestRunner.cs index 7d9c6844d..13f7ea722 100644 --- a/src/NUnitEngine/nunit.engine.core/Runners/DirectTestRunner.cs +++ b/src/NUnitEngine/nunit.engine.core/Runners/DirectTestRunner.cs @@ -60,15 +60,12 @@ public abstract class DirectTestRunner : AbstractTestRunner private readonly List _drivers = new List(); -#if !NETSTANDARD1_6 private ProvidedPathsAssemblyResolver _assemblyResolver; protected AppDomain TestDomain { get; set; } -#endif public DirectTestRunner(IServiceLocator services, TestPackage package) : base(services, package) { -#if !NETSTANDARD1_6 // Bypass the resolver if not in the default AppDomain. This prevents trying to use the resolver within // NUnit's own automated tests (in a test AppDomain) which does not make sense anyway. if (AppDomain.CurrentDomain.IsDefaultAppDomain()) @@ -76,7 +73,6 @@ public DirectTestRunner(IServiceLocator services, TestPackage package) : base(se _assemblyResolver = new ProvidedPathsAssemblyResolver(); _assemblyResolver.Install(); } -#endif } /// @@ -135,7 +131,6 @@ protected override TestEngineResult LoadPackage() string targetFramework = subPackage.GetSetting(InternalEnginePackageSettings.ImageTargetFrameworkName, (string)null); bool skipNonTestAssemblies = subPackage.GetSetting(EnginePackageSettings.SkipNonTestAssemblies, false); -#if !NETSTANDARD1_6 if (_assemblyResolver != null && !TestDomain.IsDefaultAppDomain() && subPackage.GetSetting(InternalEnginePackageSettings.ImageRequiresDefaultAppDomainAssemblyResolver, false)) { @@ -145,9 +140,7 @@ protected override TestEngineResult LoadPackage() } IFrameworkDriver driver = driverService.GetDriver(TestDomain, testFile, targetFramework, skipNonTestAssemblies); -#else - IFrameworkDriver driver = driverService.GetDriver(testFile, skipNonTestAssemblies); -#endif + driver.ID = subPackage.ID; result.Add(LoadDriver(driver, testFile, subPackage)); _drivers.Add(driver); @@ -225,13 +218,12 @@ protected override TestEngineResult RunTests(ITestEventListener listener, TestFi result.Add(driverResult); } -#if !NETSTANDARD1_6 if (_assemblyResolver != null) { foreach (var package in TestPackage.Select(p => p.IsAssemblyPackage())) _assemblyResolver.RemovePathFromFile(package.FullName); } -#endif + return result; } diff --git a/src/NUnitEngine/nunit.engine.core/Runners/LocalTestRunner.cs b/src/NUnitEngine/nunit.engine.core/Runners/LocalTestRunner.cs index 84ef11aed..a045f4a29 100644 --- a/src/NUnitEngine/nunit.engine.core/Runners/LocalTestRunner.cs +++ b/src/NUnitEngine/nunit.engine.core/Runners/LocalTestRunner.cs @@ -32,9 +32,7 @@ public class LocalTestRunner : DirectTestRunner { public LocalTestRunner(IServiceLocator services, TestPackage package) : base(services, package) { -#if !NETSTANDARD1_6 - this.TestDomain = AppDomain.CurrentDomain; -#endif + TestDomain = AppDomain.CurrentDomain; } } } diff --git a/src/NUnitEngine/nunit.engine.core/Runners/ParallelTaskWorkerPool.cs b/src/NUnitEngine/nunit.engine.core/Runners/ParallelTaskWorkerPool.cs index 589a68c49..a59c1ed28 100644 --- a/src/NUnitEngine/nunit.engine.core/Runners/ParallelTaskWorkerPool.cs +++ b/src/NUnitEngine/nunit.engine.core/Runners/ParallelTaskWorkerPool.cs @@ -21,7 +21,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // *********************************************************************** -#if !NETSTANDARD1_6 using System; using System.Collections.Generic; using System.Diagnostics; @@ -112,4 +111,3 @@ public void WaitAll() } } } -#endif \ No newline at end of file diff --git a/src/NUnitEngine/nunit.engine.core/Services/DriverService.cs b/src/NUnitEngine/nunit.engine.core/Services/DriverService.cs index 18a803526..b34486606 100644 --- a/src/NUnitEngine/nunit.engine.core/Services/DriverService.cs +++ b/src/NUnitEngine/nunit.engine.core/Services/DriverService.cs @@ -49,11 +49,7 @@ public class DriverService : Service, IDriverService /// The value of any TargetFrameworkAttribute on the assembly, or null /// True if non-test assemblies should simply be skipped rather than reporting an error /// -#if NETSTANDARD1_6 - public IFrameworkDriver GetDriver(string assemblyPath, bool skipNonTestAssemblies) -#else public IFrameworkDriver GetDriver(AppDomain domain, string assemblyPath, string targetFramework, bool skipNonTestAssemblies) -#endif { if (!File.Exists(assemblyPath)) return new InvalidAssemblyFrameworkDriver(assemblyPath, "File not found: " + assemblyPath); @@ -121,7 +117,6 @@ public override void StartService() try { -#if !NETSTANDARD1_6 var extensionService = ServiceContext.GetService(); if (extensionService != null) { @@ -134,7 +129,6 @@ public override void StartService() _factories.Add(new NUnit2DriverFactory(node)); #endif } -#endif _factories.Add(new NUnit3DriverFactory()); diff --git a/src/NUnitEngine/nunit.engine.core/Services/ExtensionService.cs b/src/NUnitEngine/nunit.engine.core/Services/ExtensionService.cs index a76c1a493..541f14420 100644 --- a/src/NUnitEngine/nunit.engine.core/Services/ExtensionService.cs +++ b/src/NUnitEngine/nunit.engine.core/Services/ExtensionService.cs @@ -21,7 +21,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // *********************************************************************** -#if !NETSTANDARD1_6 using System; using System.Collections.Generic; using System.IO; @@ -540,4 +539,3 @@ internal static bool CanLoadTargetFramework(Assembly runnerAsm, ExtensionAssembl } } } -#endif \ No newline at end of file diff --git a/src/NUnitEngine/nunit.engine.core/TestEngineResult.cs b/src/NUnitEngine/nunit.engine.core/TestEngineResult.cs index f4683c5a8..80506e888 100644 --- a/src/NUnitEngine/nunit.engine.core/TestEngineResult.cs +++ b/src/NUnitEngine/nunit.engine.core/TestEngineResult.cs @@ -47,16 +47,12 @@ namespace NUnit.Engine /// for combining multiple TestEngineResults into one. /// /// - #if !NETSTANDARD1_6 [Serializable] -#endif public class TestEngineResult { private List _xmlText = new List(); -#if !NETSTANDARD1_6 [NonSerialized] -#endif private List _xmlNodes = new List(); /// diff --git a/src/NUnitEngine/nunit.engine.core/nunit.engine.core.csproj b/src/NUnitEngine/nunit.engine.core/nunit.engine.core.csproj index bdefe6f45..2f691979e 100644 --- a/src/NUnitEngine/nunit.engine.core/nunit.engine.core.csproj +++ b/src/NUnitEngine/nunit.engine.core/nunit.engine.core.csproj @@ -1,7 +1,7 @@  NUnit.Engine - net20;netstandard1.6;netstandard2.0;netcoreapp3.1 + net20;netstandard2.0;netcoreapp3.1 true ..\..\nunit.snk @@ -9,10 +9,7 @@ - - - - + diff --git a/src/NUnitEngine/nunit.engine.tests/Drivers/NUnitNetStandardDriverTests.cs b/src/NUnitEngine/nunit.engine.tests/Drivers/NUnitNetStandardDriverTests.cs index 41177e841..59c049824 100644 --- a/src/NUnitEngine/nunit.engine.tests/Drivers/NUnitNetStandardDriverTests.cs +++ b/src/NUnitEngine/nunit.engine.tests/Drivers/NUnitNetStandardDriverTests.cs @@ -21,7 +21,7 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // *********************************************************************** -#if NETCOREAPP1_1 || NETCOREAPP2_1 +#if NETCOREAPP2_1 using System; using System.Collections.Generic; diff --git a/src/NUnitEngine/nunit.engine.tests/Extensibility/ExtensionAssemblyTests.cs b/src/NUnitEngine/nunit.engine.tests/Extensibility/ExtensionAssemblyTests.cs index 4c6227f53..e6d482e9a 100644 --- a/src/NUnitEngine/nunit.engine.tests/Extensibility/ExtensionAssemblyTests.cs +++ b/src/NUnitEngine/nunit.engine.tests/Extensibility/ExtensionAssemblyTests.cs @@ -21,7 +21,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // *********************************************************************** -#if !NETCOREAPP1_1 using System; using System.Reflection; using NUnit.Engine.Extensibility; @@ -82,4 +81,3 @@ public void TargetFramework() #endif } } -#endif \ No newline at end of file diff --git a/src/NUnitEngine/nunit.engine.tests/Helpers/ShadowCopyUtils.cs b/src/NUnitEngine/nunit.engine.tests/Helpers/ShadowCopyUtils.cs index f1db57732..097d4a70f 100644 --- a/src/NUnitEngine/nunit.engine.tests/Helpers/ShadowCopyUtils.cs +++ b/src/NUnitEngine/nunit.engine.tests/Helpers/ShadowCopyUtils.cs @@ -1,6 +1,4 @@ -#if !NETCOREAPP1_1 - -using System; +using System; using System.Collections.Generic; using System.IO; using System.Linq; @@ -36,4 +34,3 @@ public static ICollection GetAllNeededAssemblyPaths(params string[] asse } } } -#endif diff --git a/src/NUnitEngine/nunit.engine.tests/Integration/DirectoryWithNeededAssemblies.cs b/src/NUnitEngine/nunit.engine.tests/Integration/DirectoryWithNeededAssemblies.cs index b1faade6e..1b759e492 100644 --- a/src/NUnitEngine/nunit.engine.tests/Integration/DirectoryWithNeededAssemblies.cs +++ b/src/NUnitEngine/nunit.engine.tests/Integration/DirectoryWithNeededAssemblies.cs @@ -1,5 +1,4 @@ -#if !NETCOREAPP1_1 -using System; +using System; using System.IO; using NUnit.Engine.Tests.Helpers; @@ -30,4 +29,3 @@ public void Dispose() } } } -#endif \ No newline at end of file diff --git a/src/NUnitEngine/nunit.engine.tests/Integration/MockAssemblyInDirectoryWithFramework.cs b/src/NUnitEngine/nunit.engine.tests/Integration/MockAssemblyInDirectoryWithFramework.cs index 0e1af5f42..1f72e1ac4 100644 --- a/src/NUnitEngine/nunit.engine.tests/Integration/MockAssemblyInDirectoryWithFramework.cs +++ b/src/NUnitEngine/nunit.engine.tests/Integration/MockAssemblyInDirectoryWithFramework.cs @@ -1,5 +1,4 @@ -#if !NETCOREAPP1_1 -using System; +using System; using System.IO; using NUnit.Framework; @@ -24,4 +23,3 @@ public void Dispose() } } } -#endif \ No newline at end of file diff --git a/src/NUnitEngine/nunit.engine.tests/Integration/RunnerInDirectoryWithoutFramework.cs b/src/NUnitEngine/nunit.engine.tests/Integration/RunnerInDirectoryWithoutFramework.cs index 0c7b7ccac..fa7fbcfab 100644 --- a/src/NUnitEngine/nunit.engine.tests/Integration/RunnerInDirectoryWithoutFramework.cs +++ b/src/NUnitEngine/nunit.engine.tests/Integration/RunnerInDirectoryWithoutFramework.cs @@ -1,5 +1,4 @@ -#if !NETCOREAPP1_1 -using System; +using System; using System.IO; using System.Threading; using NUnit.Framework; @@ -38,4 +37,3 @@ public void Dispose() } } } -#endif \ No newline at end of file diff --git a/src/NUnitEngine/nunit.engine.tests/Internal/AssemblyHelperTests.cs b/src/NUnitEngine/nunit.engine.tests/Internal/AssemblyHelperTests.cs index eba8ea61a..5f5f422d8 100644 --- a/src/NUnitEngine/nunit.engine.tests/Internal/AssemblyHelperTests.cs +++ b/src/NUnitEngine/nunit.engine.tests/Internal/AssemblyHelperTests.cs @@ -21,7 +21,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // *********************************************************************** -#if !NETCOREAPP1_1 using System.IO; using NUnit.Framework; @@ -74,4 +73,3 @@ public void GetAssemblyPathFromCodeBase(string uri, string expectedPath) } } } -#endif \ No newline at end of file diff --git a/src/NUnitEngine/nunit.engine.tests/Internal/SettingsStoreTests.cs b/src/NUnitEngine/nunit.engine.tests/Internal/SettingsStoreTests.cs index f202cc232..72201808c 100644 --- a/src/NUnitEngine/nunit.engine.tests/Internal/SettingsStoreTests.cs +++ b/src/NUnitEngine/nunit.engine.tests/Internal/SettingsStoreTests.cs @@ -21,7 +21,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // *********************************************************************** -#if !NETCOREAPP1_1 using System; using System.IO; using System.Xml.Schema; @@ -107,4 +106,3 @@ public void SaveSettingsDoesNotOverwriteExistingFileWhenFailing() } } } -#endif \ No newline at end of file diff --git a/src/NUnitEngine/nunit.engine.tests/Runners/DirectTestRunnerTests.cs b/src/NUnitEngine/nunit.engine.tests/Runners/DirectTestRunnerTests.cs index 68bd1bb68..a4528f856 100644 --- a/src/NUnitEngine/nunit.engine.tests/Runners/DirectTestRunnerTests.cs +++ b/src/NUnitEngine/nunit.engine.tests/Runners/DirectTestRunnerTests.cs @@ -44,10 +44,8 @@ public void Initialize() var driverService = Substitute.For(); driverService.GetDriver( -#if !NETCOREAPP1_1 AppDomain.CurrentDomain, string.Empty, -#endif string.Empty, false).ReturnsForAnyArgs(_driver); diff --git a/src/NUnitEngine/nunit.engine.tests/Runners/Fakes/EmptyDirectTestRunner.cs b/src/NUnitEngine/nunit.engine.tests/Runners/Fakes/EmptyDirectTestRunner.cs index 42d9b2bd5..005c9efd0 100644 --- a/src/NUnitEngine/nunit.engine.tests/Runners/Fakes/EmptyDirectTestRunner.cs +++ b/src/NUnitEngine/nunit.engine.tests/Runners/Fakes/EmptyDirectTestRunner.cs @@ -9,9 +9,7 @@ internal class EmptyDirectTestRunner : Engine.Runners.DirectTestRunner { public EmptyDirectTestRunner(IServiceLocator services, TestPackage package) : base(services, package) { -#if !NETCOREAPP1_1 TestDomain = AppDomain.CurrentDomain; -#endif } public new void LoadPackage() diff --git a/src/NUnitEngine/nunit.engine.tests/Runners/MasterTestRunnerTests.cs b/src/NUnitEngine/nunit.engine.tests/Runners/MasterTestRunnerTests.cs index b62c60ff2..bf934ac8e 100644 --- a/src/NUnitEngine/nunit.engine.tests/Runners/MasterTestRunnerTests.cs +++ b/src/NUnitEngine/nunit.engine.tests/Runners/MasterTestRunnerTests.cs @@ -75,13 +75,7 @@ public MasterTestRunnerTests(TestRunData testRunData) // 1. These tests document current behavior. In some cases we may want to change that behavior. // 2. The .NET Standard builds don't seem to handle notest-assembly correctly, so those entries are commented out. // 3. The .NET Standard 1.6 build is not intended to handle projects. -#if NETCOREAPP1_1 - new TestRunData( "mock-assembly.dll", MockAssemblyData ), - new TestRunData( "mock-assembly.dll,mock-assembly.dll", MockAssemblyData, MockAssemblyData ), - //new TestRunData( "notest-assembly.dll", NoTestAssemblyData ), - //new TestRunData( "notest-assembly.dll,notest-assembly.dll", NoTestAssemblyData, NoTestAssemblyData ), - //new TestRunData( "mock-assembly.dll,notest-assembly.dll", MockAssemblyData, NoTestAssemblyData ) -#elif NETCOREAPP2_1 || NETCOREAPP3_1 +#if NETCOREAPP2_1 || NETCOREAPP3_1 new TestRunData( "mock-assembly.dll", MockAssemblyData ), new TestRunData( "mock-assembly.dll,mock-assembly.dll", MockAssemblyData, MockAssemblyData ), //new TestRunData( "notest-assembly.dll", NoTestAssemblyData ), @@ -112,7 +106,6 @@ public void Initialize() // Add all services needed _services = new ServiceContext(); -#if !NETCOREAPP1_1 _services.Add(new ExtensionService()); var projectService = new FakeProjectService(); var mockPath = Path.Combine(TestContext.CurrentContext.TestDirectory, "mock-assembly.dll"); @@ -122,7 +115,6 @@ public void Initialize() projectService.Add("project3.nunit", notestsPath); projectService.Add("project4.nunit", notestsPath, notestsPath); _services.Add(projectService); -#endif #if NETFRAMEWORK _services.Add(new DomainManager()); _services.Add(new RuntimeFrameworkService()); @@ -200,7 +192,6 @@ public void Run() CheckTestRunEvents(); } -#if !NETCOREAPP1_1 [Test] public void RunAsync() { @@ -215,7 +206,6 @@ public void RunAsync() CheckTestRunEvents(); } -#endif private void CheckResult(XmlNode result, ResultData expected) { @@ -300,9 +290,7 @@ private void CheckTestRunEvents() Assert.That(startRun.GetAttribute("clr-version"), Is.Not.Null, "Incorrect clr-version in start-run event"); Assert.That(startRun.GetAttribute("start-time", DateTime.Now.AddDays(-2)), Is.GreaterThan(DateTime.Now.AddDays(-1)), "Incorrect start-time in start-run event"); Assert.That(startRun.GetAttribute("count", -1), Is.EqualTo(_testRunData.Tests), "Incorrect count in start-run event"); -#if !NETSTANDARD1_6 && !NETCOREAPP1_1 Assert.That(startRun.FirstChild.Name, Is.EqualTo("command-line"), "First child of start-run should be command-line"); -#endif Assert.That(_events[_events.Count - 1].Name, Is.EqualTo("test-run"), "Last event should be test-run"); Assert.That(_events.Count(x => x.Name == "start-run"), Is.EqualTo(1), "More than one start-run event"); diff --git a/src/NUnitEngine/nunit.engine.tests/Runners/ParallelTaskWorkerPoolTests.cs b/src/NUnitEngine/nunit.engine.tests/Runners/ParallelTaskWorkerPoolTests.cs index 1a4bdbf42..c8e9a9705 100644 --- a/src/NUnitEngine/nunit.engine.tests/Runners/ParallelTaskWorkerPoolTests.cs +++ b/src/NUnitEngine/nunit.engine.tests/Runners/ParallelTaskWorkerPoolTests.cs @@ -21,7 +21,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // *********************************************************************** -#if !NETCOREAPP1_1 using System; using System.Threading; using NUnit.Framework; @@ -158,4 +157,3 @@ public void MarkTaskAsCompleted() } } } -#endif \ No newline at end of file diff --git a/src/NUnitEngine/nunit.engine.tests/Runners/TestEngineRunnerTests.cs b/src/NUnitEngine/nunit.engine.tests/Runners/TestEngineRunnerTests.cs index a97e7a0b3..a4532738f 100644 --- a/src/NUnitEngine/nunit.engine.tests/Runners/TestEngineRunnerTests.cs +++ b/src/NUnitEngine/nunit.engine.tests/Runners/TestEngineRunnerTests.cs @@ -67,10 +67,8 @@ public void Initialize() { // Add all services needed by any of our TestEngineRunners _services = new ServiceContext(); -#if !NETCOREAPP1_1 _services.Add(new Services.ExtensionService()); _services.Add(new Services.ProjectService()); -#endif #if NETFRAMEWORK _services.Add(new Services.DomainManager()); _services.Add(new Services.RuntimeFrameworkService()); @@ -135,7 +133,6 @@ public void Run() CheckPackageLoading(); } -#if !NETCOREAPP1_1 [Test] public void RunAsync() { @@ -151,7 +148,6 @@ public void RunAsync() CheckRunResult(asyncResult.EngineResult); CheckPackageLoading(); } -#endif private void CheckPackageLoading() { diff --git a/src/NUnitEngine/nunit.engine.tests/Services/AgentProcessTests.cs b/src/NUnitEngine/nunit.engine.tests/Services/AgentProcessTests.cs index 55e45fbea..fc59bfc3d 100644 --- a/src/NUnitEngine/nunit.engine.tests/Services/AgentProcessTests.cs +++ b/src/NUnitEngine/nunit.engine.tests/Services/AgentProcessTests.cs @@ -40,8 +40,6 @@ public void SetUp() [TestCase("net-2.0", true, "../agents/net20/nunit-agent-x86.exe")] //[TestCase("netcore-2.1", false, "agents/netcoreapp2.1/testcentric-agent.dll")] //[TestCase("netcore-2.1", true, "agents/netcoreapp2.1/testcentric-agent-x86.dll")] - //[TestCase("netcore-1.1", false, "agents/netcoreapp1.1/testcentric-agent.dll")] - //[TestCase("netcore-1.1", true, "agents/netcoreapp1.1/testcentric-agent-x86.dll")] public void AgentSelection(string runtime, bool x86, string agentPath) { _package.Settings[EnginePackageSettings.TargetRuntimeFramework] = runtime; diff --git a/src/NUnitEngine/nunit.engine.tests/Services/AgentStoreTests.DummyTestAgent.cs b/src/NUnitEngine/nunit.engine.tests/Services/AgentStoreTests.DummyTestAgent.cs index 4fa0e44bf..61e46d71c 100644 --- a/src/NUnitEngine/nunit.engine.tests/Services/AgentStoreTests.DummyTestAgent.cs +++ b/src/NUnitEngine/nunit.engine.tests/Services/AgentStoreTests.DummyTestAgent.cs @@ -21,7 +21,7 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // *********************************************************************** -#if !NETCOREAPP1_1 && !NETCOREAPP2_0 +#if !NETCOREAPP2_0 using System; namespace NUnit.Engine.Services.Tests diff --git a/src/NUnitEngine/nunit.engine.tests/Services/DriverServiceTests.cs b/src/NUnitEngine/nunit.engine.tests/Services/DriverServiceTests.cs index ba1a074d5..eade33b4f 100644 --- a/src/NUnitEngine/nunit.engine.tests/Services/DriverServiceTests.cs +++ b/src/NUnitEngine/nunit.engine.tests/Services/DriverServiceTests.cs @@ -39,9 +39,7 @@ public class DriverServiceTests public void CreateDriverFactory() { var serviceContext = new ServiceContext(); -#if !NETCOREAPP1_1 serviceContext.Add(new ExtensionService()); -#endif _driverService = new DriverService(); serviceContext.Add(_driverService); serviceContext.ServiceManager.StartServices(); @@ -58,7 +56,7 @@ public void ServiceIsStarted() [TestCase("mock-assembly.dll", false, typeof(NUnitNetCore31Driver))] [TestCase("mock-assembly.dll", true, typeof(NUnitNetCore31Driver))] [TestCase("notest-assembly.dll", false, typeof(NUnitNetCore31Driver))] -#elif NETCOREAPP1_1 || NETCOREAPP2_1 +#elif NETCOREAPP2_1 [TestCase("mock-assembly.dll", false, typeof(NUnitNetStandardDriver))] [TestCase("mock-assembly.dll", true, typeof(NUnitNetStandardDriver))] [TestCase("notest-assembly.dll", false, typeof(NUnitNetStandardDriver))] @@ -76,11 +74,7 @@ public void ServiceIsStarted() [TestCase("notest-assembly.dll", true, typeof(SkippedAssemblyFrameworkDriver))] public void CorrectDriverIsUsed(string fileName, bool skipNonTestAssemblies, Type expectedType) { -#if NETCOREAPP1_1 - var driver = _driverService.GetDriver(Path.Combine(TestContext.CurrentContext.TestDirectory, fileName), skipNonTestAssemblies); -#else var driver = _driverService.GetDriver(AppDomain.CurrentDomain, Path.Combine(TestContext.CurrentContext.TestDirectory, fileName), null, skipNonTestAssemblies); -#endif Assert.That(driver, Is.InstanceOf(expectedType)); } } diff --git a/src/NUnitEngine/nunit.engine.tests/Services/ExtensionServiceTests.cs b/src/NUnitEngine/nunit.engine.tests/Services/ExtensionServiceTests.cs index d32909364..dcb300668 100644 --- a/src/NUnitEngine/nunit.engine.tests/Services/ExtensionServiceTests.cs +++ b/src/NUnitEngine/nunit.engine.tests/Services/ExtensionServiceTests.cs @@ -21,7 +21,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // *********************************************************************** -#if !NETCOREAPP1_1 using System; using System.Linq; using NUnit.Framework; @@ -289,4 +288,3 @@ private static string GetSiblingDirectory(string dir) } } } -#endif diff --git a/src/NUnitEngine/nunit.engine.tests/Services/ProjectServiceTests.cs b/src/NUnitEngine/nunit.engine.tests/Services/ProjectServiceTests.cs index 1f1430a40..efc3253b4 100644 --- a/src/NUnitEngine/nunit.engine.tests/Services/ProjectServiceTests.cs +++ b/src/NUnitEngine/nunit.engine.tests/Services/ProjectServiceTests.cs @@ -21,7 +21,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // *********************************************************************** -#if !NETCOREAPP1_1 using System; using System.Collections.Generic; using System.Text; @@ -50,4 +49,3 @@ public void ServiceIsStarted() } } } -#endif \ No newline at end of file diff --git a/src/NUnitEngine/nunit.engine.tests/Services/ResultServiceTests.cs b/src/NUnitEngine/nunit.engine.tests/Services/ResultServiceTests.cs index 6716b5833..aee596714 100644 --- a/src/NUnitEngine/nunit.engine.tests/Services/ResultServiceTests.cs +++ b/src/NUnitEngine/nunit.engine.tests/Services/ResultServiceTests.cs @@ -36,9 +36,7 @@ public class ResultServiceTests public void CreateService() { var services = new ServiceContext(); -#if !NETCOREAPP1_1 services.Add(new ExtensionService()); -#endif _resultService = new ResultService(); services.Add(_resultService); services.ServiceManager.StartServices(); @@ -53,11 +51,7 @@ public void ServiceIsStarted() [Test] public void AvailableFormats() { -#if NETCOREAPP1_1 - Assert.That(_resultService.Formats, Is.EquivalentTo(new string[] { "nunit3", "cases" })); -#else Assert.That(_resultService.Formats, Is.EquivalentTo(new string[] { "nunit3", "cases", "user" })); -#endif } [TestCase("nunit3", null, ExpectedResult = "NUnit3XmlResultWriter")] diff --git a/src/NUnitEngine/nunit.engine.tests/Services/ResultWriters/XmlTransformResultWriterTests.cs b/src/NUnitEngine/nunit.engine.tests/Services/ResultWriters/XmlTransformResultWriterTests.cs index e976ee74d..a8dab967c 100644 --- a/src/NUnitEngine/nunit.engine.tests/Services/ResultWriters/XmlTransformResultWriterTests.cs +++ b/src/NUnitEngine/nunit.engine.tests/Services/ResultWriters/XmlTransformResultWriterTests.cs @@ -21,7 +21,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // *********************************************************************** -#if !NETCOREAPP1_1 using System.IO; using System.Xml; using NUnit.Engine.Runners; @@ -88,4 +87,3 @@ private static string GetLocalPath(string fileName) } } } -#endif \ No newline at end of file diff --git a/src/NUnitEngine/nunit.engine.tests/Services/ServiceDependencyTests.cs b/src/NUnitEngine/nunit.engine.tests/Services/ServiceDependencyTests.cs index de44f1389..f4ce0dcdf 100644 --- a/src/NUnitEngine/nunit.engine.tests/Services/ServiceDependencyTests.cs +++ b/src/NUnitEngine/nunit.engine.tests/Services/ServiceDependencyTests.cs @@ -73,7 +73,6 @@ public void DefaultTestRunnerFactory_ProjectServiceError() Assert.That(service.Status, Is.EqualTo(ServiceStatus.Error)); } -#if !NETCOREAPP1_1 [Test] public void DefaultTestRunnerFactory_ProjectServiceMissing() { @@ -82,6 +81,5 @@ public void DefaultTestRunnerFactory_ProjectServiceMissing() service.StartService(); Assert.That(service.Status, Is.EqualTo(ServiceStatus.Error)); } -#endif } } diff --git a/src/NUnitEngine/nunit.engine.tests/Services/TestFilteringTests.cs b/src/NUnitEngine/nunit.engine.tests/Services/TestFilteringTests.cs index cfe1f8e36..4b08e2cad 100644 --- a/src/NUnitEngine/nunit.engine.tests/Services/TestFilteringTests.cs +++ b/src/NUnitEngine/nunit.engine.tests/Services/TestFilteringTests.cs @@ -35,7 +35,7 @@ public class TestFilteringTests { private const string MOCK_ASSEMBLY = "mock-assembly.dll"; -#if NETCOREAPP1_1 || NETCOREAPP2_1 +#if NETCOREAPP2_1 private NUnitNetStandardDriver _driver; #elif NETCOREAPP3_1 private NUnitNetCore31Driver _driver; @@ -47,7 +47,7 @@ public class TestFilteringTests public void LoadAssembly() { var mockAssemblyPath = System.IO.Path.Combine(TestContext.CurrentContext.TestDirectory, MOCK_ASSEMBLY); -#if NETCOREAPP1_1 || NETCOREAPP2_1 +#if NETCOREAPP2_1 _driver = new NUnitNetStandardDriver(); #elif NETCOREAPP3_1 _driver = new NUnitNetCore31Driver(); diff --git a/src/NUnitEngine/nunit.engine.tests/Services/TestRunnerFactoryTests/RunnerSelectionTests.cs b/src/NUnitEngine/nunit.engine.tests/Services/TestRunnerFactoryTests/RunnerSelectionTests.cs index 98d1af79b..0dfbe8d0a 100644 --- a/src/NUnitEngine/nunit.engine.tests/Services/TestRunnerFactoryTests/RunnerSelectionTests.cs +++ b/src/NUnitEngine/nunit.engine.tests/Services/TestRunnerFactoryTests/RunnerSelectionTests.cs @@ -45,14 +45,12 @@ public class RunnerSelectionTests public void SetUp() { _services = new ServiceContext(); -#if !NETCOREAPP1_1 _services.Add(new ExtensionService()); var projectService = new FakeProjectService(); ((IService)projectService).StartService(); projectService.Add(TestPackageFactory.FakeProject, "a.dll", "b.dll"); _services.Add(projectService); Assert.That(((IService)projectService).Status, Is.EqualTo(ServiceStatus.Started)); -#endif _factory = new DefaultTestRunnerFactory(); _services.Add(_factory); _factory.StartService(); @@ -92,3 +90,4 @@ private static RunnerResult GetRunnerResult(ITestEngineRunner runner) #endif } } + diff --git a/src/NUnitEngine/nunit.engine.tests/Services/TestRunnerFactoryTests/TestCases/NetStandardTestCases.cs b/src/NUnitEngine/nunit.engine.tests/Services/TestRunnerFactoryTests/TestCases/NetStandardTestCases.cs index 07227a5ff..e44a6c18d 100644 --- a/src/NUnitEngine/nunit.engine.tests/Services/TestRunnerFactoryTests/TestCases/NetStandardTestCases.cs +++ b/src/NUnitEngine/nunit.engine.tests/Services/TestRunnerFactoryTests/TestCases/NetStandardTestCases.cs @@ -68,7 +68,6 @@ public static IEnumerable TestCases } }); -#if !NETCOREAPP1_1 yield return new TestRunnerFactoryData( "SingleProject (list ctor)", new TestPackage(new[] { "a.nunit" }), @@ -221,7 +220,6 @@ public static IEnumerable TestCases } } ); -#endif } } } diff --git a/src/NUnitEngine/nunit.engine.tests/nunit.engine.tests.csproj b/src/NUnitEngine/nunit.engine.tests/nunit.engine.tests.csproj index 5fb9e0a1d..9ce87fe3c 100644 --- a/src/NUnitEngine/nunit.engine.tests/nunit.engine.tests.csproj +++ b/src/NUnitEngine/nunit.engine.tests/nunit.engine.tests.csproj @@ -1,7 +1,7 @@  NUnit.Engine.Tests - net35;netcoreapp1.1;netcoreapp2.1;netcoreapp3.1 + net35;netcoreapp2.1;netcoreapp3.1 Exe true ..\..\nunit.snk @@ -14,12 +14,6 @@ - - - - - - diff --git a/src/NUnitEngine/nunit.engine/Internal/ProcessModel.cs b/src/NUnitEngine/nunit.engine/Internal/ProcessModel.cs index 0a2fe70d8..62c8f987b 100644 --- a/src/NUnitEngine/nunit.engine/Internal/ProcessModel.cs +++ b/src/NUnitEngine/nunit.engine/Internal/ProcessModel.cs @@ -21,7 +21,7 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // *********************************************************************** -#if !NETSTANDARD1_6 && !NETSTANDARD2_0 +#if !NETSTANDARD2_0 using System; namespace NUnit.Engine.Internal diff --git a/src/NUnitEngine/nunit.engine/Internal/SettingsStore.cs b/src/NUnitEngine/nunit.engine/Internal/SettingsStore.cs index c5f06636f..327836740 100644 --- a/src/NUnitEngine/nunit.engine/Internal/SettingsStore.cs +++ b/src/NUnitEngine/nunit.engine/Internal/SettingsStore.cs @@ -27,9 +27,6 @@ using System.IO; using System.Text; using System.Xml; -#if NETSTANDARD1_6 -using System.Xml.Linq; -#endif namespace NUnit.Engine.Internal { @@ -104,29 +101,6 @@ public void SaveSettings() if (!Directory.Exists(dirPath)) Directory.CreateDirectory(dirPath); -#if NETSTANDARD1_6 - var settings = new XElement("Settings"); - - List keys = new List(_settings.Keys); - keys.Sort(); - - foreach (string name in keys) - { - object val = GetSetting(name); - if (val != null) - { - settings.Add(new XElement("Setting", - new XAttribute("name", name), - new XAttribute("value", TypeDescriptor.GetConverter(val.GetType()).ConvertToInvariantString(val)) - )); - } - } - var doc = new XDocument(new XElement("NUnitSettings", settings)); - using (var file = new FileStream(_settingsFile, FileMode.Create, FileAccess.Write)) - { - doc.Save(file); - } -#else var stream = new MemoryStream(); using (var writer = new XmlTextWriter(stream, Encoding.UTF8)) { @@ -161,7 +135,6 @@ public void SaveSettings() var contents = reader.ReadToEnd(); File.WriteAllText(_settingsFile, contents, Encoding.UTF8); } -#endif } catch (Exception) { diff --git a/src/NUnitEngine/nunit.engine/Properties/AssemblyInfo.cs b/src/NUnitEngine/nunit.engine/Properties/AssemblyInfo.cs index fd876709e..67fe3f222 100644 --- a/src/NUnitEngine/nunit.engine/Properties/AssemblyInfo.cs +++ b/src/NUnitEngine/nunit.engine/Properties/AssemblyInfo.cs @@ -5,13 +5,8 @@ // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. -#if NETSTANDARD1_6 -[assembly: AssemblyTitle("NUnit .NET Standard Engine")] -[assembly: AssemblyDescription("Provides a common interface for loading, exploring and running NUnit tests in .NET Core and .NET Standard")] -#else [assembly: AssemblyTitle("NUnit Engine")] [assembly: AssemblyDescription("Provides a common interface for loading, exploring and running NUnit tests")] -#endif [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible diff --git a/src/NUnitEngine/nunit.engine/Runners/MasterTestRunner.cs b/src/NUnitEngine/nunit.engine/Runners/MasterTestRunner.cs index 5a7930804..ea912695e 100644 --- a/src/NUnitEngine/nunit.engine/Runners/MasterTestRunner.cs +++ b/src/NUnitEngine/nunit.engine/Runners/MasterTestRunner.cs @@ -55,9 +55,7 @@ public class MasterTestRunner : ITestRunner private ITestEngineRunner _engineRunner; private readonly IServiceLocator _services; -#if !NETSTANDARD1_6 private readonly ExtensionService _extensionService; -#endif #if NETFRAMEWORK private readonly IRuntimeFrameworkService _runtimeService; #endif @@ -80,9 +78,7 @@ public MasterTestRunner(IServiceLocator services, TestPackage package) #if NETFRAMEWORK _runtimeService = _services.GetService(); #endif -#if !NETSTANDARD1_6 _extensionService = _services.GetService(); -#endif // Last chance to catch invalid settings in package, // in case the client runner missed them. @@ -171,7 +167,6 @@ public XmlNode Run(ITestEventListener listener, TestFilter filter) } -#if !NETSTANDARD1_6 /// /// Start a run of the tests in the loaded TestPackage. The tests are run /// asynchronously and the listener interface is notified as it progresses. @@ -183,7 +178,6 @@ public ITestRun RunAsync(ITestEventListener listener, TestFilter filter) { return RunTestsAsync(listener, filter); } -#endif /// /// Cancel the ongoing test run. If no test is running, the call is ignored. @@ -434,23 +428,17 @@ private TestEngineResult RunTests(ITestEventListener listener, TestFilter filter var eventDispatcher = new TestEventDispatcher(); if (listener != null) eventDispatcher.Listeners.Add(listener); -#if !NETSTANDARD1_6 + foreach (var extension in _extensionService.GetExtensions()) eventDispatcher.Listeners.Add(extension); -#endif IsTestRunning = true; string clrVersion; string engineVersion; -#if !NETSTANDARD1_6 clrVersion = Environment.Version.ToString(); engineVersion = Assembly.GetExecutingAssembly().GetName().Version.ToString(); -#else - clrVersion = Microsoft.DotNet.InternalAbstractions.RuntimeEnvironment.GetRuntimeIdentifier(); - engineVersion = typeof(MasterTestRunner).GetTypeInfo().Assembly.GetName().Version.ToString(); -#endif var startTime = DateTime.UtcNow; var startRunNode = XmlHelper.CreateTopLevelElement("start-run"); @@ -459,9 +447,7 @@ private TestEngineResult RunTests(ITestEventListener listener, TestFilter filter startRunNode.AddAttribute("engine-version", engineVersion); startRunNode.AddAttribute("clr-version", clrVersion); -#if !NETSTANDARD1_6 InsertCommandLineElement(startRunNode); -#endif eventDispatcher.OnTestEvent(startRunNode.OuterXml); @@ -472,9 +458,7 @@ private TestEngineResult RunTests(ITestEventListener listener, TestFilter filter // These are inserted in reverse order, since each is added as the first child. InsertFilterElement(result.Xml, filter); -#if !NETSTANDARD1_6 InsertCommandLineElement(result.Xml); -#endif result.Xml.AddAttribute("engine-version", engineVersion); result.Xml.AddAttribute("clr-version", clrVersion); @@ -490,7 +474,6 @@ private TestEngineResult RunTests(ITestEventListener listener, TestFilter filter return result; } -#if !NETSTANDARD1_6 private AsyncTestEngineResult RunTestsAsync(ITestEventListener listener, TestFilter filter) { var testRun = new AsyncTestEngineResult(); @@ -524,7 +507,6 @@ private static void InsertCommandLineElement(XmlNode resultNode) var cdata = doc.CreateCDataSection(Environment.CommandLine); cmd.AppendChild(cdata); } -#endif private static void InsertFilterElement(XmlNode resultNode, TestFilter filter) { diff --git a/src/NUnitEngine/nunit.engine/Runners/TestEventDispatcher.cs b/src/NUnitEngine/nunit.engine/Runners/TestEventDispatcher.cs index 1c3e914be..4f2181fb5 100644 --- a/src/NUnitEngine/nunit.engine/Runners/TestEventDispatcher.cs +++ b/src/NUnitEngine/nunit.engine/Runners/TestEventDispatcher.cs @@ -29,11 +29,7 @@ namespace NUnit.Engine.Runners /// /// TestEventDispatcher is used to send test events to a number of listeners /// - public class TestEventDispatcher : -#if !NETSTANDARD1_6 - MarshalByRefObject, -#endif - ITestEventListener + public class TestEventDispatcher : MarshalByRefObject, ITestEventListener { private object _eventLock = new object(); @@ -53,11 +49,9 @@ public void OnTestEvent(string report) } } -#if !NETSTANDARD1_6 public override object InitializeLifetimeService() { return null; } -#endif } } diff --git a/src/NUnitEngine/nunit.engine/Services/AgentStatus.cs b/src/NUnitEngine/nunit.engine/Services/AgentStatus.cs index cd08fe363..0fbc3a34b 100644 --- a/src/NUnitEngine/nunit.engine/Services/AgentStatus.cs +++ b/src/NUnitEngine/nunit.engine/Services/AgentStatus.cs @@ -21,7 +21,7 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // *********************************************************************** -#if !NETSTANDARD1_6 && !NETSTANDARD2_0 +#if !NETSTANDARD2_0 namespace NUnit.Engine.Services { /// diff --git a/src/NUnitEngine/nunit.engine/Services/AgentStore.AgentRecord.cs b/src/NUnitEngine/nunit.engine/Services/AgentStore.AgentRecord.cs index 07a5bc813..e0569dc68 100644 --- a/src/NUnitEngine/nunit.engine/Services/AgentStore.AgentRecord.cs +++ b/src/NUnitEngine/nunit.engine/Services/AgentStore.AgentRecord.cs @@ -21,7 +21,7 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // *********************************************************************** -#if !NETSTANDARD1_6 && !NETSTANDARD2_0 +#if !NETSTANDARD2_0 using System; using System.Diagnostics; diff --git a/src/NUnitEngine/nunit.engine/Services/AgentStore.cs b/src/NUnitEngine/nunit.engine/Services/AgentStore.cs index dae8e2765..8da83f48d 100644 --- a/src/NUnitEngine/nunit.engine/Services/AgentStore.cs +++ b/src/NUnitEngine/nunit.engine/Services/AgentStore.cs @@ -21,7 +21,7 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // *********************************************************************** -#if !NETSTANDARD1_6 && !NETSTANDARD2_0 +#if !NETSTANDARD2_0 using System; using System.Collections.Generic; using System.Diagnostics; diff --git a/src/NUnitEngine/nunit.engine/Services/DefaultTestRunnerFactory.cs b/src/NUnitEngine/nunit.engine/Services/DefaultTestRunnerFactory.cs index 136ea67bc..9355b9465 100644 --- a/src/NUnitEngine/nunit.engine/Services/DefaultTestRunnerFactory.cs +++ b/src/NUnitEngine/nunit.engine/Services/DefaultTestRunnerFactory.cs @@ -33,13 +33,10 @@ namespace NUnit.Engine.Services /// public class DefaultTestRunnerFactory : InProcessTestRunnerFactory, ITestRunnerFactory { -#if !NETSTANDARD1_6 private IProjectService _projectService; -#endif public override void StartService() { -#if !NETSTANDARD1_6 // TestRunnerFactory requires the ProjectService _projectService = ServiceContext.GetService(); @@ -47,9 +44,6 @@ public override void StartService() Status = _projectService != null && ((IService)_projectService).Status == ServiceStatus.Started ? ServiceStatus.Started : ServiceStatus.Error; -#else - Status = ServiceStatus.Started; -#endif } /// diff --git a/src/NUnitEngine/nunit.engine/Services/ProjectService.cs b/src/NUnitEngine/nunit.engine/Services/ProjectService.cs index 7971a2772..8933ca02a 100644 --- a/src/NUnitEngine/nunit.engine/Services/ProjectService.cs +++ b/src/NUnitEngine/nunit.engine/Services/ProjectService.cs @@ -21,7 +21,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // *********************************************************************** -#if !NETSTANDARD1_6 using System.Collections.Generic; using System.IO; using NUnit.Common; @@ -167,4 +166,3 @@ private ExtensionNode GetNodeForPath(string path) } } } -#endif \ No newline at end of file diff --git a/src/NUnitEngine/nunit.engine/Services/ResultService.cs b/src/NUnitEngine/nunit.engine/Services/ResultService.cs index 4564b733b..1a030fb0f 100644 --- a/src/NUnitEngine/nunit.engine/Services/ResultService.cs +++ b/src/NUnitEngine/nunit.engine/Services/ResultService.cs @@ -29,14 +29,8 @@ namespace NUnit.Engine.Services { public class ResultService : Service, IResultService { -#if NETSTANDARD1_6 - private readonly string[] BUILT_IN_FORMATS = new string[] { "nunit3", "cases" }; -#else private readonly string[] BUILT_IN_FORMATS = new string[] { "nunit3", "cases", "user" }; -#endif -#if !NETSTANDARD1_6 private IEnumerable _extensionNodes; -#endif private string[] _formats; public string[] Formats @@ -47,11 +41,9 @@ public string[] Formats { var formatList = new List(BUILT_IN_FORMATS); -#if !NETSTANDARD1_6 foreach (var node in _extensionNodes) foreach (var format in node.GetValues("Format")) formatList.Add(format); -#endif _formats = formatList.ToArray(); } @@ -74,17 +66,14 @@ public IResultWriter GetResultWriter(string format, object[] args) return new NUnit3XmlResultWriter(); case "cases": return new TestCaseResultWriter(); -#if !NETSTANDARD1_6 case "user": return new XmlTransformResultWriter(args); -#endif + default: -#if !NETSTANDARD1_6 foreach (var node in _extensionNodes) foreach (var supported in node.GetValues("Format")) if (supported == format) return node.ExtensionObject as IResultWriter; -#endif return null; } } @@ -93,12 +82,11 @@ public override void StartService() { try { -#if !NETSTANDARD1_6 var extensionService = ServiceContext.GetService(); if (extensionService != null && extensionService.Status == ServiceStatus.Started) _extensionNodes = extensionService.GetExtensionNodes(); -#endif + // If there is no extension service, we start anyway using builtin writers Status = ServiceStatus.Started; } diff --git a/src/NUnitEngine/nunit.engine/Services/ResultWriters/NUnit3XmlResultWriter.cs b/src/NUnitEngine/nunit.engine/Services/ResultWriters/NUnit3XmlResultWriter.cs index 4ac879a7b..d5112b15e 100644 --- a/src/NUnitEngine/nunit.engine/Services/ResultWriters/NUnit3XmlResultWriter.cs +++ b/src/NUnitEngine/nunit.engine/Services/ResultWriters/NUnit3XmlResultWriter.cs @@ -76,12 +76,11 @@ private XmlNode GetStubResult() test.AddAttribute("start-time", DateTime.UtcNow.ToString("u")); doc.AppendChild(test); -#if !NETSTANDARD1_6 var cmd = doc.CreateElement("command-line"); var cdata = doc.CreateCDataSection(Environment.CommandLine); cmd.AppendChild(cdata); test.AppendChild(cmd); -#endif + return doc; } } diff --git a/src/NUnitEngine/nunit.engine/Services/ResultWriters/XmlTransformResultWriter.cs b/src/NUnitEngine/nunit.engine/Services/ResultWriters/XmlTransformResultWriter.cs index bfa9a22dd..3cd0384e4 100644 --- a/src/NUnitEngine/nunit.engine/Services/ResultWriters/XmlTransformResultWriter.cs +++ b/src/NUnitEngine/nunit.engine/Services/ResultWriters/XmlTransformResultWriter.cs @@ -21,7 +21,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // *********************************************************************** -#if !NETSTANDARD1_6 using System; using System.IO; using System.Text; @@ -96,4 +95,3 @@ public void WriteResultFile(XmlNode result, string outputPath) } } } -#endif \ No newline at end of file diff --git a/src/NUnitEngine/nunit.engine/TestEngine.cs b/src/NUnitEngine/nunit.engine/TestEngine.cs index 2a864cb8d..c8465fddb 100644 --- a/src/NUnitEngine/nunit.engine/TestEngine.cs +++ b/src/NUnitEngine/nunit.engine/TestEngine.cs @@ -81,10 +81,8 @@ public void Initialize() Services.Add(new SettingsService(true)); Services.Add(new RecentFilesService()); Services.Add(new TestFilterService()); -#if !NETSTANDARD1_6 Services.Add(new ExtensionService()); Services.Add(new ProjectService()); -#endif #if NETFRAMEWORK Services.Add(new DomainManager()); Services.Add(new RuntimeFrameworkService()); diff --git a/src/NUnitEngine/nunit.engine/nunit.engine.csproj b/src/NUnitEngine/nunit.engine/nunit.engine.csproj index 97960f1f7..343a879b1 100644 --- a/src/NUnitEngine/nunit.engine/nunit.engine.csproj +++ b/src/NUnitEngine/nunit.engine/nunit.engine.csproj @@ -1,7 +1,7 @@  NUnit.Engine - net20;netstandard1.6;netstandard2.0;netcoreapp3.1 + net20;netstandard2.0;netcoreapp3.1 true ..\..\nunit.snk @@ -9,10 +9,7 @@ - - - - +