]> git.pond.sub.org Git - empserver/commitdiff
tests: Feed only logs and xdump to normalize.pl
authorMarkus Armbruster <armbru@pond.sub.org>
Tue, 28 Jan 2014 19:33:19 +0000 (20:33 +0100)
committerMarkus Armbruster <armbru@pond.sub.org>
Sun, 1 Feb 2015 15:52:59 +0000 (16:52 +0100)
Feeding other test output files (right now tests/files/files.out
tests/fairland/fairland.out fairland/newcap_script) works, but it's
odd, and might not work as well for all future output files.  Only
strip trailing white space there.

There used to be other output files that required normalize.pl: client
output.  Gone since commit 9ca3fa9.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
tests/test-common.sh

index eec7b43cb763201d8cc319f9277ee78065e90441..5fc117c128ac0a4a140f75267e2d708add8361c0 100644 (file)
@@ -177,18 +177,22 @@ cmp_logs_xdump()
 
 cmp_out()
 {
-    local opt exp act nrm ret=0
+    local exp act nrm ret=0
     for i
     do
-       case "$i" in
-       */journal.log)  opt=-j ;;
-       */server.log)   opt=-s ;;
-       *)              opt= ;;
-       esac
        exp="$testdir/${i##*/}"
        act="sandbox/$i"
        nrm="sandbox/normalized-${i##*/}"
-       perl "$srcdir"/tests/normalize.pl $opt "$act" >"$nrm"
+       case "$i" in
+       */journal.log)
+           perl "$srcdir"/tests/normalize.pl -j "$act" ;;
+       */server.log)
+           perl "$srcdir"/tests/normalize.pl -s "$act" ;;
+       *.xdump)
+           perl "$srcdir"/tests/normalize.pl "$act" ;;
+       *)
+           perl -pe 's/\s+$/\n/;' "$act" ;;
+       esac >"$nrm"
        if diff -u "$exp" "$nrm" >"$nrm.diff"
        then
            echo "$i OK"