diff --git a/README.md b/README.md index 8537621..ca530ce 100644 --- a/README.md +++ b/README.md @@ -354,12 +354,11 @@ Run tests using .\tests\pre-commit.ps1 which accepts the following parameters: - `kind`: Run tests of this kind - `tag`: Run tests tagged with this marker (currently `higher` or `lower`) - `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"` - -Results will be logged and summary file written. +`powershell .\tests\pre-commit.ps1 -k "potato" -t "higher" -log` ### Official Documentation diff --git a/tests/pre-commit.ps1 b/tests/pre-commit.ps1 index 4ef36ee..b8370f7 100644 --- a/tests/pre-commit.ps1 +++ b/tests/pre-commit.ps1 @@ -3,7 +3,7 @@ Import-Module .\lib\Voicemeeter.psm1 Function ParseLog { Param([String]$logfile) - $summary_file = "_summary.log" + $summary_file = Join-Path $PSScriptRoot "_summary.log" if (Test-Path $summary_file) { Clear-Content $summary_file } $PASSED_PATTERN = "^PassedCount\s+:\s(\d+)" @@ -57,7 +57,7 @@ function main() { $ifNotBanana = $vmr.kind.name -ne "banana" $ifNotPotato = $vmr.kind.name -ne "potato" - $logfile = "_results.log" + $logfile = Join-Path $PSScriptRoot "_results.log" if (Test-Path $logfile) { Clear-Content $logfile } 1..$num | ForEach-Object {