coyote/Scripts/run-tests.ps1

50 строки
1.7 KiB
PowerShell
Исходник Обычный вид История

2020-02-29 03:01:21 +03:00
param(
[string]$dotnet = "dotnet",
2020-11-11 23:43:01 +03:00
[ValidateSet("all", "netcoreapp3.1", "net48", "net5.0")]
[string]$framework = "all",
[ValidateSet("all", "systematic", "tasks-systematic", "actors", "actors-systematic", "standalone")]
[string]$test = "all",
[string]$filter = "",
[string]$logger = "",
[ValidateSet("quiet", "minimal", "normal", "detailed", "diagnostic")]
[string]$v = "normal"
2020-02-29 03:01:21 +03:00
)
Import-Module $PSScriptRoot/powershell/common.psm1 -Force
2020-02-29 03:01:21 +03:00
$targets = [ordered]@{
2020-10-22 01:39:52 +03:00
"systematic" = "Tests.SystematicTesting"
2020-11-12 19:42:16 +03:00
"tasks-systematic" = "Tests.Tasks.SystematicTesting"
2020-10-22 04:22:44 +03:00
"actors" = "Tests.Actors"
"actors-systematic" = "Tests.Actors.SystematicTesting"
2020-10-22 01:39:52 +03:00
"standalone" = "Tests.Standalone"
2020-02-29 03:01:21 +03:00
}
[System.Environment]::SetEnvironmentVariable('COYOTE_CLI_TELEMETRY_OPTOUT', '1')
2020-02-29 03:01:21 +03:00
Write-Comment -prefix "." -text "Running the Coyote tests" -color "yellow"
# Run all enabled tests.
2020-10-22 04:22:44 +03:00
foreach ($kvp in $targets.GetEnumerator()) {
if (($test -ne "all") -and ($test -ne $($kvp.Name))) {
continue
}
$frameworks = Get-ChildItem -Path "$PSScriptRoot/../Tests/$($kvp.Value)/bin" | Where-Object Name -CNotIn "netstandard2.0", "netstandard2.1" | Select-Object -expand Name
2020-10-22 04:22:44 +03:00
foreach ($f in $frameworks) {
if (($framework -ne "all") -and ($f -ne $framework)) {
continue
}
if (($($kvp.Name) -eq "standalone") -and ($f -eq "net48")) {
continue
}
$target = "$PSScriptRoot/../Tests/$($kvp.Value)/$($kvp.Value).csproj"
Invoke-DotnetTest -dotnet $dotnet -project $($kvp.Name) -target $target -filter $filter -logger $logger -framework $f -verbosity $v
2020-02-29 03:01:21 +03:00
}
}
Write-Comment -prefix "." -text "Done" -color "green"