Skip to content

Commit

Permalink
Merge pull request #1626 from nunit/issue-1613
Browse files Browse the repository at this point in the history
Further work on 1613
  • Loading branch information
CharliePoole authored Feb 22, 2025
2 parents 7db08cf + 1761d3e commit a551b7d
Show file tree
Hide file tree
Showing 10 changed files with 468 additions and 411 deletions.
47 changes: 8 additions & 39 deletions build.cake
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Load the recipe
#load nuget:?package=NUnit.Cake.Recipe&version=1.3.1-alpha.1
#load nuget:?package=NUnit.Cake.Recipe&version=1.4.0-alpha.1
// Comment out above line and uncomment below for local tests of recipe changes
//#load ../NUnit.Cake.Recipe/recipe/*.cake

Expand Down Expand Up @@ -74,7 +74,7 @@ BuildSettings.Packages.AddRange(new PackageDefinition[] {
},
testRunner: new ConsoleRunnerSelfTester(BuildSettings.NuGetTestDirectory
+ $"NUnit.ConsoleRunner.{BuildSettings.PackageVersion}/tools/nunit3-console.exe"),
tests: StandardRunnerTests),
tests: PackageTests.StandardRunnerTests),

// NOTE: Must follow ConsoleRunner, upon which it depends
NUnitConsoleNuGetPackage = new NuGetPackage(
Expand All @@ -91,9 +91,8 @@ BuildSettings.Packages.AddRange(new PackageDefinition[] {
HasDirectory(".store/nunit.consolerunner.netcore/**/tools/net8.0/any")
.WithFiles(ENGINE_FILES).AndFiles(ConsoleFiles).AndFile("Microsoft.Extensions.DependencyModel.dll")
},
testRunner: new ConsoleRunnerSelfTester(BuildSettings.NuGetTestDirectory
+ $"NUnit.ConsoleRunner.NetCore.{BuildSettings.PackageVersion}/nunit.exe"),
tests: NetCoreRunnerTests),
testRunner: new ConsoleRunnerSelfTester(BuildSettings.NuGetTestDirectory + "nunit.exe"),
tests: PackageTests.NetCoreRunnerTests),

NUnitConsoleRunnerChocolateyPackage = new ChocolateyPackage(
id: "nunit-console-runner",
Expand All @@ -106,7 +105,7 @@ BuildSettings.Packages.AddRange(new PackageDefinition[] {
},
testRunner: new ConsoleRunnerSelfTester(BuildSettings.ChocolateyTestDirectory
+ $"nunit-console-runner.{BuildSettings.PackageVersion}/tools/nunit3-console.exe"),
tests: StandardRunnerTests),
tests: PackageTests.StandardRunnerTests),

NUnitConsoleZipPackage = new ZipPackage(
id: "NUnit.Console",
Expand All @@ -126,7 +125,7 @@ BuildSettings.Packages.AddRange(new PackageDefinition[] {
},
testRunner: new ConsoleRunnerSelfTester(BuildSettings.ZipTestDirectory
+ $"NUnit.Console.{BuildSettings.PackageVersion}/bin/net462/nunit3-console.exe"),
tests: StandardRunnerTests,
tests: PackageTests.ZipRunnerTests,
bundledExtensions: new [] {
KnownExtensions.VSProjectLoader.NuGetPackage,
KnownExtensions.NUnitProjectLoader.NuGetPackage,
Expand Down Expand Up @@ -168,36 +167,6 @@ BuildSettings.Packages.AddRange(new PackageDefinition[] {
})
});

Task("BuildZipPackage")
.Does(() =>
{
NUnitConsoleZipPackage.BuildPackage();
});

Task("InstallZipPackage")
.Does(() =>
{
NUnitConsoleZipPackage.InstallPackage();
});

Task("VerifyZipPackage")
.Does(() =>
{
NUnitConsoleZipPackage.VerifyPackage();
});

Task("TestZipPackage")
.Does(() =>
{
NUnitConsoleZipPackage.RunPackageTests();
});

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

//////////////////////////////////////////////////////////////////////
// TEST RUNNERS
//////////////////////////////////////////////////////////////////////
Expand All @@ -212,10 +181,10 @@ public class ConsoleRunnerSelfTester : TestRunner, IPackageTestRunner
_executablePath = executablePath;
}

public int RunPackageTest(string arguments)
public int RunPackageTest(string arguments, bool redirectOutput = false)
{
Console.WriteLine("Running package test");
return base.RunTest(_executablePath, arguments);
return base.RunPackageTest(_executablePath, new ProcessSettings { Arguments = arguments, RedirectStandardOutput = redirectOutput });
}
}

Expand Down
7 changes: 7 additions & 0 deletions choco/nunit-console-runner.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
<files>
<file src = "../LICENSE.txt" target = "tools" />
<file src = "../NOTICES.txt" target = "tools" />
<!-- File used by ExtensionManager to indicate this is a chocolatey installation -->
<file src = "VERIFICATION.txt" target = "tools" />

<file src = "$BIN_DIR$net462/nunit3-console.exe" target="tools" />
Expand All @@ -48,6 +49,8 @@
<file src = "$BIN_DIR$agents/net462/testcentric.engine.metadata.dll" target="tools/agents/net462" />
<file src = "nunit-agent.exe.ignore" target="tools/agents/net462" />
<file src = "nunit-agent-x86.exe.ignore" target="tools/agents/net462" />
<!-- File used by ExtensionManager to indicate this is a chocolatey installation -->
<file src = "VERIFICATION.txt" target = "tools/agents/net462" />

<file src = "$BIN_DIR$agents/net6.0/nunit-agent.dll" target="tools/agents/net6.0" />
<file src = "$BIN_DIR$agents/net6.0/nunit-agent.dll.config" target="tools/agents/net6.0" />
Expand All @@ -58,6 +61,8 @@
<file src = "$BIN_DIR$agents/net6.0/nunit.engine.core.dll" target="tools/agents/net6.0" />
<file src = "$BIN_DIR$agents/net6.0/testcentric.engine.metadata.dll" target="tools/agents/net6.0" />
<file src = "$BIN_DIR$agents/net6.0/Microsoft.Extensions.DependencyModel.dll" target="tools/agents/net6.0" />
<!-- File used by ExtensionManager to indicate this is a chocolatey installation -->
<file src = "VERIFICATION.txt" target = "tools/agents/net6.0" />

<file src = "$BIN_DIR$agents/net8.0/nunit-agent.dll" target="tools/agents/net8.0" />
<file src = "$BIN_DIR$agents/net8.0/nunit-agent.dll.config" target="tools/agents/net8.0" />
Expand All @@ -68,5 +73,7 @@
<file src = "$BIN_DIR$agents/net8.0/nunit.engine.core.dll" target="tools/agents/net8.0" />
<file src = "$BIN_DIR$agents/net8.0/testcentric.engine.metadata.dll" target="tools/agents/net8.0" />
<file src = "$BIN_DIR$agents/net8.0/Microsoft.Extensions.DependencyModel.dll" target="tools/agents/net8.0" />
<!-- File used by ExtensionManager to indicate this is a chocolatey installation -->
<file src = "VERIFICATION.txt" target = "tools/agents/net8.0" />
</files>
</package>
Loading

0 comments on commit a551b7d

Please sign in to comment.