]> granicus.if.org Git - strace/commitdiff
tests: add support of multi-line diagnostics to check_h
authorDmitry V. Levin <ldv@altlinux.org>
Fri, 4 Oct 2019 21:58:20 +0000 (21:58 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Fri, 4 Oct 2019 21:58:20 +0000 (21:58 +0000)
* tests/syntax.sh (check_h): Add support of multi-line diagnostics.

tests/syntax.sh

index 2e30e6a14d2e4155ff23973e16ec50fb85923408..019d839a6c50eb213e82a4c8038f6d510e007ab1 100644 (file)
@@ -50,10 +50,14 @@ __EOF__
 
 check_h()
 {
-       local pattern="$1"; shift
-       cat > "$EXP" << __EOF__
-$STRACE_EXE: $pattern
-Try '$STRACE_EXE -h' for more information.
-__EOF__
+       local patterns="$1"; shift
+       {
+               local pattern
+               printf '%s\n' "$patterns" |
+                       while read -r pattern; do
+                               printf '%s: %s\n' "$STRACE_EXE" "$pattern"
+                       done
+               printf "Try '%s -h' for more information.\\n" "$STRACE_EXE"
+       } > "$EXP"
        check_exit_status_and_stderr "$@"
 }