summaryrefslogtreecommitdiff
path: root/t/self-check-shell-no-trail-bslash.sh
diff options
context:
space:
mode:
authorStefano Lattarini <stefano.lattarini@gmail.com>2014-12-30 14:28:52 +0100
committerStefano Lattarini <stefano.lattarini@gmail.com>2014-12-30 14:48:48 +0100
commitb8aa9fc0ce8d411be4451022e4b14d0f4238a9d9 (patch)
tree458f446ac6c66ed4bbcd6be7e612c6a30cce9c03 /t/self-check-shell-no-trail-bslash.sh
parent0fae5905f9b676725a7e82c7aa03e8e3cbf5008a (diff)
downloadautomake-b8aa9fc0ce8d411be4451022e4b14d0f4238a9d9.tar.gz
shell-no-trail-bslash: improve diagnostic in case of failure
* t/ax/shell-no-trail-bslash.in: Here, by fixing a typo in a variable name and a logic error. * t/self-check-shell-no-trail-bslash.sh: Enhance to catch the issue. Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
Diffstat (limited to 't/self-check-shell-no-trail-bslash.sh')
-rw-r--r--t/self-check-shell-no-trail-bslash.sh8
1 files changed, 7 insertions, 1 deletions
diff --git a/t/self-check-shell-no-trail-bslash.sh b/t/self-check-shell-no-trail-bslash.sh
index 19198898b..8b7afa5c5 100644
--- a/t/self-check-shell-no-trail-bslash.sh
+++ b/t/self-check-shell-no-trail-bslash.sh
@@ -58,11 +58,17 @@ for sfx in \
; do
for pfx in "" "echo bad" ": a${nl}# multine${nl}: text"; do
cmd=${pfx}${sfx}
- printf '%s\n' "$cmd" > bad.sh
+ printf '%s' "$cmd" > bad.sh
for args in '-c "$cmd"' './bad.sh'; do
eval "\$SHELL $args 2>stderr && { cat stderr >&2; exit 1; }; :"
cat stderr >&2
$FGREP "recipe/script ends with backslash character" stderr
+ cmd="$cmd" $PERL -w -e '
+ undef $/;
+ $_ = <>;
+ index($_, $ENV{cmd}) >= 0 or exit 1;
+ ' <stderr
+ $FGREP "$cmd" stderr
done
done
done