Commit 24342d59 authored by Simon McVittie's avatar Simon McVittie Committed by Ralf Habacker

When running TAP tests, filter out trailing \r from Windows .exe

If we're running Windows executables using Wine, then
won't accept "1..4\r\n" as TAP syntax.

Bug: Ralf Habacker's avatarRalf Habacker <>
parent 24b6eecc
......@@ -10,4 +10,24 @@
set -e
exec "$t" --tap "$@"
case "$t" in
# We're running a Windows executable, possibly on a Unix
# platform. Avoid having invalid TAP syntax like "ok 3\r\n"
# where "ok 3\n" was intended.
echo 1 > "$t".exit-status.tmp
set +e
"$t" --tap "$@"
echo "$?" > "$t".exit-status.tmp
) | sed -e 's/\r$//'
e="$(cat "$t".exit-status.tmp)"
rm "$t".exit-status.tmp
exit "$e"
exec "$t" --tap "$@"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment