diff options
author | Luca Barbato <lu_zero@gentoo.org> | 2013-03-19 02:45:58 +0400 |
---|---|---|
committer | Luca Barbato <lu_zero@gentoo.org> | 2013-03-29 18:41:26 +0400 |
commit | b01b60a29db1ec4478b82d47d2ed668173f5de63 (patch) | |
tree | d5e6ff97c08feb3760ca8c35875d001d4556daac | |
parent | e46a2a7309d8e8b8c1573047731dea77695d0ce1 (diff) |
fate: add an option to generate the references
Useful to add or update fate tests.
-rw-r--r-- | doc/fate.texi | 2 | ||||
-rw-r--r-- | tests/Makefile | 2 | ||||
-rwxr-xr-x | tests/fate-run.sh | 7 |
3 files changed, 10 insertions, 1 deletions
diff --git a/doc/fate.texi b/doc/fate.texi index 975f40a6c4..bc6ab3ecb5 100644 --- a/doc/fate.texi +++ b/doc/fate.texi @@ -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 diff --git a/tests/Makefile b/tests/Makefile index 4e4eb897c0..67ce45e862 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -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)) diff --git a/tests/fate-run.sh b/tests/fate-run.sh index d1633e8be4..70821bbcec 100755 --- a/tests/fate-run.sh +++ b/tests/fate-run.sh @@ -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 |