mirror of
https://github.com/onyx-and-iris/voicemeeter-api-powershell.git
synced 2025-01-18 05:10:48 +00:00
update readme, runall and gitignore
Update installation instructions in README. Added logging and log parsing to runall.ps1 Add ignore log files
This commit is contained in:
parent
2846e46592
commit
2f1508e8f1
1
.gitignore
vendored
1
.gitignore
vendored
@ -1 +1,2 @@
|
|||||||
**/*.psd1
|
**/*.psd1
|
||||||
|
**/*.log
|
||||||
|
@ -9,6 +9,8 @@ Before any minor/major patch is released all test units will be run to verify th
|
|||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
- [x] Add gain, comp, limit to Strips
|
- [x] Add gain, comp, limit to Strips
|
||||||
- [x] Update tests to reflect changes
|
- [x] Update tests to reflect changes
|
||||||
|
- [x] Add logging + summary for tests
|
||||||
|
- [x] Add info to README about powershellget, nuget and psgallery
|
||||||
|
|
||||||
## [1.3] - 2021-04-30
|
## [1.3] - 2021-04-30
|
||||||
### Added
|
### Added
|
||||||
|
@ -12,7 +12,7 @@ Simple example if using from source:
|
|||||||
Import-Module .\lib\Voicemeeter.psm1
|
Import-Module .\lib\Voicemeeter.psm1
|
||||||
|
|
||||||
try {
|
try {
|
||||||
# Pass a Voicemeeter type as argument
|
# Run the factory function for required Voicemeeter type
|
||||||
$vmr = Get-RemoteBanana
|
$vmr = Get-RemoteBanana
|
||||||
|
|
||||||
# Set strip and bus params
|
# Set strip and bus params
|
||||||
|
24
README.md
24
README.md
@ -18,11 +18,23 @@ You may have success with many commands in earlier versions but some commands
|
|||||||
- Powershell 5.1
|
- Powershell 5.1
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
#### Powershell:
|
#### PowerShellGet:
|
||||||
|
In Powershell as admin:
|
||||||
|
|
||||||
`Install-Module Voicemeeter`
|
`Install-Module Voicemeeter`
|
||||||
|
|
||||||
You will need to add PSGallery as a trusted repository source.
|
In Powershell as current user:
|
||||||
More info: [PSGallery](https://www.powershellgallery.com/)
|
|
||||||
|
`Install-Module -Name Voicemeeter -Scope CurrentUser`
|
||||||
|
|
||||||
|
You may be asked to install NuGet provider required by PowerShellGet if you don't have it already.
|
||||||
|
|
||||||
|
When prompted you will need to accept PSGallery as a trusted repository.
|
||||||
|
|
||||||
|
More Info:
|
||||||
|
- [PowerShellGet](https://docs.microsoft.com/en-us/powershell/scripting/gallery/installing-psget?view=powershell-7.1)
|
||||||
|
- [NuGet](https://www.powershellgallery.com/packages/NuGet/1.3.3)
|
||||||
|
- [PSGallery](https://docs.microsoft.com/en-gb/powershell/scripting/gallery/overview?view=powershell-7.1)
|
||||||
|
|
||||||
#### Direct download:
|
#### Direct download:
|
||||||
`git clone https://github.com/onyx-and-iris/voicemeeter-api-powershell.git`
|
`git clone https://github.com/onyx-and-iris/voicemeeter-api-powershell.git`
|
||||||
@ -99,9 +111,7 @@ $vmr.button[5].trigger = $true
|
|||||||
```
|
```
|
||||||
|
|
||||||
### Run tests
|
### Run tests
|
||||||
Run tests using invoke-pester in powershell console from test directory.
|
Run tests using .\runall.ps1 which accepts two parameters:
|
||||||
|
|
||||||
Alternatively you may use .\runall.ps1 which accepts two parameters:
|
|
||||||
- tag Run tests of this type
|
- tag Run tests of this type
|
||||||
- num Run this number of tests
|
- num Run this number of tests
|
||||||
|
|
||||||
@ -109,3 +119,5 @@ Current test types are 'higher' and 'lower'
|
|||||||
|
|
||||||
Example:
|
Example:
|
||||||
`.\runall.ps1 -tag 'higher' -num 3`
|
`.\runall.ps1 -tag 'higher' -num 3`
|
||||||
|
|
||||||
|
Results will be logged and summary file written.
|
||||||
|
@ -402,9 +402,9 @@ Describe -Tag 'higher', -TestName 'All Alias Tests' {
|
|||||||
$vmr.strip[1].gain | Should -Be 5.1
|
$vmr.strip[1].gain | Should -Be 5.1
|
||||||
}
|
}
|
||||||
|
|
||||||
It 'Should set Strip[1].Gain to -0.2' {
|
It 'Should set Strip[1].Gain to -4.2' {
|
||||||
$vmr.strip[1].gain =-0.2
|
$vmr.strip[1].gain = -4.2
|
||||||
$vmr.strip[1].gain | Should -Be -0.2
|
$vmr.strip[1].gain | Should -Be -4.2
|
||||||
}
|
}
|
||||||
|
|
||||||
It 'Should set Strip[2].Gain to 2.7' {
|
It 'Should set Strip[2].Gain to 2.7' {
|
||||||
@ -594,9 +594,9 @@ Describe -Tag 'higher', -TestName 'All Alias Tests' {
|
|||||||
$vmr.bus[1].gain | Should -Be 5.1
|
$vmr.bus[1].gain | Should -Be 5.1
|
||||||
}
|
}
|
||||||
|
|
||||||
It 'Should set Bus[1].Gain to -0.2' {
|
It 'Should set Bus[1].Gain to -4.2' {
|
||||||
$vmr.bus[1].gain =-0.2
|
$vmr.bus[1].gain = -4.2
|
||||||
$vmr.bus[1].gain | Should -Be -0.2
|
$vmr.bus[1].gain | Should -Be -4.2
|
||||||
}
|
}
|
||||||
|
|
||||||
It 'Should set Bus[2].Gain to 2.7' {
|
It 'Should set Bus[2].Gain to 2.7' {
|
||||||
|
@ -2,14 +2,49 @@ Param([String]$tag, [Int]$num=1)
|
|||||||
Import-Module ..\lib\Voicemeeter.psm1
|
Import-Module ..\lib\Voicemeeter.psm1
|
||||||
. ..\lib\base.ps1
|
. ..\lib\base.ps1
|
||||||
|
|
||||||
|
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
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
$vmr = Get-RemotePotato
|
$vmr = Get-RemotePotato
|
||||||
|
|
||||||
|
$logfile = "_results.log"
|
||||||
|
if (Test-Path $logfile) { Clear-Content $logfile }
|
||||||
|
|
||||||
1..$num | ForEach-Object {
|
1..$num | ForEach-Object {
|
||||||
Write-Host "Running test $_ of $num"
|
"Running test $_ of $num" | Tee-Object -FilePath $logfile -Append
|
||||||
Invoke-Pester -Tag $tag
|
Invoke-Pester -Tag $tag -PassThru | Tee-Object -FilePath $logfile -Append
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Parselog -logfile $logfile
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user