]> git.sesse.net Git - ffmpeg/commitdiff
fate: add an option to generate the references
authorLuca Barbato <lu_zero@gentoo.org>
Mon, 18 Mar 2013 22:45:58 +0000 (23:45 +0100)
committerLuca Barbato <lu_zero@gentoo.org>
Fri, 29 Mar 2013 14:41:26 +0000 (15:41 +0100)
Useful to add or update fate tests.

doc/fate.texi
tests/Makefile
tests/fate-run.sh

index 975f40a6c490de1b085483188d9035b20385c74d..bc6ab3ecb548387543d1c26fca01030e6c7ec4a8 100644 (file)
@@ -85,6 +85,8 @@ by default @var{slice+frame}
 Specify a mask to be applied to autodetected CPU flags.
 @item TARGET_EXEC
 Specify or override the wrapper used to run the tests.
+@item GEN
+Set to @var{1} to generate the missing or mismatched references.
 @end table
 
 @example
index 4e4eb897c051ed6e4ccbb3d4c9f7f3821b2de3c2..67ce45e862e4d49eba410cb540c18ef23027343f 100644 (file)
@@ -118,7 +118,7 @@ fate: $(FATE)
 
 $(FATE): $(FATE_UTILS:%=tests/%$(HOSTEXESUF))
        @echo "TEST    $(@:fate-%=%)"
-       $(Q)$(SRC_PATH)/tests/fate-run.sh $@ "$(SAMPLES)" "$(TARGET_EXEC)" "$(TARGET_PATH)" '$(CMD)' '$(CMP)' '$(REF)' '$(FUZZ)' '$(THREADS)' '$(THREAD_TYPE)' '$(CPUFLAGS)' '$(CMP_SHIFT)' '$(CMP_TARGET)' '$(SIZE_TOLERANCE)' '$(CMP_UNIT)'
+       $(Q)$(SRC_PATH)/tests/fate-run.sh $@ "$(SAMPLES)" "$(TARGET_EXEC)" "$(TARGET_PATH)" '$(CMD)' '$(CMP)' '$(REF)' '$(FUZZ)' '$(THREADS)' '$(THREAD_TYPE)' '$(CPUFLAGS)' '$(CMP_SHIFT)' '$(CMP_TARGET)' '$(SIZE_TOLERANCE)' '$(CMP_UNIT)' '$(GEN)'
 
 fate-list:
        @printf '%s\n' $(sort $(FATE))
index d1633e8be4c367c793cb01dbf3e79250c1b9e8c2..70821bbcec907a87136346655b2227b431f2b883 100755 (executable)
@@ -22,6 +22,7 @@ cmp_shift=${12:-0}
 cmp_target=${13:-0}
 size_tolerance=${14:-0}
 cmp_unit=${15:-2}
+gen=${16:-no}
 
 outdir="tests/data/fate"
 outfile="${outdir}/${test}"
@@ -189,5 +190,11 @@ fi
 
 echo "${test}:${sig:-$err}:$($base64 <$cmpfile):$($base64 <$errfile)" >$repfile
 
+if test $err != 0 && test $gen != "no" ; then
+    echo "GEN     $ref"
+    cp -f "$outfile" "$ref"
+    err=$?
+fi
+
 test $err = 0 && rm -f $outfile $errfile $cmpfile $cleanfiles
 exit $err