enhance tests

master
Rob Sykes 2016-03-08 20:11:04 +00:00
parent e6452b63b4
commit fa9070cbea
2 changed files with 6 additions and 7 deletions

View File

@ -23,7 +23,7 @@ zs=(180 180 180 180 180 120 120 120 120)
do_one() {
it=${types[$1]}; ot=${types[`expr $2 % 4 || true`]}
$tool $ir $or $c $1 $2 $3 < $c.$it > a.$ot
sox -r $or -c $c a.$ot -n spectrogram -X50 -hw$w -z${zs[$n]} -o io$c$n$w.png -c "io-test i:$it o:$ot ($2) q:$3"
sox -r $or -c $c a.$ot -n spectrogram -X50 -hw$w -z${zs[$n]} -o io$c$n-$w.png -c "io-test i:$it o:$ot ($2) q:$3"
./4-split-channels $ir $or $c $1 $2 $3 < $c.$it > b.$ot
[ $2 != 3 ] && cmp a.$ot b.$ot ||
test $(sox -mv-1 -r$or -c$c a.$ot -r$or -c$c b.$ot -n stats 2>&1 |grep Pk\ l|tr ' ' '\n'|grep '[0-9]'|uniq) = -84.29

View File

@ -8,9 +8,8 @@ set -e
tool=./3-options-input-fn
ext=f32; e=0
test z$1 != z && c=$1 || c=2
qs="`seq 0 7`"
qv="4 20"
test z"$1" != z && c="$1" || c=2
test z"$2" != z && qs="$2" || qs="`seq 0 7` v"
rates="48000 77773 96000"
time=`which time`
BASE=`basename $0`
@ -23,9 +22,9 @@ for rate0 in $rates; do
rate2=$rate0
for n in 1 2; do
sox -R -r $rate1 -n -c $c 0.$ext synth $len noise; sync
for q in $qs "$qv"; do
$time -f %e -o $TIME $tool $rate1 $rate2 $c $e $e $q < 0.$ext > /dev/null 2> $ERR
[ "$q" == "4 20" ] && q=v
for q in $qs; do
test $q = v && Q="4 20" || Q=$q
$time -f %e -o $TIME $tool $rate1 $rate2 $c $e $e $Q < 0.$ext > /dev/null 2> $ERR
echo $rate1 '-->' $rate2 c=$c q=$q t=`cat $TIME` `cat $ERR | sed 's/.*(/(/'`
done
rate1=$rate0