diff options
author | Martin Storsjo <martin@martin.st> | 2023-10-06 14:47:49 +0300 |
---|---|---|
committer | Martin Storsjo <martin@martin.st> | 2023-10-06 14:49:50 +0300 |
commit | 8ac2f359c6d64569b8da836338fae80e0169e7c2 (patch) | |
tree | 2517df789a44a3f8ca251bb88036424fce1a87ec | |
parent | 1fbe8eb3bd0907aadf5a97283866ca797370bb18 (diff) | |
download | fdk-aac-8ac2f359c6d64569b8da836338fae80e0169e7c2.tar.gz fdk-aac-8ac2f359c6d64569b8da836338fae80e0169e7c2.tar.bz2 fdk-aac-8ac2f359c6d64569b8da836338fae80e0169e7c2.zip |
Add a script for doing very rudimentary regression testing
This is expected to fail if the encoder is updated in a way
that changes its output; in such cases, the test references need
to be updated.
-rw-r--r-- | test/ref-mono.txt | 2 | ||||
-rw-r--r-- | test/ref-stereo.txt | 2 | ||||
-rwxr-xr-x | test/run-test.sh | 28 |
3 files changed, 32 insertions, 0 deletions
diff --git a/test/ref-mono.txt b/test/ref-mono.txt new file mode 100644 index 0000000..22a84f2 --- /dev/null +++ b/test/ref-mono.txt @@ -0,0 +1,2 @@ +encode hash: 516e51016cbba6068f1aa285a8fdd55b00ada6b0 +decode hash: 3b3b3a17cc5ba50ade75b3ef1a37f96017935fe5 diff --git a/test/ref-stereo.txt b/test/ref-stereo.txt new file mode 100644 index 0000000..3de5276 --- /dev/null +++ b/test/ref-stereo.txt @@ -0,0 +1,2 @@ +encode hash: 1179940ca3a5c62de45b6823efbdbe42fce11de2 +decode hash: 85f2a154b46cc6cfa2792ff95c67b4200ce4463b diff --git a/test/run-test.sh b/test/run-test.sh new file mode 100755 index 0000000..b2ef548 --- /dev/null +++ b/test/run-test.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +set -e +set -o pipefail + +if [ ! -f Sample01_4.wav ]; then + curl -LO https://media.xiph.org/audio/HA_2011/Sample01_4.wav +fi + +if [ "$(md5sum Sample01_4.wav | awk '{print $1}')" != "a5c105544c64ce92c6c5c06d280e6b9c" ]; then + echo Incorrect checksum for Sample01_4.wav + exit 1 +fi + +if [ ! -f Sample01_4-mono.wav ]; then + ffmpeg -i Sample01_4.wav -ac 1 -fflags +bitexact -y Sample01_4-mono.wav +fi + +if [ "$(md5sum Sample01_4-mono.wav | awk '{print $1}')" != "3bfccac9f2e527ba3ef888874f09a409" ]; then + echo Incorrect checksum for Sample01_4-mono.wav + exit 1 +fi + +./test-encode-decode Sample01_4.wav | tee log-stereo.txt +./test-encode-decode Sample01_4-mono.wav | tee log-mono.txt + +diff -u log-stereo.txt $(dirname $0)/ref-stereo.txt +diff -u log-mono.txt $(dirname $0)/ref-mono.txt |