Skip creation of tests/data directory in individual regression test scripts.
[ffmpeg.git] / tests / ffserver-regression.sh
1 #!/bin/sh
2
3 #perl -e 'chomp($wd = `pwd`); print map { s!tests/data/!!; "<Stream $_>\nFile $wd/tests/data/$_\n</Stream>\n\n" } @ARGV' tests/data/a* >> tests/data/ffserver.conf
4 #perl -e 'chomp($wd = `pwd`); print map { s!tests/data/!!; "<Stream $_.asf>\nFile $wd/tests/data/$_\n</Stream>\n\n" } @ARGV' tests/data/a* >> tests/data/ffserver.conf
5
6 FILES=`sed -n 's/^[^#]*<Stream \(.*\)>.*/\1/p' $2 | grep -v html`
7
8 rm -f tests/feed1.ffm
9 ./ffserver -d -f "$2" 2> /dev/null &
10 FFSERVER_PID=$!
11 echo "Waiting for feeds to startup..."
12 sleep 2
13 (
14     cd tests/data || exit $?
15     rm -f ff-*;
16     WGET_OPTIONS="--user-agent=NSPlayer -q --proxy=off -e verbose=off -e server_response=off"
17     for file in $FILES; do
18         if [ `expr $file : "a-*"` != 0 ]; then
19             wget $WGET_OPTIONS -O - http://localhost:9999/$file > ff-$file
20         else
21             wget $WGET_OPTIONS -O - http://localhost:9999/$file?date=19700101T000000Z | dd bs=1 count=20000 > ff-$file 2>/dev/null
22         fi
23         MDFILES="$MDFILES ff-$file"
24     done
25     wait
26     # the status page is always different
27     md5sum $MDFILES > ffserver.regression
28 )
29 kill $FFSERVER_PID
30 wait > /dev/null 2>&1
31 rm -f tests/feed1.ffm
32 if diff -u tests/data/ffserver.regression "$1" ; then
33     echo
34     echo Server regression test succeeded.
35     exit 0
36 else
37     echo
38     echo Server regression test: Error.
39     exit 1
40 fi