add log flag to run tests section in readme

This commit is contained in:
onyx-and-iris 2022-10-30 01:26:04 +00:00
parent 88aa0c3250
commit 21e8b16cec
2 changed files with 5 additions and 6 deletions

View File

@ -354,12 +354,11 @@ Run tests using .\tests\pre-commit.ps1 which accepts the following parameters:
- `kind`: Run tests of this kind - `kind`: Run tests of this kind
- `tag`: Run tests tagged with this marker (currently `higher` or `lower`) - `tag`: Run tests tagged with this marker (currently `higher` or `lower`)
- `num`: Run this number of tests - `num`: Run this number of tests
- `log`: Write summary log file
Run tests from repository root in a subshell like so: Run tests from repository root in a subshell and write logs, like so:
`powershell .\tests\pre-commit.ps1 -k "potato" -t "higher"` `powershell .\tests\pre-commit.ps1 -k "potato" -t "higher" -log`
Results will be logged and summary file written.
### Official Documentation ### Official Documentation

View File

@ -3,7 +3,7 @@ Import-Module .\lib\Voicemeeter.psm1
Function ParseLog { Function ParseLog {
Param([String]$logfile) Param([String]$logfile)
$summary_file = "_summary.log" $summary_file = Join-Path $PSScriptRoot "_summary.log"
if (Test-Path $summary_file) { Clear-Content $summary_file } if (Test-Path $summary_file) { Clear-Content $summary_file }
$PASSED_PATTERN = "^PassedCount\s+:\s(\d+)" $PASSED_PATTERN = "^PassedCount\s+:\s(\d+)"
@ -57,7 +57,7 @@ function main() {
$ifNotBanana = $vmr.kind.name -ne "banana" $ifNotBanana = $vmr.kind.name -ne "banana"
$ifNotPotato = $vmr.kind.name -ne "potato" $ifNotPotato = $vmr.kind.name -ne "potato"
$logfile = "_results.log" $logfile = Join-Path $PSScriptRoot "_results.log"
if (Test-Path $logfile) { Clear-Content $logfile } if (Test-Path $logfile) { Clear-Content $logfile }
1..$num | ForEach-Object { 1..$num | ForEach-Object {