t: replace shell scripts by pipe parameters in name
authorMischa POSLAWSKY <perl@shiar.org>
Wed, 11 Sep 2019 12:26:22 +0000 (14:26 +0200)
committerMischa POSLAWSKY <perl@shiar.org>
Thu, 12 Sep 2019 15:48:11 +0000 (17:48 +0200)
t/regress.t
t/t0002-usage_-h.sh [deleted file]
t/t0002-usage_-h_|wc_-l.in [moved from t/t0002-usage_-h.in with 100% similarity]
t/t0002-usage_-h_|wc_-l.out [new file with mode: 0644]
t/t0003-invalid_options_-aZ_|[_$?_=_64_].in [moved from t/t0003-invalid_options_-aZ.in with 100% similarity]
t/t0003-invalid_options_-aZ_|[_$?_=_64_].out [moved from t/t0003-invalid_options_-aZ.out with 100% similarity]

index b8d05ddcc8a3170072dd2681c3ec99fadf6647d4..734e42dbc876cc4864868db745c33728497ab71a 100755 (executable)
@@ -33,8 +33,9 @@ do
        test -r "$file.in" || continue
 
        name="$(echo ${file#*-} | tr _ \ )"
-       cmd="barcat $file.in"
-       case "$name" in *\ -*) cmd="$cmd -${name#* -}";; esac
+       set -- barcat "$file.in"
+       case "$name" in *\ -*) set -- "$@" "-${name#* -}";; esac
+       case "$name" in *' |'*)  set -- sh -c "\$0 \$1 $3" "$@";; esac
 
        if test -n "$regenerate"
        then
@@ -43,10 +44,9 @@ do
                        echo "ok $test_count # skip $file.out"
                        continue
                fi
-               $cmd >$file.out 2>&1
+               "$@" >$file.out 2>&1
        else
-               if test -e $file.sh;  then $cmd 2>&1 | ./$file.sh; fi &&
-               if test -e $file.out; then $cmd 2>&1 | diffcmd "$file.out" -; fi
+               if test -e $file.out; then "$@" 2>&1 | diffcmd "$file.out" -; fi
        fi
 
        if test 0 != $?
diff --git a/t/t0002-usage_-h.sh b/t/t0002-usage_-h.sh
deleted file mode 100755 (executable)
index 2f1d996..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-#!/bin/sh
-grep -q Usage:
diff --git a/t/t0002-usage_-h_|wc_-l.out b/t/t0002-usage_-h_|wc_-l.out
new file mode 100644 (file)
index 0000000..7273c0f
--- /dev/null
@@ -0,0 +1 @@
+25