1
0
mirror of https://github.com/mstorsjo/fdk-aac.git synced 2025-02-17 19:50:35 +01:00
fdk-aac/test/run-test.sh
Martin Storsjo 8ac2f359c6 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.
2023-10-06 14:49:50 +03:00

29 lines
785 B
Bash
Executable File

#!/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