+2011-07-27 Stefano Lattarini <stefano.lattarini@gmail.com>
+
+ testsuite: fix a spurious failure with non-bash shells
+ * tests/tap-fancy2.test: Remove an unportable use of backslashes
+ with the `echo' builtin, which was causing some shells (among them
+ bash and Debian /bin/ksh) to print a `\\' string, while other
+ shells (among them zsh, dash, and Solaris /bin/sh and /bin/ksh)
+ were unexpectedly printing a single `\' character. Since we are
+ at it, add a sanity check to ensure that this issue does not
+ resurface.
+
2011-07-27 Stefano Lattarini <stefano.lattarini@gmail.com>
testsuite: fix spurious failures with Solaris /bin/sh
# /#\s*(TODO|SKIP)\b/.
#
+# To avoid problems with backslashes in echo arguments.
+xecho () { printf '%s\n' "$*"; }
+
# There are 34 values for $str ...
for str in \
\' \
'*.*' \
; do
# ... each of them add 1 pass, 1 fail, ...
- echo "ok${str}"
- echo "not ok${str}"
+ xecho "ok${str}"
+ xecho "not ok${str}"
# ... and (generally) 4 skips, 4 xfails, and 4 xpasses ...
for settings in \
'result="ok" directive=SKIP' \
'result="ok" directive=TODO' \
; do
eval "$settings"
- echo "${result}# ${directive}${str}"
+ xecho "${result}# ${directive}${str}"
# ... but 6 skips, 6 xpasses and 6 xfails are to be removed, since
# they might not work with $str = '#' or $str = '\' ...
if test x"$str" != x'#' && test x"$str" != x'\'; then
- echo "${result}${str}#${directive}"
- echo "${result}${str}# ${tab}${tab} ${directive}"
- echo "${result}${str}#${directive}${str}"
+ xecho "${result}${str}#${directive}"
+ xecho "${result}${str}# ${tab}${tab} ${directive}"
+ xecho "${result}${str}#${directive}${str}"
fi
done
done > all.test
+# Sanity check against a previous use of unportable usages of backslashes
+# with the "echo" builtin.
+if grep '[^\\]\\#' all.test; then
+ framework_failure_ "writing backslashes in all.test"
+fi
+
# ... so that we finally have:
pass=34
fail=34