Skip to content

Commit

Permalink
Update build.cake to test against both NUnit 3 and 4
Browse files Browse the repository at this point in the history
  • Loading branch information
manfred-brands committed Jan 21, 2024
1 parent f2d269c commit 053e2a1
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
"isRoot": true,
"tools": {
"cake.tool": {
"version": "2.1.0",
"version": "3.2.0",
"commands": [
"dotnet-cake"
]
}
}
}
}
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ tools/

# NUNIT
*.VisualState.xml
TestResult.xml
TestResult*.xml

# Build Results of an ATL Project
[Dd]ebugPS/
Expand Down Expand Up @@ -288,4 +288,4 @@ CommentRemover.ConsoleApplication Output/
CommentRemover.Task Output/

# Generated Assembly info
AssemblyInfo.Generated.cs
AssemblyInfo.Generated.cs
15 changes: 13 additions & 2 deletions build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -148,18 +148,29 @@ Task("Test")
.IsDependentOn("Build")
.Does(() =>
{
Information("Testing against NUnit 3.xx");
DotNetTest(TEST_PROJECT, new DotNetTestSettings
{
Configuration = configuration,
Loggers = new string[] { "trx" },
VSTestReportPath = "TestResult.xml",
VSTestReportPath = "TestResult-NUnit3.xml",
MSBuildSettings = new DotNetMSBuildSettings().WithProperty("NUnitVersion", "3")
});
Information("Testing against NUnit 4.xx");
DotNetTest(TEST_PROJECT, new DotNetTestSettings
{
Configuration = configuration,
Loggers = new string[] { "trx" },
VSTestReportPath = "TestResult-NUnit4.xml",
MSBuildSettings = new DotNetMSBuildSettings().WithProperty("NUnitVersion", "4")
});
})
.Finally(() =>
{
if (AppVeyor.IsRunningOnAppVeyor)
{
AppVeyor.UploadTestResults("TestResult.xml", AppVeyorTestResultsType.MSTest);
AppVeyor.UploadTestResults("TestResult-NUnit3.xml", AppVeyorTestResultsType.MSTest);
AppVeyor.UploadTestResults("TestResult-NUnit4.xml", AppVeyorTestResultsType.MSTest);
}
});

Expand Down

0 comments on commit 053e2a1

Please sign in to comment.