-
Notifications
You must be signed in to change notification settings - Fork 0
/
Run-TestSuite.ps1
44 lines (39 loc) · 1.18 KB
/
Run-TestSuite.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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
Function Run-TestSuite {
[CmdletBinding()]
Param(
[Parameter(Mandatory=$true)]
[ValidateNotNullOrEmpty()]
[string[]] $categories
, [string] $config = "Release"
, [string[]] $frameworks = @("net8.0")
)
Begin {
$testSuccessful = 0
if ($env:APPVEYOR -eq "True") {
$adapters = "--test-adapter-path:.", "--logger:Appveyor"
}
}
Process {
foreach ($framework in $frameworks) {
$buildMsg = & dotnet build ".\Streamistry.RabbitMQ.Testing" -c $config -f $framework --nologo
if ($lastexitcode -ne 0) {
Write-Warning "Cannot build the Test assembly! `r`n$($buildMsg -join "`r`n")"
} else {
foreach ($category in $categories) {
Write-Host "`tRunning test-suite for $category ($framework)"
$arguments = @("test", ".\Streamistry.RabbitMQ.Testing")
$arguments += @("--filter", "`"TestCategory=$($category.Split("+") -join "`"`"&`"`"TestCategory=")`"")
$arguments += @("-c", $config)
$arguments += @("-f", $framework)
$arguments += @("--no-build", "--nologo")
$arguments += $adapters
& dotnet $arguments | Out-Host
$testSuccessful += $lastexitcode
}
}
}
}
End {
return $testSuccessful
}
}