diff options
author | Måns Rullgård <mans@mansr.com> | 2010-03-15 19:23:24 +0000 |
---|---|---|
committer | Måns Rullgård <mans@mansr.com> | 2010-03-15 19:23:24 +0000 |
commit | 2fad0977886f99e11ec1e27f79bcb9c56737bdb0 (patch) | |
tree | 06b2473e23f3581abd75a66e7390cb176f4ee1b4 /tests/fate-update.sh | |
parent | f75ab7a64534c1a114f71da92d0fafc622d65244 (diff) | |
download | ffmpeg-2fad0977886f99e11ec1e27f79bcb9c56737bdb0.tar.gz |
Add FATE tests
This adds a "fate" make target which runs the full FATE test suite.
Individual tests can be run with "make fate-$testname".
The location of the FATE test samples must be specified with the
--samples=PATH option to configure.
The tests/fate-update.sh script regenerates the references files and
test list from the online FATE database. These are checked in since
generating them requires non-standard tools.
Originally committed as revision 22552 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'tests/fate-update.sh')
-rwxr-xr-x | tests/fate-update.sh | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/tests/fate-update.sh b/tests/fate-update.sh new file mode 100755 index 0000000000..92eaaf5a6b --- /dev/null +++ b/tests/fate-update.sh @@ -0,0 +1,36 @@ +#! /bin/sh + +set -e + +base=$(dirname $0) +ref="${base}/ref/fate" + +FATE_DB_URL="http://fate.multimedia.cx/fate-tests.sqlite.bz2" +FATE_DB=$(mktemp fate-db.XXXXXX) +SQL_TESTS='SELECT id,short_name,command FROM test_spec WHERE active=1 ORDER BY short_name' + +do_sql(){ + sqlite3 -noheader -separator ' ' "$FATE_DB" "$@" +} + +wget -q -O - "$FATE_DB_URL" | bunzip2 > "$FATE_DB" +rm -rf "$ref" +mkdir -p "$ref" +exec 3>"$base/fate.mak" + +do_sql "$SQL_TESTS" | while read id name command; do + case "$name" in + 00-full-regression|ffmpeg-help|binsize-*) continue ;; + esac + case "$command" in + {MD5}*) command="${command#\{MD5\}} | do_md5sum | cut -c-32" ;; + {*}*) continue ;; + esac + command=$(echo "$command" | sed 's/\$/$$/g') + do_sql "SELECT expected_stdout FROM test_spec WHERE id=$id" | awk '/./{print}' > "$ref/$name" + printf "FATE_TESTS += fate-${name}\n" >&3 + printf "fate-${name}: CMD = %s\n" "$command" >&3 +done + +exec 3<&- +rm -f "$FATE_DB" |