ref: c826576d4232f0d8394913bc7789f5ba472457c1
parent: 63bba519174f7a4463356b122c47b5c59b1b5841
author: cbagwell <cbagwell>
date: Tue Dec 8 20:29:26 EST 2009
Support file extensions to allow testing mingw cross compiles+wine.
--- a/src/testall.sh
+++ b/src/testall.sh
@@ -2,6 +2,8 @@
srcdir="."
effect=""
+EXEEXT=
+
# Allow user to override paths. Useful for testing an installed
# sox.
while [ $# -ne 0 ]; do
@@ -36,8 +38,8 @@
opts="$*"
echo "Format: $format Options: $opts"
- ${bindir}/sox ${srcdir}/monkey.wav $opts /tmp/monkey.$format $effect
- ${bindir}/sox $opts /tmp/monkey.$format /tmp/monkey1.wav $effect
+ ${bindir}/sox${EXEEXT} ${srcdir}/monkey.wav $opts /tmp/monkey.$format $effect
+ ${bindir}/sox${EXEEXT} $opts /tmp/monkey.$format /tmp/monkey1.wav $effect
}
t 8svx
t aiff
--- a/src/tests.sh
+++ b/src/tests.sh
@@ -5,6 +5,7 @@
bindir="."
builddir="."
srcdir="."
+EXEEXT=
# Set options & allow user to override paths. Useful for testing an
# installed sox.
@@ -87,9 +88,9 @@
if [ "${format1_skip}x" = "x" -a "${from_skip}x" = "x" ] ; then
getFormat ${format1}; format1Ext=$formatExt; format1Text=$formatText; format1Flags=$formatFlags
getFormat $1; format2Ext=$formatExt; format2Text=$formatText; format2Flags=$formatFlags
- execute ${bindir}/sox $verbose -RD -r $rate -c $channels -n $format1Flags input.$format1Ext synth $samples's' sin 300-3300 noise trapezium
- execute ${bindir}/sox $verbose -RD -r $rate -c $channels $format1Flags input.$format1Ext $format2Flags intermediate.$format2Ext
- execute ${bindir}/sox $verbose -RD -r $rate -c $channels $format2Flags intermediate.$format2Ext $format1Flags output.$format1Ext
+ execute ${bindir}/sox${EXEEXT} $verbose -RD -r $rate -c $channels -n $format1Flags input.$format1Ext synth $samples's' sin 300-3300 noise trapezium
+ execute ${bindir}/sox${EXEEXT} $verbose -RD -r $rate -c $channels $format1Flags input.$format1Ext $format2Flags intermediate.$format2Ext
+ execute ${bindir}/sox${EXEEXT} $verbose -RD -r $rate -c $channels $format2Flags intermediate.$format2Ext $format1Flags output.$format1Ext
intermediateReference=vectors/intermediate`echo "$channels $rate $format1Flags $format1Ext $format2Flags"|tr " " "_"`.$format2Ext
# Uncomment to generate new reference files
@@ -178,7 +179,7 @@
# Reading and writing performance test
time="/usr/bin/time -p"
timeIO () {
- $time ${bindir}/sox -c $channels -r $rate -n tmp.sox synth $samples's' saw 0:`expr $rate / 2` noise brown vol .9 2> tmp.write
+ $time ${bindir}/sox${EXEEXT} -c $channels -r $rate -n tmp.sox synth $samples's' saw 0:`expr $rate / 2` noise brown vol .9 2> tmp.write
echo TIME synth channels=$channels samples=$samples `stderr_time tmp.write`s
if [ `uname` != SunOS ]; then
while [ $# != 0 ]; do
@@ -187,8 +188,8 @@
fi
if [ "${from_skip}x" = "x" ] ; then
getFormat $1;
- ($time ${bindir}/sox $verbose -D tmp.sox $formatFlags -t $1 - 2> tmp.read) | \
- ($time ${bindir}/sox $verbose -t $1 -c $channels -r $rate - -t sox /dev/null 2> tmp.write)
+ ($time ${bindir}/sox${EXEEXT} $verbose -D tmp.sox $formatFlags -t $1 - 2> tmp.read) | \
+ ($time ${bindir}/sox${EXTEXT} $verbose -t $1 -c $channels -r $rate - -t sox /dev/null 2> tmp.write)
echo "TIME `printf %4s $formatText` write=`stderr_time tmp.write`s read=`stderr_time tmp.read`s"
fi
shift
@@ -200,7 +201,7 @@
# Don't try to test un-built formats
skip_check () {
while [ $# -ne 0 ]; do
- ${bindir}/sox --help|grep "^AUDIO FILE.*\<$1\>">/dev/null || skip="$1 $skip"
+ ${bindir}/sox${EXEEXT} --help|grep "^AUDIO FILE.*\<$1\>">/dev/null || skip="$1 $skip"
shift
done
}
@@ -208,7 +209,7 @@
# Run tests
-${builddir}/sox_sample_test || exit 1
+${builddir}/sox_sample_test${EXEEXT} || exit 1
skip_check caf flac mat4 mat5 paf w64 wv
@@ -245,7 +246,7 @@
fi
fi
-${bindir}/sox -c 1 -r 44100 -n output.u8 synth .01 vol .5
+${bindir}/sox${EXEEXT} -c 1 -r 44100 -n output.u8 synth .01 vol .5
if [ `wc -c <output.u8` = 441 ]; then
echo "ok synth size"
else