Skip to content

Commit

Permalink
Eliminate NUnitNetStandardDriver; clean up unused conditionals
Browse files Browse the repository at this point in the history
  • Loading branch information
CharliePoole committed Jan 3, 2025
1 parent 68032ff commit ad9b87e
Show file tree
Hide file tree
Showing 14 changed files with 7 additions and 354 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,23 @@ public interface IDriverFactory
/// <param name="reference">An AssemblyName referring to the possible test framework.</param>
bool IsSupportedTestFramework(AssemblyName reference);

#if NETSTANDARD || NETCOREAPP
#if NETFRAMEWORK
/// <summary>
/// Gets a driver for a given test assembly and a framework
/// which the assembly is already known to reference.
/// </summary>
/// <param name="domain">The domain in which the assembly will be loaded</param>
/// <param name="reference">An AssemblyName referring to the test framework.</param>
/// <returns></returns>
IFrameworkDriver GetDriver(AssemblyName reference);
IFrameworkDriver GetDriver(AppDomain domain, AssemblyName reference);
#else
/// <summary>
/// Gets a driver for a given test assembly and a framework
/// which the assembly is already known to reference.
/// </summary>
/// <param name="domain">The domain in which the assembly will be loaded</param>
/// <param name="reference">An AssemblyName referring to the test framework.</param>
/// <returns></returns>
IFrameworkDriver GetDriver(AppDomain domain, AssemblyName reference);
IFrameworkDriver GetDriver(AssemblyName reference);
#endif
}
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,10 @@ public void CorrectDriverIsUsed(string fileName, bool skipNonTestAssemblies, Typ
new TestCaseData("mock-assembly.dll", false, typeof(NUnitNetCore31Driver)),
new TestCaseData("mock-assembly.dll", true, typeof(NUnitNetCore31Driver)),
//new TestCaseData("notest-assembly.dll", false, typeof(NUnitNetCore31Driver)),
#elif NETCOREAPP3_1
#else
new TestCaseData("mock-assembly.dll", false, typeof(NUnitNetCore31Driver)),
new TestCaseData("mock-assembly.dll", true, typeof(NUnitNetCore31Driver)),
//new TestCaseData("notest-assembly.dll", false, typeof(NUnitNetCore31Driver)),
// TODO: This is never used. We need to test net standard driver in some way, possibly
// by forcing it's use in a separate test.
#elif NETCOREAPP2_1
new TestCaseData("mock-assembly.dll", false, typeof(NUnitNetStandardDriver)),
new TestCaseData("mock-assembly.dll", true, typeof(NUnitNetStandardDriver)),
new TestCaseData("notest-assembly.dll", false, typeof(NUnitNetStandardDriver)),
#endif
// Invalid cases should work with all target runtimes
new TestCaseData("mock-assembly.pdb", false, typeof(InvalidAssemblyFrameworkDriver)),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,8 @@ public IFrameworkDriver GetDriver(AppDomain domain, AssemblyName reference)
public IFrameworkDriver GetDriver(AssemblyName reference)
{
Guard.ArgumentValid(IsSupportedTestFramework(reference), "Invalid framework", "reference");
#if NETSTANDARD
log.Info("Using NUnitNetStandardDriver");
return new NUnitNetStandardDriver();
#else
log.Info("Using NUnitNetCore31Driver");
return new NUnitNetCore31Driver();
#endif
}
#endif
}
Expand Down
187 changes: 0 additions & 187 deletions src/NUnitEngine/nunit.engine.core/Drivers/NUnitNetStandardDriver.cs

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Copyright (c) Charlie Poole, Rob Prouse and Contributors. MIT License - see LICENSE.txt

#if !NETSTANDARD2_0
using System;
using System.Collections.Generic;
using System.Reflection;
Expand Down Expand Up @@ -63,4 +62,3 @@ private static void WriteAssemblyInformation(StringBuilder sb, Assembly assembly
}
}
}
#endif
2 changes: 1 addition & 1 deletion src/NUnitEngine/nunit.engine.core/Internal/PathUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ public static bool IsValidPath(string path)
try
{
var info = GetFileSystemInfo(path);
#if NETCOREAPP2_1_OR_GREATER
#if NETCOREAPP
var creation = info.CreationTime;
#endif
return true; // Whether it exists or not!
Expand Down
Loading

0 comments on commit ad9b87e

Please sign in to comment.