Skip to content

Commit

Permalink
Implement an algorithm to find extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
CharliePoole committed Oct 21, 2024
1 parent 0ec572c commit 7f19ef7
Show file tree
Hide file tree
Showing 17 changed files with 66 additions and 130 deletions.
2 changes: 1 addition & 1 deletion GitVersion.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
next-version: 3.18.0
next-version: 3.19.0
mode: ContinuousDelivery
legacy-semver-padding: 5
build-metadata-padding: 5
Expand Down
10 changes: 1 addition & 9 deletions NUnitConsole.sln
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "choco", "choco", "{4FDF7BFA
choco\nunit-agent-x86.exe.ignore = choco\nunit-agent-x86.exe.ignore
choco\nunit-agent.exe.ignore = choco\nunit-agent.exe.ignore
choco\nunit-console-runner.nuspec = choco\nunit-console-runner.nuspec
choco\nunit.console.choco.addins = choco\nunit.console.choco.addins
choco\nunit.console.choco.agent.addins = choco\nunit.console.choco.agent.addins
choco\VERIFICATION.txt = choco\VERIFICATION.txt
EndProjectSection
EndProject
Expand Down Expand Up @@ -147,14 +145,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "InvalidTestNames", "src\Tes
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AppContextTest", "src\TestData\AppContextTest\AppContextTest.csproj", "{E43A3E4B-B050-471B-B43C-0DF60FD44376}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "net8.0", "net8.0", "{303CF83E-2A87-4882-8CAC-3EB59AAD81FC}"
ProjectSection(SolutionItems) = preProject
nuget\runners\net8.0\DotnetToolSettings.xml = nuget\runners\net8.0\DotnetToolSettings.xml
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "mock-assembly-v2", "src\TestData\mock-assembly-v2\mock-assembly-v2.csproj", "{AD40CA55-35CC-41CA-85F5-8FDA4ECAFF78}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FakeExtensions", "src\TestData\FakeExtensions\FakeExtensions.csproj", "{D6C217E0-BFB7-4C80-8D50-C969F46EBC59}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FakeExtensions", "src\TestData\FakeExtensions\FakeExtensions.csproj", "{D6C217E0-BFB7-4C80-8D50-C969F46EBC59}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down Expand Up @@ -276,7 +269,6 @@ Global
{6B550F25-1CA5-4F3E-B631-1ECCD4CB94E4} = {2ECE1CFB-9436-4149-B7E4-1FB1786FDE9F}
{58E18ACC-1F7E-4395-817E-E7EF943E0C77} = {2ECE1CFB-9436-4149-B7E4-1FB1786FDE9F}
{E43A3E4B-B050-471B-B43C-0DF60FD44376} = {2ECE1CFB-9436-4149-B7E4-1FB1786FDE9F}
{303CF83E-2A87-4882-8CAC-3EB59AAD81FC} = {F3E87D0F-6F06-4C0B-AE06-42C0834C3C6E}
{AD40CA55-35CC-41CA-85F5-8FDA4ECAFF78} = {2ECE1CFB-9436-4149-B7E4-1FB1786FDE9F}
{D6C217E0-BFB7-4C80-8D50-C969F46EBC59} = {2ECE1CFB-9436-4149-B7E4-1FB1786FDE9F}
EndGlobalSection
Expand Down
36 changes: 20 additions & 16 deletions build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ BuildSettings.Initialize(

FilePath[] ConsoleFiles = {
"nunit3-console.dll", "nunit3-console.dll.config", "nunit3-console.exe", "nunit3-console.pdb",
"nunit3-console.deps.json", "nunit3-console.runtimeconfig.json", "nunit.console.nuget.addins" };
"nunit3-console.deps.json", "nunit3-console.runtimeconfig.json" };
FilePath[] ENGINE_FILES = {
"nunit.engine.dll", "nunit.engine.core.dll", "nunit.engine.api.dll", "testcentric.engine.metadata.dll" };
FilePath[] ENGINE_PDB_FILES = {
Expand Down Expand Up @@ -61,12 +61,12 @@ BuildSettings.Packages.AddRange(new PackageDefinition[] {
source: BuildSettings.NuGetDirectory + "runners/nunit.console-runner.nuspec",
checks: new PackageCheck[] {
HasFiles("LICENSE.txt", "NOTICES.txt"),
HasDirectory("tools").WithFiles("nunit3-console.exe", "nunit3-console.exe.config", "nunit.console.nuget.addins").AndFiles(ENGINE_FILES),
HasDirectory("tools/agents/net462").WithFiles(AGENT_FILES).AndFile("nunit.console.nuget.agent.addins"),
HasDirectory("tools/agents/netcoreapp3.1").WithFiles(AGENT_FILES_NETCORE).AndFile("nunit.console.nuget.agent.addins"),
HasDirectory("tools/agents/net6.0").WithFiles(AGENT_FILES_NETCORE).AndFile("nunit.console.nuget.agent.addins"),
HasDirectory("tools/agents/net7.0").WithFiles(AGENT_FILES_NETCORE).AndFile("nunit.console.nuget.agent.addins"),
HasDirectory("tools/agents/net8.0").WithFiles(AGENT_FILES_NETCORE).AndFile("nunit.console.nuget.agent.addins")
HasDirectory("tools").WithFiles("nunit3-console.exe", "nunit3-console.exe.config").AndFiles(ENGINE_FILES),
HasDirectory("tools/agents/net462").WithFiles(AGENT_FILES),
HasDirectory("tools/agents/netcoreapp3.1").WithFiles(AGENT_FILES_NETCORE),
HasDirectory("tools/agents/net6.0").WithFiles(AGENT_FILES_NETCORE),
HasDirectory("tools/agents/net7.0").WithFiles(AGENT_FILES_NETCORE),
HasDirectory("tools/agents/net8.0").WithFiles(AGENT_FILES_NETCORE)
},
symbols: new PackageCheck[] {
HasDirectory("tools").WithFiles(ENGINE_PDB_FILES).AndFile("nunit3-console.pdb"),
Expand Down Expand Up @@ -103,12 +103,12 @@ BuildSettings.Packages.AddRange(new PackageDefinition[] {
id: "nunit-console-runner",
source: BuildSettings.ChocolateyDirectory + "nunit-console-runner.nuspec",
checks: new PackageCheck[] {
HasDirectory("tools").WithFiles("LICENSE.txt", "NOTICES.txt", "VERIFICATION.txt", "nunit3-console.exe", "nunit3-console.exe.config", "nunit.console.choco.addins").AndFiles(ENGINE_FILES),
HasDirectory("tools/agents/net462").WithFiles(AGENT_FILES).AndFile("nunit.console.choco.agent.addins"),
HasDirectory("tools/agents/netcoreapp3.1").WithFiles(AGENT_FILES_NETCORE).AndFile("nunit.console.choco.agent.addins"),
HasDirectory("tools/agents/net6.0").WithFiles(AGENT_FILES_NETCORE).AndFile("nunit.console.choco.agent.addins"),
HasDirectory("tools/agents/net7.0").WithFiles(AGENT_FILES_NETCORE).AndFile("nunit.console.choco.agent.addins"),
HasDirectory("tools/agents/net8.0").WithFiles(AGENT_FILES_NETCORE).AndFile("nunit.console.choco.agent.addins")
HasDirectory("tools").WithFiles("LICENSE.txt", "NOTICES.txt", "VERIFICATION.txt", "nunit3-console.exe", "nunit3-console.exe.config").AndFiles(ENGINE_FILES),
HasDirectory("tools/agents/net462").WithFiles(AGENT_FILES),
HasDirectory("tools/agents/netcoreapp3.1").WithFiles(AGENT_FILES_NETCORE),
HasDirectory("tools/agents/net6.0").WithFiles(AGENT_FILES_NETCORE),
HasDirectory("tools/agents/net7.0").WithFiles(AGENT_FILES_NETCORE),
HasDirectory("tools/agents/net8.0").WithFiles(AGENT_FILES_NETCORE)
},
testRunner: new ConsoleRunnerSelfTester(BuildSettings.ChocolateyTestDirectory
+ $"nunit-console-runner.{BuildSettings.PackageVersion}/tools/nunit3-console.exe"),
Expand Down Expand Up @@ -151,9 +151,7 @@ BuildSettings.Packages.AddRange(new PackageDefinition[] {
HasFiles("LICENSE.txt", "NOTICES.txt"),
HasDirectory("lib/net462").WithFiles(ENGINE_FILES),
HasDirectory("lib/net8.0").WithFiles(ENGINE_FILES).AndFile("Microsoft.Extensions.DependencyModel.dll"),
HasDirectory("contentFiles/any/lib/net462").WithFile("nunit.engine.nuget.addins"),
HasDirectory("contentFiles/any/lib/net8.0").WithFile("nunit.engine.nuget.addins"),
HasDirectory("contentFiles/any/agents/net462").WithFiles(AGENT_FILES).AndFile("nunit.agent.addins")
HasDirectory("contentFiles/any/agents/net462").WithFiles(AGENT_FILES)
},
symbols: new PackageCheck[] {
HasDirectory("lib/net462").WithFiles(ENGINE_PDB_FILES),
Expand Down Expand Up @@ -201,6 +199,12 @@ Task("TestZipPackage")
NUnitConsoleZipPackage.RunPackageTests();
});

Task("TestNetCorePackage")
.Does(() =>
{
NUnitConsoleRunnerNetCorePackage.RunPackageTests();
});

// Adhoc code to check content of a dotnet standalone executable
// TODO: Incorporate this in the recipe itself

Expand Down
1 change: 0 additions & 1 deletion nuget/engine/nunit.agent.addins

This file was deleted.

4 changes: 0 additions & 4 deletions nuget/engine/nunit.engine.nuget.addins

This file was deleted.

6 changes: 0 additions & 6 deletions nuget/engine/nunit.engine.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,6 @@
<file src="agents/netcoreapp3.1/nunit.engine.api.pdb" target="contentFiles/any/agents/netcoreapp3.1" />
<file src="agents/netcoreapp3.1/testcentric.engine.metadata.dll" target="contentFiles/any/agents/netcoreapp3.1" />

<file src="../../nuget/engine/nunit.engine.nuget.addins" target="contentFiles/any/lib/net462"/>
<file src="../../nuget/engine/nunit.agent.addins" target="contentFiles/any/agents/net462"/>
<file src="../../nuget/engine/nunit.agent.addins" target="contentFiles/any/agents/net40"/>
<file src="../../nuget/engine/nunit.agent.addins" target="contentFiles/any/agents/netcoreapp3.1"/>

<file src="net8.0/nunit.engine.dll" target="lib/net8.0" />
<file src="net8.0/nunit.engine.pdb" target="lib/net8.0" />
<file src="net8.0/nunit.engine.core.dll" target="lib/net8.0" />
Expand All @@ -79,7 +74,6 @@
<file src="net8.0/nunit.engine.api.pdb" target="lib/net8.0" />
<file src="net8.0/testcentric.engine.metadata.dll" target="lib/net8.0" />
<file src="net8.0/Microsoft.Extensions.DependencyModel.dll" target="lib/net8.0" />
<file src="../../nuget/engine/nunit.engine.nuget.addins" target="contentFiles/any/lib/net8.0"/>

<file src="../../nuget/engine/build/**/*" target="build" />
<file src="../../nunit_256.png" target="images" />
Expand Down
6 changes: 0 additions & 6 deletions nuget/runners/net8.0/DotnetToolSettings.xml

This file was deleted.

53 changes: 0 additions & 53 deletions nuget/runners/nunit.console-runner.net80.nuspec

This file was deleted.

1 change: 0 additions & 1 deletion nuget/runners/nunit.console-runner.netcore.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
<file src="net8.0/nunit.engine.api.xml" target="tools/net8.0/any" />
<file src="net8.0/testcentric.engine.metadata.dll" target="tools/net8.0/any" />
<file src="net8.0/Microsoft.Extensions.DependencyModel.dll" target="tools/net8.0/any" />
<file src="../../nuget/runners/nunit.console.nuget.addins" target="tools/net8.0/any"/>
<file src="../../nuget/runners/DotnetToolSettings.xml" target="tools/net8.0/any"/>

<file src="../../nunit_256.png" target="images"/>
Expand Down
6 changes: 0 additions & 6 deletions nuget/runners/nunit.console-runner.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
<file src="agents/net462/nunit.engine.core.dll" target="tools/agents/net462" />
<file src="agents/net462/nunit.engine.core.pdb" target="tools/agents/net462" />
<file src="agents/net462/testcentric.engine.metadata.dll" target="tools/agents/net462" />
<file src="../../nuget/runners/nunit.console.nuget.agent.addins" target="tools/agents/net462"/>

<file src="agents/netcoreapp3.1/nunit-agent.dll" target="tools/agents/netcoreapp3.1" />
<file src="agents/netcoreapp3.1/nunit-agent.pdb" target="tools/agents/netcoreapp3.1" />
Expand All @@ -53,7 +52,6 @@
<file src="agents/netcoreapp3.1/nunit.engine.core.pdb" target="tools/agents/netcoreapp3.1" />
<file src="agents/netcoreapp3.1/testcentric.engine.metadata.dll" target="tools/agents/netcoreapp3.1" />
<file src="agents/netcoreapp3.1/Microsoft.Extensions.DependencyModel.dll" target="tools/agents/netcoreapp3.1" />
<file src="../../nuget/runners/nunit.console.nuget.agent.addins" target="tools/agents/netcoreapp3.1"/>

<file src="agents/net6.0/nunit-agent.dll" target="tools/agents/net6.0" />
<file src="agents/net6.0/nunit-agent.pdb" target="tools/agents/net6.0" />
Expand All @@ -67,7 +65,6 @@
<file src="agents/net6.0/nunit.engine.core.pdb" target="tools/agents/net6.0" />
<file src="agents/net6.0/testcentric.engine.metadata.dll" target="tools/agents/net6.0" />
<file src="agents/net6.0/Microsoft.Extensions.DependencyModel.dll" target="tools/agents/net6.0" />
<file src="../../nuget/runners/nunit.console.nuget.agent.addins" target="tools/agents/net6.0"/>

<file src="agents/net7.0/nunit-agent.dll" target="tools/agents/net7.0" />
<file src="agents/net7.0/nunit-agent.pdb" target="tools/agents/net7.0" />
Expand All @@ -81,7 +78,6 @@
<file src="agents/net7.0/nunit.engine.core.pdb" target="tools/agents/net7.0" />
<file src="agents/net7.0/testcentric.engine.metadata.dll" target="tools/agents/net7.0" />
<file src="agents/net7.0/Microsoft.Extensions.DependencyModel.dll" target="tools/agents/net7.0" />
<file src="../../nuget/runners/nunit.console.nuget.agent.addins" target="tools/agents/net7.0"/>

<file src="agents/net8.0/nunit-agent.dll" target="tools/agents/net8.0" />
<file src="agents/net8.0/nunit-agent.pdb" target="tools/agents/net8.0" />
Expand All @@ -95,7 +91,6 @@
<file src="agents/net8.0/nunit.engine.core.pdb" target="tools/agents/net8.0" />
<file src="agents/net8.0/testcentric.engine.metadata.dll" target="tools/agents/net8.0" />
<file src="agents/net8.0/Microsoft.Extensions.DependencyModel.dll" target="tools/agents/net8.0" />
<file src="../../nuget/runners/nunit.console.nuget.agent.addins" target="tools/agents/net8.0"/>

<file src="net462/nunit3-console.exe" target="tools" />
<file src="net462/nunit3-console.pdb" target="tools" />
Expand All @@ -108,7 +103,6 @@
<file src="net462/nunit.engine.dll" target="tools" />
<file src="net462/nunit.engine.pdb" target="tools" />
<file src="net462/testcentric.engine.metadata.dll" target="tools" />
<file src="../../nuget/runners/nunit.console.nuget.addins" target="tools"/>
<file src="../../nunit_256.png" target="images"/>
</files>
</package>
11 changes: 0 additions & 11 deletions nuget/runners/nunit.console.nuget.addins

This file was deleted.

11 changes: 0 additions & 11 deletions nuget/runners/nunit.console.nuget.agent.addins

This file was deleted.

2 changes: 1 addition & 1 deletion package-tests.cake
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ StandardRunnerTests.Add(new PackageTest(
KnownExtensions.NUnitProjectLoader));

// V2 Result Writer Test
StandardRunnerTests.Add(new PackageTest(
AddToBothLists(new PackageTest(
1, "V2ResultWriterTest",
"Run mock-assembly under .NET 6.0 and produce V2 output",
"testdata/net6.0/mock-assembly.dll --result=TestResult.xml --result=NUnit2TestResult.xml;format=nunit2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
using NUnit.Engine.Internal.FileSystemAccess;
using System.Diagnostics;

namespace NUnit.Engine.Services.Tests
namespace NUnit.Engine.Services
{
public class ExtensionManagerTests
{
Expand Down Expand Up @@ -58,7 +58,7 @@ public void CreateExtensionManager()
// Find actual extension points.
_extensionManager.FindExtensionPoints(typeof(CoreEngine).Assembly);
_extensionManager.FindExtensionPoints(typeof(ITestEngine).Assembly);
// Find extensions.
// Find extensions directly in the their assemblies
#if NETCOREAPP
_extensionManager.FindExtensionsInAssembly(FakeExtensions("netstandard2.0"));
#else
Expand Down
Loading

0 comments on commit 7f19ef7

Please sign in to comment.