2020-02-29 03:01:21 +03:00
|
|
|
param(
|
2020-08-11 23:19:28 +03:00
|
|
|
[string]$dotnet = "dotnet",
|
2021-04-22 05:29:25 +03:00
|
|
|
[ValidateSet("all", "net5.0", "net462")]
|
2020-08-11 23:19:28 +03:00
|
|
|
[string]$framework = "all",
|
2021-03-31 20:58:40 +03:00
|
|
|
[ValidateSet("all", "rewriting", "testing", "tasks-testing", "actors", "actors-testing", "standalone")]
|
2020-08-11 23:19:28 +03:00
|
|
|
[string]$test = "all",
|
|
|
|
[string]$filter = "",
|
|
|
|
[string]$logger = "",
|
|
|
|
[ValidateSet("quiet", "minimal", "normal", "detailed", "diagnostic")]
|
|
|
|
[string]$v = "normal"
|
2020-02-29 03:01:21 +03:00
|
|
|
)
|
|
|
|
|
2020-08-11 23:19:28 +03:00
|
|
|
Import-Module $PSScriptRoot/powershell/common.psm1 -Force
|
2020-02-29 03:01:21 +03:00
|
|
|
|
|
|
|
$targets = [ordered]@{
|
2021-03-31 20:58:40 +03:00
|
|
|
"rewriting" = "Tests.Rewriting"
|
|
|
|
"testing" = "Tests.BugFinding"
|
|
|
|
"tasks-testing" = "Tests.Tasks.BugFinding"
|
2020-10-22 04:22:44 +03:00
|
|
|
"actors" = "Tests.Actors"
|
2021-03-31 20:58:40 +03:00
|
|
|
"actors-testing" = "Tests.Actors.BugFinding"
|
2020-10-22 01:39:52 +03:00
|
|
|
"standalone" = "Tests.Standalone"
|
2020-02-29 03:01:21 +03:00
|
|
|
}
|
|
|
|
|
2021-07-07 07:19:51 +03:00
|
|
|
$ilverify = FindProgram("ilverify")
|
|
|
|
if ($null -eq $ilverify) {
|
|
|
|
&dotnet tool install --global dotnet-ilverify
|
|
|
|
$ilverify = FindProgram("ilverify");
|
|
|
|
}
|
|
|
|
|
|
|
|
$dotnet_path = FindDotNet("dotnet");
|
|
|
|
|
2020-08-11 23:19:28 +03:00
|
|
|
[System.Environment]::SetEnvironmentVariable('COYOTE_CLI_TELEMETRY_OPTOUT', '1')
|
2020-06-04 00:36:37 +03:00
|
|
|
|
2020-02-29 03:01:21 +03:00
|
|
|
Write-Comment -prefix "." -text "Running the Coyote tests" -color "yellow"
|
|
|
|
|
2021-03-11 09:59:16 +03:00
|
|
|
# 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
|
|
|
|
}
|
2020-08-14 03:19:10 +03:00
|
|
|
|
2021-04-22 05:29:25 +03:00
|
|
|
$frameworks = Get-ChildItem -Path "$PSScriptRoot/../Tests/$($kvp.Value)/bin" | Where-Object Name -CNotIn "net48", "netstandard2.0", "netstandard2.1", "netcoreapp3.1" | Select-Object -expand Name
|
2021-03-11 09:59:16 +03:00
|
|
|
|
2020-10-22 04:22:44 +03:00
|
|
|
foreach ($f in $frameworks) {
|
|
|
|
if (($framework -ne "all") -and ($f -ne $framework)) {
|
|
|
|
continue
|
|
|
|
}
|
2021-03-24 00:58:30 +03:00
|
|
|
|
2021-04-22 05:29:25 +03:00
|
|
|
if (($($kvp.Name) -eq "standalone") -and ($f -eq "net462")) {
|
2021-03-24 00:58:30 +03:00
|
|
|
continue
|
|
|
|
}
|
|
|
|
|
2020-08-14 03:19:10 +03:00
|
|
|
$target = "$PSScriptRoot/../Tests/$($kvp.Value)/$($kvp.Value).csproj"
|
2021-07-07 07:19:51 +03:00
|
|
|
|
|
|
|
if ($f -eq "net5.0") {
|
|
|
|
$AssemblyName = GetAssemblyName($target)
|
|
|
|
$NetCoreApp = FindNetCoreApp -dotnet_path $dotnet_path -version "5.0"
|
|
|
|
$command = "$PSScriptRoot/../Tests/$($kvp.Value)/bin/net5.0/$AssemblyName.dll"
|
|
|
|
$command = $command + ' -r "' + "$PSScriptRoot/../Tests/$($kvp.Value)/bin/net5.0/*.dll" + '"'
|
|
|
|
$command = $command + ' -r "' + "$dotnet_path/packs/Microsoft.NETCore.App.Ref/5.0.0/ref/net5.0/*.dll" + '"'
|
|
|
|
$command = $command + ' -r "' + "$PSScriptRoot/../bin/net5.0/*.dll" + '"'
|
|
|
|
$command = $command + ' -r "' + $NetCoreApp + '/*.dll"'
|
|
|
|
Invoke-ToolCommand -tool $ilverify -cmd $command -error_msg "Verifying assembly failed"
|
|
|
|
}
|
|
|
|
|
2020-08-14 03:19:10 +03:00
|
|
|
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"
|