From 55eb851729d8cb4da4b52c8b2785759b6a57ab4e Mon Sep 17 00:00:00 2001 From: pblivingston <71585805+pblivingston@users.noreply.github.com> Date: Fri, 19 Dec 2025 14:30:51 -0500 Subject: [PATCH] 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 --- README.md | 10 +++++----- tests/higher.Tests.ps1 | 24 ++++++++++++++++++------ tests/run.ps1 | 12 +++++++++--- 3 files changed, 32 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 321eea1..861374f 100644 --- a/README.md +++ b/README.md @@ -8,9 +8,9 @@ For past/future changes to this project refer to: [CHANGELOG](CHANGELOG.md) ## Tested against -- Basic 1.1.1.9 -- Banana 2.1.1.9 -- Potato 3.1.1.9 +- Basic 1.1.2.2 +- Banana 2.1.2.2 +- Potato 3.1.2.2 ## Requirements @@ -495,7 +495,7 @@ $vmr.vban.outstream[3].bit = 16 ##### midi -The following midi Vban.outstream[8] properties are available: +The following midi Vban.outstream properties are available: - route: string, ('none', 'midi_in', 'aux_in', 'vban_in', 'all_in', 'midi_out') @@ -507,7 +507,7 @@ $vmr.vban.outstream[8].route = 'aux_in' ##### video -The following video Vban.outstream[9] properties are available: +The following video Vban.outstream properties are available: - vfps: int, from 1 to 30 - vformat: string, ('png', 'jpg') diff --git a/tests/higher.Tests.ps1 b/tests/higher.Tests.ps1 index 5df633f..0d06d77 100644 --- a/tests/higher.Tests.ps1 +++ b/tests/higher.Tests.ps1 @@ -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 diff --git a/tests/run.ps1 b/tests/run.ps1 index d01bffd..bcd771c 100644 --- a/tests/run.ps1 +++ b/tests/run.ps1 @@ -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()