OSDN Git Service

android: fix warnings from newer clang
[android-x86/external-ffmpeg.git] / tests / ffserver-regression.sh
1 #!/bin/sh
2
3 target_samples=$3
4 target_exec=$4
5 target_path=$5
6
7 #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
8 #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
9
10 . $(dirname $0)/md5.sh
11
12 FILES=$(sed -n 's/^[^#]*<Stream \(.*\)>.*/\1/p' $2 | grep -v html)
13
14 rm -f tests/feed1.ffm
15 $target_exec ${target_path}/ffserver${PROGSUF} -f "$2" &
16 FFSERVER_PID=$!
17 echo "Waiting for feeds to startup..."
18 sleep 2
19 (
20     cd tests/data || exit $?
21     rm -f ff-* ffserver.regression
22     WGET_OPTIONS="--user-agent=NSPlayer -q --proxy=off -e verbose=off -e server_response=off -T3 --tries=1"
23     for file in $FILES; do
24         if [ $(expr $file : "a-*") != 0 ]; then
25             wget $WGET_OPTIONS -O - http://localhost:9999/$file > ff-$file
26         else
27             wget $WGET_OPTIONS -O - http://localhost:9999/$file?date=19700101T000000Z | dd bs=1 count=100000 > ff-$file 2>/dev/null
28         fi
29         do_md5sum ff-$file >>ffserver.regression
30     done
31     wget  $WGET_OPTIONS -O - 'http://localhost:9999/teststat.html?abc' > ff-stat 2>/dev/null
32     do_md5sum ff-stat >>ffserver.regression
33 )
34 kill $FFSERVER_PID
35 wait > /dev/null 2>&1
36 rm -f tests/feed1.ffm
37 if diff -u "$1" tests/data/ffserver.regression; then
38     echo
39     echo Server regression test succeeded.
40     exit 0
41 else
42     echo
43     echo Server regression test: Error.
44     exit 1
45 fi