Skip to content

Commit 053e2a1

Browse files
Update build.cake to test against both NUnit 3 and 4
1 parent f2d269c commit 053e2a1

File tree

3 files changed

+17
-6
lines changed

3 files changed

+17
-6
lines changed

.config/dotnet-tools.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
"isRoot": true,
44
"tools": {
55
"cake.tool": {
6-
"version": "2.1.0",
6+
"version": "3.2.0",
77
"commands": [
88
"dotnet-cake"
99
]
1010
}
1111
}
12-
}
12+
}

.gitignore

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ tools/
3434

3535
# NUNIT
3636
*.VisualState.xml
37-
TestResult.xml
37+
TestResult*.xml
3838

3939
# Build Results of an ATL Project
4040
[Dd]ebugPS/
@@ -288,4 +288,4 @@ CommentRemover.ConsoleApplication Output/
288288
CommentRemover.Task Output/
289289

290290
# Generated Assembly info
291-
AssemblyInfo.Generated.cs
291+
AssemblyInfo.Generated.cs

build.cake

+13-2
Original file line numberDiff line numberDiff line change
@@ -148,18 +148,29 @@ Task("Test")
148148
.IsDependentOn("Build")
149149
.Does(() =>
150150
{
151+
Information("Testing against NUnit 3.xx");
151152
DotNetTest(TEST_PROJECT, new DotNetTestSettings
152153
{
153154
Configuration = configuration,
154155
Loggers = new string[] { "trx" },
155-
VSTestReportPath = "TestResult.xml",
156+
VSTestReportPath = "TestResult-NUnit3.xml",
157+
MSBuildSettings = new DotNetMSBuildSettings().WithProperty("NUnitVersion", "3")
158+
});
159+
Information("Testing against NUnit 4.xx");
160+
DotNetTest(TEST_PROJECT, new DotNetTestSettings
161+
{
162+
Configuration = configuration,
163+
Loggers = new string[] { "trx" },
164+
VSTestReportPath = "TestResult-NUnit4.xml",
165+
MSBuildSettings = new DotNetMSBuildSettings().WithProperty("NUnitVersion", "4")
156166
});
157167
})
158168
.Finally(() =>
159169
{
160170
if (AppVeyor.IsRunningOnAppVeyor)
161171
{
162-
AppVeyor.UploadTestResults("TestResult.xml", AppVeyorTestResultsType.MSTest);
172+
AppVeyor.UploadTestResults("TestResult-NUnit3.xml", AppVeyorTestResultsType.MSTest);
173+
AppVeyor.UploadTestResults("TestResult-NUnit4.xml", AppVeyorTestResultsType.MSTest);
163174
}
164175
});
165176

0 commit comments

Comments
 (0)