Statistics
| Branch: | Revision:

ffmpeg / tests / fate-update.sh @ c7d89948

History | View | Annotate | Download (1.58 KB)

1 2fad0977 Måns Rullgård
#! /bin/sh
2
3
set -e
4
5
base=$(dirname $0)
6
ref="${base}/ref/fate"
7
8
FATE_DB_URL="http://fate.multimedia.cx/fate-tests.sqlite.bz2"
9
FATE_DB=$(mktemp fate-db.XXXXXX)
10
SQL_TESTS='SELECT id,short_name,command FROM test_spec WHERE active=1 ORDER BY short_name'
11
12
do_sql(){
13
    sqlite3 -noheader -separator ' ' "$FATE_DB" "$@"
14
}
15
16
wget -q -O - "$FATE_DB_URL" | bunzip2 > "$FATE_DB"
17
mkdir -p "$ref"
18
exec 3>"$base/fate.mak"
19
20
do_sql "$SQL_TESTS" | while read id name command; do
21
    case "$name" in
22
        00-full-regression|ffmpeg-help|binsize-*) continue ;;
23
    esac
24
    case "$command" in
25 f366a6de Måns Rullgård
        {MD5}*)
26
            command="${command#*ffmpeg}"; command="${command% -}"
27
            command="md5 $command"
28
            ;;
29 2fad0977 Måns Rullgård
        {*}*)   continue ;;
30 f366a6de Måns Rullgård
        *-f\ framecrc\ -)
31
            command="${command#*ffmpeg}"; command="${command% -f *}"
32
            command="framecrc $command"
33
            ;;
34
        *-f\ framemd5\ -)
35
            command="${command#*ffmpeg}"; command="${command% -f *}"
36
            command="framemd5 $command"
37
            ;;
38
        *-f\ crc\ -)
39
            command="${command#*ffmpeg}"; command="${command% -f *}"
40
            command="crc $command"
41
            ;;
42 77cce79a Måns Rullgård
        *)
43
            echo "Unhandled command '$command'"
44
            exit 1
45
            ;;
46 2fad0977 Måns Rullgård
    esac
47 d2f33c80 Måns Rullgård
    command=$(echo "$command" | sed 's/\$SAMPLES_PATH/$(SAMPLES)/g')
48 f366a6de Måns Rullgård
    command=$(echo "$command" | sed 's/ *$//')
49 2fad0977 Måns Rullgård
    do_sql "SELECT expected_stdout FROM test_spec WHERE id=$id" | awk '/./{print}' > "$ref/$name"
50
    printf "FATE_TESTS += fate-${name}\n" >&3
51
    printf "fate-${name}: CMD = %s\n" "$command" >&3
52
done
53
54
exec 3<&-
55
rm -f "$FATE_DB"