2021-04-30 16:31:01 +01:00
|
|
|
Param([String]$tag, [Int]$num=1)
|
2021-04-30 17:06:55 +01:00
|
|
|
Import-Module ..\lib\Voicemeeter.psm1
|
|
|
|
. ..\lib\base.ps1
|
2021-04-28 17:38:36 +01:00
|
|
|
|
2021-05-01 22:20:21 +01:00
|
|
|
Function ParseLog {
|
|
|
|
Param([String]$logfile)
|
|
|
|
$summary_file = "_summary.log"
|
|
|
|
if (Test-Path $summary_file) { Clear-Content $summary_file }
|
|
|
|
|
|
|
|
$PASSED_PATTERN = "^PassedCount\s+:\s(\d+)"
|
|
|
|
$FAILED_PATTERN = "^FailedCount\s+:\s(\d+)"
|
|
|
|
|
|
|
|
$DATA = @{
|
|
|
|
"passed" = 0
|
|
|
|
"failed" = 0
|
|
|
|
}
|
|
|
|
|
|
|
|
ForEach ($line in `
|
|
|
|
$(Get-content -Path "${logfile}")) {
|
|
|
|
if ($line -match $PASSED_PATTERN) {
|
|
|
|
$DATA["passed"] += $Matches[1]
|
|
|
|
}
|
|
|
|
elseif ($line -match $FAILED_PATTERN) {
|
|
|
|
$DATA["failed"] += $Matches[1]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
"=========================`n" + `
|
|
|
|
"$num tests run:`n" + `
|
|
|
|
"=========================" | Tee-Object -FilePath $summary_file -Append
|
|
|
|
$DATA | ForEach-Object { $_ } | Tee-Object -FilePath $summary_file -Append
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2021-04-28 17:38:36 +01:00
|
|
|
try
|
|
|
|
{
|
2021-04-30 17:06:55 +01:00
|
|
|
$vmr = Get-RemotePotato
|
2021-04-28 17:38:36 +01:00
|
|
|
|
2021-05-01 22:20:21 +01:00
|
|
|
$logfile = "_results.log"
|
|
|
|
if (Test-Path $logfile) { Clear-Content $logfile }
|
|
|
|
|
2021-04-29 00:48:16 +01:00
|
|
|
1..$num | ForEach-Object {
|
2021-05-01 22:20:21 +01:00
|
|
|
"Running test $_ of $num" | Tee-Object -FilePath $logfile -Append
|
|
|
|
Invoke-Pester -Tag $tag -PassThru | Tee-Object -FilePath $logfile -Append
|
2021-04-28 17:38:36 +01:00
|
|
|
}
|
2021-05-01 22:20:21 +01:00
|
|
|
|
|
|
|
Parselog -logfile $logfile
|
2021-04-28 17:38:36 +01:00
|
|
|
}
|
|
|
|
finally
|
|
|
|
{
|
|
|
|
$vmr.Logout()
|
|
|
|
}
|