|
43 | 43 | <NugetPackProperties Condition="'$(TF_BUILD)' == 'true'">$(NugetPackProperties);ContinuousIntegrationBuild=true;</NugetPackProperties> |
44 | 44 | </PropertyGroup> |
45 | 45 |
|
| 46 | + <!-- Test configuration properties --> |
| 47 | + <PropertyGroup> |
| 48 | + <FilterStatement>$(Filter)</FilterStatement> |
| 49 | + <FilterStatement Condition="'$(FilterStatement)' == ''">category!=failing&category!=flaky</FilterStatement> |
| 50 | + <!--Collect code coverage unless explicitly disabled--> |
| 51 | + <CollectCodeCoverage Condition="'$(CollectCodeCoverage)' == ''">true</CollectCodeCoverage> |
| 52 | + <CollectStatement Condition="'$(CollectCodeCoverage)' == 'true'">--collect "Code coverage"</CollectStatement> |
| 53 | + </PropertyGroup> |
| 54 | + |
46 | 55 | <!-- Release Build properties must be turned on for Release purposes, and turned off for Code Coverage calculations --> |
47 | 56 | <PropertyGroup> |
48 | 57 | <BuildForRelease Condition="$(BuildForRelease) == ''">true</BuildForRelease> |
|
223 | 232 | <!-- Run all unit tests applicable to Windows. --> |
224 | 233 | <Target Name="RunUnitTestsWindows" Condition="'$(IsEnabledWindows)' == 'true' AND $(ReferenceType.Contains('Project'))"> |
225 | 234 | <PropertyGroup> |
226 | | - <FilterStatement>$(Filter)</FilterStatement> |
227 | | - <FilterStatement Condition="'$(FilterStatement)' == ''">category!=failing&category!=flaky</FilterStatement> |
228 | 235 | <TestCommand> |
229 | 236 | $(DotnetPath)dotnet test "@(UnitTestsProj)" |
230 | 237 | --no-build |
231 | 238 | -v n |
232 | 239 | -p:Configuration=$(Configuration) |
233 | 240 | -p:Target$(TFGroup)Version=$(TF) |
234 | 241 | -p:TestTargetOS=Windows$(TargetGroup) |
235 | | - --collect "Code coverage" |
| 242 | + $(CollectStatement) |
236 | 243 | --results-directory $(ResultsDirectory) |
237 | 244 | --filter "$(FilterStatement)" |
238 | 245 | --logger:"trx;LogFilePrefix=Unit-Windows$(TargetGroup)-$(TestSet)" |
|
246 | 253 | <!-- Run all unit tests applicable to Unix. --> |
247 | 254 | <Target Name="RunUnitTestsUnix" Condition="'$(IsEnabledWindows)' != 'true' AND $(ReferenceType.Contains('Project'))"> |
248 | 255 | <PropertyGroup> |
249 | | - <FilterStatement>$(Filter)</FilterStatement> |
250 | | - <FilterStatement Condition="'$(FilterStatement)' == ''">category!=failing&category!=flaky</FilterStatement> |
251 | 256 | <TestCommand> |
252 | 257 | $(DotnetPath)dotnet test "@(UnitTestsProj)" |
253 | 258 | --no-build |
254 | 259 | -v n |
255 | 260 | -p:Configuration=$(Configuration) |
256 | 261 | -p:TargetNetCoreVersion=$(TF) |
257 | 262 | -p:TestTargetOS=Unixnetcoreapp |
258 | | - --collect "Code coverage" |
| 263 | + $(CollectStatement) |
259 | 264 | --results-directory $(ResultsDirectory) |
260 | 265 | --filter "$(FilterStatement)" |
261 | 266 | --logger:"trx;LogFilePrefix=Unit-Unixnetcoreapp-$(TestSet)" |
262 | | - </TestCommand> |
| 267 | + </TestCommand> |
263 | 268 | <TestCommand>$(TestCommand.Replace($([System.Environment]::NewLine), " "))</TestCommand> |
264 | 269 | </PropertyGroup> |
265 | 270 | <Message Text=">>> Running unit tests for Unix via command: $(TestCommand)"/> |
|
272 | 277 | <!-- Run all Functional tests applicable to Windows. --> |
273 | 278 | <Target Name="RunFunctionalTestsWindows" Condition="'$(IsEnabledWindows)' == 'true'"> |
274 | 279 | <PropertyGroup> |
275 | | - <FilterStatement>$(Filter)</FilterStatement> |
276 | | - <FilterStatement Condition="'$(FilterStatement)' == ''">category!=failing&category!=flaky</FilterStatement> |
277 | 280 | <TestCommand> |
278 | 281 | $(DotnetPath)dotnet test "@(FunctionalTestsProj)" |
279 | 282 | --no-build |
|
283 | 286 | -p:ReferenceType=$(ReferenceType) |
284 | 287 | -p:TestSet=$(TestSet) |
285 | 288 | -p:TestTargetOS=Windows$(TargetGroup) |
286 | | - --collect "Code coverage" |
| 289 | + $(CollectStatement) |
287 | 290 | --results-directory $(ResultsDirectory) |
288 | 291 | --filter "$(FilterStatement)" |
289 | 292 | --logger:"trx;LogFilePrefix=Functional-Windows$(TargetGroup)-$(TestSet)" |
|
297 | 300 | <!-- Run all Functional tests applicable to Unix. --> |
298 | 301 | <Target Name="RunFunctionalTestsUnix" Condition="'$(IsEnabledWindows)' != 'true'"> |
299 | 302 | <PropertyGroup> |
300 | | - <FilterStatement>$(Filter)</FilterStatement> |
301 | | - <FilterStatement Condition="'$(FilterStatement)' == ''">category!=failing&category!=flaky</FilterStatement> |
302 | 303 | <TestCommand> |
303 | 304 | $(DotnetPath)dotnet test "@(FunctionalTestsProj)" |
304 | 305 | --no-build |
|
308 | 309 | -p:ReferenceType=$(ReferenceType) |
309 | 310 | -p:TestSet=$(TestSet) |
310 | 311 | -p:TestTargetOS=Unixnetcoreapp |
311 | | - --collect "Code coverage" |
| 312 | + $(CollectStatement) |
312 | 313 | --results-directory $(ResultsDirectory) |
313 | 314 | --filter "$(FilterStatement)" |
314 | 315 | --logger:"trx;LogFilePrefix=Functional-Unixnetcoreapp-$(TestSet)" |
|
325 | 326 | <!-- Run all Manual tests applicable to Windows. --> |
326 | 327 | <Target Name="RunManualTestsWindows" Condition="'$(IsEnabledWindows)' == 'true'"> |
327 | 328 | <PropertyGroup> |
328 | | - <FilterStatement>$(Filter)</FilterStatement> |
329 | | - <FilterStatement Condition="'$(FilterStatement)' == ''">category!=failing&category!=flaky</FilterStatement> |
330 | 329 | <TestCommand> |
331 | 330 | $(DotnetPath)dotnet test "@(ManualTestsProj)" |
332 | 331 | --no-build |
|
336 | 335 | -p:ReferenceType=$(ReferenceType) |
337 | 336 | -p:TestSet=$(TestSet) |
338 | 337 | -p:TestTargetOS=Windows$(TargetGroup) |
339 | | - --collect "Code coverage" |
| 338 | + $(CollectStatement) |
340 | 339 | --results-directory $(ResultsDirectory) |
341 | 340 | --filter "$(FilterStatement)" |
342 | 341 | --logger:"trx;LogFilePrefix=Manual-Windows$(TargetGroup)-$(TestSet)" |
|
350 | 349 | <!-- Run all Manual tests applicable to Unix. --> |
351 | 350 | <Target Name="RunManualTestsUnix" Condition="'$(IsEnabledWindows)' != 'true'"> |
352 | 351 | <PropertyGroup> |
353 | | - <FilterStatement>$(Filter)</FilterStatement> |
354 | | - <FilterStatement Condition="'$(FilterStatement)' == ''">category!=failing&category!=flaky</FilterStatement> |
355 | 352 | <TestCommand> |
356 | 353 | $(DotnetPath)dotnet test "@(ManualTestsProj)" |
357 | 354 | --no-build |
|
361 | 358 | -p:ReferenceType=$(ReferenceType) |
362 | 359 | -p:TestSet=$(TestSet) |
363 | 360 | -p:TestTargetOS=Unixnetcoreapp |
364 | | - --collect "Code coverage" |
| 361 | + $(CollectStatement) |
365 | 362 | --results-directory $(ResultsDirectory) |
366 | 363 | --filter "$(FilterStatement)" |
367 | 364 | --logger:"trx;LogFilePrefix=Manual-Unixnetcoreapp-$(TestSet)" |
|
0 commit comments