-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathcallTest.ps1
25 lines (19 loc) · 989 Bytes
/
callTest.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
param([string]$option = "Release")
$format = "nunit3"
$outputDir = "$env:OUTPUTDIR"
$nunit3_console = "$env:USERPROFILE\.nuget\packages\nunit.consolerunner\3.12.0\tools\nunit3-console.exe"
$ErrorActionpreference = "Stop"
Write-Output $format
Write-Output $outputDir
Write-Output $nunit3_console
if ($option -eq "Release") {
Write-Host ("Test $option")
# Run .NET test assemblies, excluding .NET Core
$testAssemblies = Get-ChildItem -Recurse -Path .\.build\bin\Release\Dynatrace.OpenKit.Tests -Include Dynatrace.OpenKit.Tests.dll | ? { $_.FullName -notmatch "\\netcoreapp\d\.\d\\" } | ? { $_.FullName -notmatch "\\net\d\.\d\\" } | % FullName
if ($testAssemblies.length -gt 0) {
Write-Output $testAssemblies
& $nunit3_console $testAssemblies "--result=$outputDir\myresults.xml;format=$format"
}
# Run .NET Core tests
dotnet.exe test openkit-dotnet.sln --no-build --configuration Release --logger trx --results-directory $outputDir
}