From 23c36601abb9bac97bf9426d29a8753ba0d02c7e Mon Sep 17 00:00:00 2001 From: onyx-and-iris <75868496+onyx-and-iris@users.noreply.github.com> Date: Mon, 24 Jan 2022 20:54:07 +0000 Subject: [PATCH] Update runall.ps1 add log switch to runall --- test/runall.ps1 | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/test/runall.ps1 b/test/runall.ps1 index cd8ee41..7805f0d 100644 --- a/test/runall.ps1 +++ b/test/runall.ps1 @@ -1,4 +1,4 @@ -Param([String]$tag, [Int]$num=1) +Param([String]$tag, [Int]$num=1, [switch]$log) Import-Module ..\lib\Voicemeeter.psm1 Function ParseLog { @@ -39,11 +39,17 @@ try if (Test-Path $logfile) { Clear-Content $logfile } 1..$num | ForEach-Object { - "Running test $_ of $num" | Tee-Object -FilePath $logfile -Append - Invoke-Pester -Tag $tag -PassThru | Tee-Object -FilePath $logfile -Append + if ($log) { + "Running test $_ of $num" | Tee-Object -FilePath $logfile -Append + Invoke-Pester -Tag $tag -PassThru | Tee-Object -FilePath $logfile -Append + } + else { + "Running test $_ of $num" + Invoke-Pester -Tag $tag -PassThru + } } - Parselog -logfile $logfile + if($log) { Parselog -logfile $logfile } } finally {