Statistics
| Branch: | Revision:

ffmpeg / tests / server-regression.sh @ 6b8bcd3e

History | View | Annotate | Download (1.77 KB)

1 e2b2851e Philip Gladstone
#!/bin/bash
2 8c0ff5d5 Roman Shaposhnik
# Even in the 21st century some diffs are not supporting -u.
3
diff -u $0 $0 > /dev/null 2>&1
4
if [ $? -eq 0 ]; then
5
  diff_cmd="diff -u"
6
else
7
  diff_cmd="diff"
8
fi
9 115329f1 Diego Biurrun
10 d746f928 Philip Gladstone
# Make sure that the data directory exists
11 4fbd52f0 Diego Biurrun
mkdir -p tests/data
12 d746f928 Philip Gladstone
13 4fbd52f0 Diego Biurrun
#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/test.conf
14
#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/test.conf
15 d746f928 Philip Gladstone
16 46076a95 Diego Biurrun
FILES=`sed -n 's/^[^#]*<Stream \(.*\)>.*/\1/p' $2 | grep -v html`
17 e2b2851e Philip Gladstone
18 4fbd52f0 Diego Biurrun
rm -f tests/feed1.ffm
19
./ffserver -d -f tests/test.conf 2> /dev/null &
20 e2b2851e Philip Gladstone
FFSERVER_PID=$!
21 d746f928 Philip Gladstone
sleep 2
22 508826f9 Alex Beregszaszi
echo "Waiting for feeds to startup..."
23 4fbd52f0 Diego Biurrun
./ffmpeg -loop_input -flags +bitexact -dct fastint -idct simple -y -f pgmyuv -i tests/vsynth1/%02d.pgm http://localhost:9999/feed1.ffm 2> /dev/null &
24 508826f9 Alex Beregszaszi
FFMPEG_PID=$!
25
sleep 5
26 e2b2851e Philip Gladstone
(
27 4fbd52f0 Diego Biurrun
    cd tests/data || exit $?
28 d746f928 Philip Gladstone
    rm -f ff-*;
29 bf40937b Alex Beregszaszi
    WGET_OPTIONS="--user-agent=NSPlayer -q --proxy=off -e verbose=off -e server_response=off"
30 e2b2851e Philip Gladstone
    for file in $FILES; do
31 d315ec5c Diego Biurrun
        if [ `expr $file : "a-*"` != 0 ]; then
32 508826f9 Alex Beregszaszi
            wget $WGET_OPTIONS --output-document=- http://localhost:9999/$file > ff-$file
33 d746f928 Philip Gladstone
        else
34 508826f9 Alex Beregszaszi
            wget $WGET_OPTIONS --output-document=- http://localhost:9999/$file?date=19700101T000000Z | dd bs=1 count=20000 > ff-$file 2>/dev/null
35 d746f928 Philip Gladstone
        fi
36
        MDFILES="$MDFILES ff-$file"
37 115329f1 Diego Biurrun
    done
38 e2b2851e Philip Gladstone
    wait
39
    # the status page is always different
40 927e193d Aurelien Jacobs
    md5sum $MDFILES > ffserver.regression
41 e2b2851e Philip Gladstone
)
42 508826f9 Alex Beregszaszi
kill $FFMPEG_PID
43 e2b2851e Philip Gladstone
kill $FFSERVER_PID
44
wait > /dev/null 2>&1
45 4fbd52f0 Diego Biurrun
rm -f tests/feed1.ffm
46
if $diff_cmd tests/data/ffserver.regression "$1" ; then
47 115329f1 Diego Biurrun
    echo
48 e2b2851e Philip Gladstone
    echo Server regression test succeeded.
49
    exit 0
50
else
51 115329f1 Diego Biurrun
    echo
52 e2b2851e Philip Gladstone
    echo Server regression test: Error.
53
    exit 1
54
fi