Go to most recent revision | Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
4349 | Serge | 1 | #! /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 | {MD5}*) |
||
26 | command="${command#*ffmpeg}"; command="${command% -}" |
||
27 | command="md5 $command" |
||
28 | ;; |
||
29 | {*}*) continue ;; |
||
30 | *-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 | *) |
||
43 | echo "Unhandled command '$command'" |
||
44 | exit 1 |
||
45 | ;; |
||
46 | esac |
||
47 | command=$(echo "$command" | sed 's/\$SAMPLES_PATH/$(SAMPLES)/g') |
||
48 | command=$(echo "$command" | sed 's/ *$//') |
||
49 | 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"&- |