mirror of
https://github.com/onyx-and-iris/voicemeeter-api-powershell.git
synced 2026-04-09 17:33:33 +00:00
recorder tests, tests pass
more reliable way to locate the recording pester tests pass for all kinds manual tests pass for all kinds - video vban.outstream.route - eq.channel.cell.gain range
This commit is contained in:
@@ -1108,13 +1108,19 @@ Describe -Tag 'higher', -TestName 'All Higher Tests' {
|
||||
$vmr.recorder.prefix = $prefix
|
||||
$vmr.recorder.filetype = $filetype
|
||||
|
||||
$start = Get-Date
|
||||
$vmr.recorder.state = 'record'
|
||||
Start-Sleep -Milliseconds 10
|
||||
$stamp = '{0:yyyy-MM-dd} at {0:HH}h{0:mm}m{0:ss}s' -f (Get-Date)
|
||||
$vmr.recorder.state | Should -Be 'record'
|
||||
Start-Sleep -Milliseconds 2000
|
||||
|
||||
$tmp = [System.IO.Path]::Combine($recDir, ("{0} {1}.{2}" -f $prefix, $stamp, $filetype))
|
||||
$tmp = Get-ChildItem -Path $recDir -Filter ("{0}*.{1}" -f $prefix, $filetype) -ErrorAction SilentlyContinue |
|
||||
Where-Object { $_.LastWriteTime -gt $start } |
|
||||
Sort-Object LastWriteTime -Descending |
|
||||
Select-Object -First 1
|
||||
|
||||
if (-not $tmp) {
|
||||
throw "'$filetype' file with prefix '$prefix' was not found in '$recDir'."
|
||||
}
|
||||
|
||||
$vmr.recorder.state = 'stop'
|
||||
$vmr.recorder.eject()
|
||||
@@ -1202,12 +1208,18 @@ Describe -Tag 'higher', -TestName 'All Higher Tests' {
|
||||
}
|
||||
|
||||
BeforeEach {
|
||||
$start = Get-Date
|
||||
$vmr.recorder.record()
|
||||
Start-Sleep -Milliseconds 10
|
||||
$stamp = '{0:yyyy-MM-dd} at {0:HH}h{0:mm}m{0:ss}s' -f (Get-Date)
|
||||
Start-Sleep -Milliseconds 2000
|
||||
|
||||
$tmp = [System.IO.Path]::Combine($recDir, ("{0} {1}.{2}" -f $prefix, $stamp, $filetype))
|
||||
$tmp = Get-ChildItem -Path $recDir -Filter ("{0}*.{1}" -f $prefix, $filetype) -ErrorAction SilentlyContinue |
|
||||
Where-Object { $_.LastWriteTime -gt $start } |
|
||||
Sort-Object LastWriteTime -Descending |
|
||||
Select-Object -First 1
|
||||
|
||||
if (-not $tmp) {
|
||||
throw "'$filetype' file with prefix '$prefix' was not found in '$recDir'."
|
||||
}
|
||||
|
||||
$vmr.recorder.pause()
|
||||
Start-Sleep -Milliseconds 500
|
||||
|
||||
@@ -11,12 +11,18 @@ function Test-RecDir ([object]$vmr, [string]$recDir) {
|
||||
|
||||
|
||||
try {
|
||||
$start = Get-Date
|
||||
$vmr.recorder.record()
|
||||
Start-Sleep -Milliseconds 10
|
||||
$stamp = '{0:yyyy-MM-dd} at {0:HH}h{0:mm}m{0:ss}s' -f (Get-Date)
|
||||
Start-Sleep -Milliseconds 2000
|
||||
|
||||
$tmp = Join-Path $recDir ("{0} {1}.{2}" -f $prefix, $stamp, $filetype)
|
||||
$tmp = Get-ChildItem -Path $recDir -Filter ("{0}*.{1}" -f $prefix, $filetype) -ErrorAction SilentlyContinue |
|
||||
Where-Object { $_.LastWriteTime -gt $start } |
|
||||
Sort-Object LastWriteTime -Descending |
|
||||
Select-Object -First 1
|
||||
|
||||
if (-not $tmp) {
|
||||
throw "'$filetype' file with prefix '$prefix' was not found in '$recDir'."
|
||||
}
|
||||
|
||||
$vmr.recorder.stop()
|
||||
$vmr.recorder.eject()
|
||||
|
||||
Reference in New Issue
Block a user