Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Eliminate NUnitNetStandardDriver; clean up unused conditionals #1595

Merged
merged 1 commit into from
Jan 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading