[SCM] bs1770gain/master: Improve autopkg tests and run them at build time.
pere at users.alioth.debian.org
pere at users.alioth.debian.org
Wed Jun 24 16:30:17 UTC 2015
The following commit has been merged in the master branch:
commit 4981f288d807e6d5df27049652cbba118ee569a4
Author: Petter Reinholdtsen <pere at hungry.com>
Date: Wed Jun 24 16:29:57 2015 +0000
Improve autopkg tests and run them at build time.
diff --git a/debian/rules b/debian/rules
index c535f07..3c2a477 100755
--- a/debian/rules
+++ b/debian/rules
@@ -4,3 +4,8 @@
override_dh_strip:
dh_strip --dbg-package=bs1770gain-dbg
+
+# Run our test suite until the upstream source get one
+override_dh_auto_test:
+ dh_auto_test
+ BS1770GAIN=`pwd`/bs1770gain/bs1770gain ./debian/tests/test-cmd-tool
diff --git a/debian/tests/control b/debian/tests/control
index 1c8cf88..ce16d71 100644
--- a/debian/tests/control
+++ b/debian/tests/control
@@ -1,3 +1,3 @@
Tests: test-cmd-tool
-Depends: @
+Depends: @, sox
Restrictions: allow-stderr
diff --git a/debian/tests/test-cmd-tool b/debian/tests/test-cmd-tool
index e3ee06f..966fa31 100755
--- a/debian/tests/test-cmd-tool
+++ b/debian/tests/test-cmd-tool
@@ -2,6 +2,10 @@
set -e
+if [ -z "$BS1770GAIN" ] ; then
+ BS1770GAIN=bs1770gain
+fi
+
at_exit() {
echo "info: test exiting, removing $WORKDIR"
rm -rf $WORKDIR
@@ -12,12 +16,28 @@ trap at_exit INT TERM EXIT
set -x
-bs1770gain -h
+$BS1770GAIN -h
+
+test_on_file() {
+ file="$1"
+
+ bs1770gain $file
+ mkdir $WORKDIR/tmp
-bs1770gain debian/tests/yell.wav
+ $BS1770GAIN $file -o $WORKDIR/tmp/test1
+ for f in $WORKDIR/tmp/test1/*; do bs1770gain $f; done
+
+ $BS1770GAIN $file -a -o $WORKDIR/tmp/test2
+ for f in $WORKDIR/tmp/test2/*; do bs1770gain $f; done
+
+ rm -rf $WORKDIR/tmp
+}
-bs1770gain debian/tests/yell.wav -o $WORKDIR/test1
-for f in $WORKDIR/test1/*; do bs1770gain $f; done
+test_on_file debian/tests/yell.wav
-bs1770gain debian/tests/yell.wav -a -o $WORKDIR/test2
-for f in $WORKDIR/test2/*; do bs1770gain $f; done
+# Test using 64 bit samples to check alignment
+for bits in 16 32 64 ; do
+ file=$WORKDIR/sine-${bits}bit.wav
+ sox -b $bits -n $file synth 3 sine 300-3300
+ test_on_file $file
+done
--
bs1770gain packaging
More information about the pkg-multimedia-commits
mailing list