Commit 3aaa107e authored by Stefan Westerfeld's avatar Stefan Westerfeld

Add scripts for make check.

Signed-off-by: Stefan Westerfeld's avatarStefan Westerfeld <stefan@space.twc.de>
parent d2ab035f
SUBDIRS = src
SUBDIRS = src tests
ACLOCAL_AMFLAGS = -I m4
EXTRA_DIST = README.adoc Dockerfile
......@@ -102,7 +102,7 @@ AC_LANG_POP([C++])
# Less cluttered build output
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
AC_CONFIG_FILES([Makefile src/Makefile])
AC_CONFIG_FILES([Makefile src/Makefile tests/Makefile tests/test-common.sh])
AC_OUTPUT
# Output summary message
......
test-common.sh
check: detect-speed-test block-decoder-test clip-decoder-test
detect-speed-test:
Q=1 $(top_srcdir)/tests/detect-speed-test.sh
block-decoder-test:
Q=1 $(top_srcdir)/tests/block-decoder-test.sh
clip-decoder-test:
Q=1 $(top_srcdir)/tests/clip-decoder-test.sh
#!/bin/bash
source test-common.sh
IN_WAV=block-decoder-test.wav
OUT_WAV=block-decoder-test-out.wav
$AUDIOWMARK test-gen-noise $IN_WAV 200 44100 || die "failed to generate noise"
audiowmark_add $IN_WAV $OUT_WAV $TEST_MSG
audiowmark_cmp $OUT_WAV $TEST_MSG
rm $IN_WAV $OUT_WAV
exit 0
#!/bin/bash
source test-common.sh
IN_WAV=clip-decoder-test.wav
OUT_WAV=clip-decoder-test-out.wav
$AUDIOWMARK test-gen-noise $IN_WAV 30 44100 || die "failed to generate noise"
audiowmark_add $IN_WAV $OUT_WAV $TEST_MSG
audiowmark_cmp $OUT_WAV $TEST_MSG
rm $IN_WAV $OUT_WAV
exit 0
#!/bin/bash
source test-common.sh
IN_WAV=detect-speed-test.wav
OUT_WAV=detect-speed-test-out.wav
OUTS_WAV=detect-speed-test-out-spd.wav
$AUDIOWMARK test-gen-noise detect-speed-test.wav 30 44100 || die "failed to generate noise"
for SPEED in 0.9764 1.01
do
audiowmark_add $IN_WAV $OUT_WAV $TEST_MSG
$AUDIOWMARK test-change-speed $OUT_WAV $OUTS_WAV $SPEED || die "failed to change speed"
audiowmark_cmp $OUTS_WAV $TEST_MSG --detect-speed --test-speed $SPEED
audiowmark_cmp $OUTS_WAV $TEST_MSG --detect-speed-patient --test-speed $SPEED
done
rm $IN_WAV $OUT_WAV $OUTS_WAV
exit 0
# program locations
AUDIOWMARK=@top_builddir@/src/audiowmark
TEST_MSG=f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0
# common shell functions
die()
{
echo "$0: $@"
exit 1
}
audiowmark_add()
{
if [ "x$Q" == "x1" ]; then
AUDIOWMARK_Q="-q"
else
echo ==== audiowmark add "$@" ====
fi
$AUDIOWMARK $AUDIOWMARK_Q --strict add "$@" || die "failed to watermark $@"
}
audiowmark_cmp()
{
if [ "x$Q" == "x1" ]; then
AUDIOWMARK_OUT="/dev/null"
else
AUDIOWMARK_OUT="/dev/stdout"
echo ==== audiowmark cmp "$@" ====
fi
$AUDIOWMARK --strict cmp "$@" > $AUDIOWMARK_OUT || die "failed to detect watermark $@"
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment