Commit 3ade7d32 authored by Måns Rullgård's avatar Måns Rullgård
Browse files

fate: pass additional variables to test script

This passes the following additional variables to the test script:

- CMP  method to use comparing output with reference, default 'diff'
- REF  reference file, default 'tests/ref/fate/${test}'
- FUZZ maximum fuzz factor in comparison, meaning depends on CMP

Originally committed as revision 24133 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent cb0067ec
...@@ -281,7 +281,7 @@ ifdef SAMPLES ...@@ -281,7 +281,7 @@ ifdef SAMPLES
fate: $(FATE_TESTS) fate: $(FATE_TESTS)
$(FATE_TESTS): ffmpeg$(EXESUF) $(FATE_TESTS): ffmpeg$(EXESUF)
@echo "TEST FATE $(@:fate-%=%)" @echo "TEST FATE $(@:fate-%=%)"
@$(SRC_PATH)/tests/fate-run.sh $@ "$(SAMPLES)" "$(TARGET_EXEC)" "$(TARGET_PATH)" '$(CMD)' @$(SRC_PATH)/tests/fate-run.sh $@ "$(SAMPLES)" "$(TARGET_EXEC)" "$(TARGET_PATH)" '$(CMD)' '$(CMP)' '$(REF)' '$(FUZZ)'
else else
fate $(FATE_TESTS): fate $(FATE_TESTS):
@echo "SAMPLES not specified, cannot run FATE" @echo "SAMPLES not specified, cannot run FATE"
......
...@@ -8,12 +8,17 @@ SAMPLES_PATH=$2 ...@@ -8,12 +8,17 @@ SAMPLES_PATH=$2
target_exec=$3 target_exec=$3
BUILD_PATH=$4 BUILD_PATH=$4
command=$5 command=$5
cmp=${6:-diff}
ref="${base}/ref/fate/${test}" ref=${7:-"${base}/ref/fate/${test}"}
fuzz=$8
outdir="tests/data/fate" outdir="tests/data/fate"
outfile="${outdir}/${test}" outfile="${outdir}/${test}"
mkdir -p "$outdir" mkdir -p "$outdir"
eval $target_exec $command > "$outfile" 2>/dev/null eval $target_exec $command > "$outfile" 2>/dev/null
diff -u -w "$ref" "$outfile"
case $cmp in
diff) diff -u -w "$ref" "$outfile" ;;
esac
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment