Skip to content

Commit

Permalink
Add a test using the peaq executable with WAV input (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
martinholters authored Jun 26, 2024
1 parent 700678d commit ecb8b03
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
test/stimulus_ref.wav filter=lfs diff=lfs merge=lfs -text
test/stimulus_test.wav filter=lfs diff=lfs merge=lfs -text
5 changes: 4 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
lfs: true
- name: install prerequisites
run: sudo apt-get install -y ${{ matrix.cc }} git2cl gtk-doc-tools w3-dtd-mathml libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev gstreamer1.0-tools gstreamer1.0-plugins-base
run: sudo apt-get install -y ${{ matrix.cc }} git2cl gtk-doc-tools w3-dtd-mathml libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev gstreamer1.0-tools gstreamer1.0-plugins-base gstreamer1.0-plugins-good
- name: autogen
run: ./autogen.sh
- name: make
Expand All @@ -48,6 +49,8 @@ jobs:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
with:
lfs: true
- name: Install prerequisites
shell: cmd
run: |
Expand Down
3 changes: 2 additions & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc --enable-man
SUBDIRS = src doc
EXTRA_DIST=INSTALL.Windows vs/gstpeaq.props \
vs/gstpeaq.vcxproj vs/peaq.vcxproj vs/gstpeaq.sln \
INSTALL.OSX xcode/GstPEAQ.xcodeproj/project.pbxproj
INSTALL.OSX xcode/GstPEAQ.xcodeproj/project.pbxproj \
test/stimulus_ref.wav test/stimulus_test.wav
8 changes: 8 additions & 0 deletions src/runtest-1.0.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,12 @@ echo $ODG
if [ x$ODG != x-2.007 ]; then
exit 1
fi

ODG=`LC_ALL=C ./peaq --gst-disable-segtrap --gst-debug-level=2 --gst-plugin-load=.libs/libgstpeaq.so \
${srcdir}/../test/stimulus_ref.wav ${srcdir}/../test/stimulus_test.wav \
| grep "Objective Difference Grade:" | cut -d " " -f4`
echo $ODG
if [ x$ODG != x-1.077 ]; then
exit 1
fi
exit 0
3 changes: 3 additions & 0 deletions test/stimulus_ref.wav
Git LFS file not shown
3 changes: 3 additions & 0 deletions test/stimulus_test.wav
Git LFS file not shown
7 changes: 7 additions & 0 deletions vs/runtest-win32.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,10 @@ if ($ODG -ne -2.007) {
throw "$ODG -ne -2.007"
}

$ODG = [convert]::ToDouble(( `
Invoke-Expression ("$PSScriptRoot\win32\Release\peaq.exe --gst-plugin-load=$PSScriptRoot\win32\Release\gstpeaq.dll " + `
"$PSScriptRoot\..\test\stimulus_ref.wav $PSScriptRoot\..\test\stimulus_test.wav") `
| Select-String -Pattern 'Objective Difference Grade: (.*)').Matches.Groups[1].Value)
if ($ODG -ne -1.077) {
throw "$ODG -ne -1.077"
}
7 changes: 7 additions & 0 deletions vs/runtest-x64.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,10 @@ if ($ODG -ne -2.007) {
throw "$ODG -ne -2.007"
}

$ODG = [convert]::ToDouble(( `
Invoke-Expression ("$PSScriptRoot\x64\Release\peaq.exe --gst-plugin-load=$PSScriptRoot\x64\Release\gstpeaq.dll " + `
"$PSScriptRoot\..\test\stimulus_ref.wav $PSScriptRoot\..\test\stimulus_test.wav") `
| Select-String -Pattern 'Objective Difference Grade: (.*)').Matches.Groups[1].Value)
if ($ODG -ne -1.077) {
throw "$ODG -ne -1.077"
}

0 comments on commit ecb8b03

Please sign in to comment.