There is no benefit from adding a separate test type for reference
specs/files that happen to be only one line long. Eliminating the
special-casing simplifies the code and avoids having to deal with
slightly different ways of adding tests depending on reference
file length.

This also eliminates any problems with mixed platform line endings.
---
 tests/fate-run.sh                       |    9 +--------
 tests/fate/probe.mak                    |   17 +++++------------
 tests/ref/fate/probe-format-roundup1383 |    1 +
 tests/ref/fate/probe-format-roundup1414 |    1 +
 tests/ref/fate/probe-format-roundup2015 |    1 +
 tests/ref/fate/probe-format-roundup997  |    1 +
 6 files changed, 10 insertions(+), 20 deletions(-)
 create mode 100644 tests/ref/fate/probe-format-roundup1383
 create mode 100644 tests/ref/fate/probe-format-roundup1414
 create mode 100644 tests/ref/fate/probe-format-roundup2015
 create mode 100644 tests/ref/fate/probe-format-roundup997

diff --git a/tests/fate-run.sh b/tests/fate-run.sh
index a45e9a9..023d825 100755
--- a/tests/fate-run.sh
+++ b/tests/fate-run.sh
@@ -60,12 +60,6 @@ stddev(){
     do_tiny_psnr "$1" "$2" stddev
 }
 
-oneline(){
-    val=$(cat "$2")
-    test x"$val" = x"$1" || { r=$?; printf -- '-%s\n+%s\n' "$ref" "$val"; }
-    return ${r:-0}
-}
-
 run(){
     test "${V:-0}" -gt 0 && echo "$target_exec" $target_path/"$@" >&3
     $target_exec $target_path/"$@"
@@ -157,12 +151,11 @@ if [ $err -gt 128 ]; then
     test "${sig}" = "${sig%[!A-Za-z]*}" || unset sig
 fi
 
-if test -e "$ref" || test $cmp = "oneline" ; then
+if test -e "$ref" ; then
     case $cmp in
         diff)   diff -u -w "$ref" "$outfile"            >$cmpfile ;;
         oneoff) oneoff     "$ref" "$outfile"            >$cmpfile ;;
         stddev) stddev     "$ref" "$outfile"            >$cmpfile ;;
-        oneline)oneline    "$ref" "$outfile"            >$cmpfile ;;
         null)   cat               "$outfile"            >$cmpfile ;;
     esac
     cmperr=$?
diff --git a/tests/fate/probe.mak b/tests/fate/probe.mak
index 77e9943..e6c83ae 100644
--- a/tests/fate/probe.mak
+++ b/tests/fate/probe.mak
@@ -1,18 +1,11 @@
-FATE_PROBE_FORMAT += fate-probe-format-roundup997
-fate-probe-format-roundup997:  REF = format_name=mpeg
-
-FATE_PROBE_FORMAT += fate-probe-format-roundup1383
-fate-probe-format-roundup1383: REF = format_name=mp3
-
-FATE_PROBE_FORMAT += fate-probe-format-roundup1414
-fate-probe-format-roundup1414: REF = format_name=mpeg
-
-FATE_PROBE_FORMAT += fate-probe-format-roundup2015
-fate-probe-format-roundup2015: REF = format_name=dv
+PROBE_FORMAT += roundup997                                              \
+                roundup1383                                             \
+                roundup1414                                             \
+                roundup2015                                             \
 
+FATE_PROBE_FORMAT = $(PROBE_FORMAT:%=fate-probe-format-%)
 FATE-$(CONFIG_AVPROBE) += $(FATE_PROBE_FORMAT)
 fate-probe-format: $(FATE_PROBE_FORMAT)
 
 $(FATE_PROBE_FORMAT): avprobe$(EXESUF)
-$(FATE_PROBE_FORMAT): CMP = oneline
 fate-probe-format-%: CMD = probefmt 
$(SAMPLES)/probe-format/$(@:fate-probe-format-%=%)
diff --git a/tests/ref/fate/probe-format-roundup1383 
b/tests/ref/fate/probe-format-roundup1383
new file mode 100644
index 0000000..39bc1d9
--- /dev/null
+++ b/tests/ref/fate/probe-format-roundup1383
@@ -0,0 +1 @@
+format_name=mp3
diff --git a/tests/ref/fate/probe-format-roundup1414 
b/tests/ref/fate/probe-format-roundup1414
new file mode 100644
index 0000000..d8fcaf4
--- /dev/null
+++ b/tests/ref/fate/probe-format-roundup1414
@@ -0,0 +1 @@
+format_name=mpeg
diff --git a/tests/ref/fate/probe-format-roundup2015 
b/tests/ref/fate/probe-format-roundup2015
new file mode 100644
index 0000000..d033aa4
--- /dev/null
+++ b/tests/ref/fate/probe-format-roundup2015
@@ -0,0 +1 @@
+format_name=dv
diff --git a/tests/ref/fate/probe-format-roundup997 
b/tests/ref/fate/probe-format-roundup997
new file mode 100644
index 0000000..d8fcaf4
--- /dev/null
+++ b/tests/ref/fate/probe-format-roundup997
@@ -0,0 +1 @@
+format_name=mpeg
-- 
1.7.1

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to