diff options
author | Stefano Lattarini <stefano.lattarini@gmail.com> | 2014-12-30 22:51:26 +0100 |
---|---|---|
committer | Stefano Lattarini <stefano.lattarini@gmail.com> | 2014-12-30 22:51:26 +0100 |
commit | a5d11f767dc15a2de2d6cbc12347e7cc121a1dd4 (patch) | |
tree | 4e6a680360f56408a4ef3582d45dc8eabf2579eb /t | |
parent | 5a2ae66d8a190d80e8d132ad569c08fd207bb9bd (diff) | |
parent | 36812809ab75a07e5e8387986fc35a805d80fa36 (diff) | |
download | automake-a5d11f767dc15a2de2d6cbc12347e7cc121a1dd4.tar.gz |
Merge branch 'master' into ng/master
* master:
docs: "make distcheck" implementation details are not to be abused
NEWS: improve and adjust in light of the oncoming 1.15 release
shell-no-trail-bslash: improve diagnostic in case of failure
Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
Diffstat (limited to 't')
-rw-r--r-- | t/ax/shell-no-trail-bslash.in | 19 | ||||
-rw-r--r-- | t/self-check-shell-no-trail-bslash.sh | 8 |
2 files changed, 21 insertions, 6 deletions
diff --git a/t/ax/shell-no-trail-bslash.in b/t/ax/shell-no-trail-bslash.in index 353d4cde1..197927f48 100644 --- a/t/ax/shell-no-trail-bslash.in +++ b/t/ax/shell-no-trail-bslash.in @@ -26,6 +26,7 @@ am_SHELL=${AM_TESTSUITE_SHELL-'@SHELL@'} ( set -e shell_command=; unset shell_command + shell_script=; unset shell_script while test $# -gt 0; do case $1 in # The shell might be invoked by make e.g. as "sh -ec" or "sh -ce". @@ -40,13 +41,15 @@ am_SHELL=${AM_TESTSUITE_SHELL-'@SHELL@'} if test x${shell_command+"set"} != x"set"; then if test $# -gt 0; then - shell_command=$(cat "$1") + shell_script=$1 + shell_command=$(cat <"$shell_script") else echo "$0: fatal: no shell script given," \ "nor a command given via the '-c' option" >&2 exit 1 fi fi + original_shell_command=$shell_command tab=' ' nl=' @@ -58,10 +61,16 @@ am_SHELL=${AM_TESTSUITE_SHELL-'@SHELL@'} case "$shell_command" in *\\) - printf '%s\n' "$0: recipe/script ends with backslash character" >&2 - printf '%s\n' "=== BEGIN recipe/script" >&2 - printf '%s\n' "${shell_command-???}" >&2 - printf '%s\n' "=== END recipe/script" >&2 + { + printf '%s\n' "$0: recipe/script ends with backslash character" + printf '%s\n' "=== BEGIN recipe/script" + if test x${shell_script+"set"} = x"set"; then + cat <"$shell_script" + else + printf '%s\n' "$original_shell_command" + fi + printf '%s\n' "=== END recipe/script" + } >&2 exit 1 ;; esac diff --git a/t/self-check-shell-no-trail-bslash.sh b/t/self-check-shell-no-trail-bslash.sh index b5a1896ba..f17622061 100644 --- a/t/self-check-shell-no-trail-bslash.sh +++ b/t/self-check-shell-no-trail-bslash.sh @@ -55,11 +55,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 |