1
# ----------------------------------------------------------------------
2
# File: ecasound/manual-tests/test-common-sh
3
# License: GPL (see ecasound/{AUTHORS,COPYING})
4
# ----------------------------------------------------------------------
6
function error_exit() {
7
echo "ERROR: Test failure, exiting."
11
function check_ecabin() {
12
if [ ! -e $TESTECASOUND ] ; then
13
echo "Ecasound binary not found."
18
function set_ecasound_envvar() {
19
if test "x$TESTECASOUND" = "x"; then
20
if test -e "../../ecasound/ecasound_debug" ; then
21
TESTECASOUND="../../ecasound/ecasound_debug"
23
TESTECASOUND="../../ecasound/ecasound"
28
function check_md5sum() {
30
if test "`md5sum $1 |cut -f1 -d' '`" != "$2" ; then
31
echo -e "\n\nWARNING: md5sum did not match (not necessarily an error, but"
32
echo -e "\tneeds to be manually verified).\n"
33
if test "x$SKIP_MD5SUM" != "x1"; then
40
function check_filesize() {
42
if test "`stat --format=%s $1`" != "$2" ; then
43
echo -e "WARNING: size did not match (not necessarily an error, but"
44
echo -e "\tneeds to be manually verified)."
45
if test "x$SKIP_FILESIZE_CHECK" != "x1"; then
52
function check_zerosum() {
54
ecasound -a:1 -i $1 -a:2 -i $2 -ea:-100 -a:1,2 -o dst-tmp.wav -x -q || error_exit
55
sigmax=`sndfile-info dst-tmp.wav |grep "Signal Max" |cut -d ':' -f2 |cut -d ' ' -f2 |cut -d ' ' -f2`
56
sndfile-info dst-tmp.wav |grep "Signal Max"
57
if [ $sigmax != "0" -a $sigmax != "1" ] ; then
58
echo -e "WARNING: zerosum signal left $sigmax, manual verification required."
59
if test "$SKIP_ZEROSUM_CHECK" = "x" ; then
66
function check_samples() {
68
samples=`sndfile-info $1 |grep Frames |cut -d ':' -f2`
69
if [ $samples != $2 ] ; then
70
echo -e "WARNING: sample count did not match (not necessarily an error, but"
71
echo -e "\tneeds to be manually verified)."
72
if test "$SKIP_SAMPLECNT_CHECK" = "x" ; then
79
# a very rough way to check whether newly
80
# created audio file has similar content than
81
# the orignal: count how many positive samples
84
function check_1dbpeak_count() {
86
count=`ecasound -i $1 -o null -ev |grep "Pos -1.0" |cut -d':' -f2 |cut -d',' -f1 |cut -c4-`
87
if test $count != $2 ; then
88
echo -e "WARNING: peak count samples did not match (not necessarily an error, but"
89
echo -e "\tneeds to be manually verified)."
90
if test "x$SKIP_1DBPEAK_CHECK" = "x"; then