From: Richard W.M. Jones Date: Fri, 15 Jul 2011 21:09:29 +0000 (+0100) Subject: Fix test-guestfish-escapes regression test to work with debug/trace enabled. X-Git-Tag: 1.11.19~16 X-Git-Url: http://git.annexia.org/?a=commitdiff_plain;h=9f135be96e21d899b36ef2287a6ba8cea9beb4ff;p=libguestfs.git Fix test-guestfish-escapes regression test to work with debug/trace enabled. If debugging or tracing is enabled, extra messages are sent to stderr which mess with this test. Remove the extra messages before checking stderr. This updates commit 617e7f6bafa7de2303c08e1715004aae3141c389. --- diff --git a/regressions/test-guestfish-escapes.sh b/regressions/test-guestfish-escapes.sh index 6f4f434..3ba37d2 100755 --- a/regressions/test-guestfish-escapes.sh +++ b/regressions/test-guestfish-escapes.sh @@ -20,7 +20,7 @@ set -e -rm -f test.output test.error +rm -f test.output test.error test.error.old ../fish/guestfish <<'EOF' 2>test.error | od > test.output echo "" @@ -47,6 +47,11 @@ echo "\100" -echo """ EOF +# Since trace and debug output also goes to stderr, we must +# remove it before testing. +mv test.error test.error.old +grep -v '^libguestfs: ' < test.error.old > test.error + if [ "$(cat test.error)" != "\ guestfish: invalid escape sequence in string (starting at offset 0) guestfish: invalid escape sequence in string (starting at offset 0) @@ -75,4 +80,4 @@ if [ "$(cat test.output)" != "\ exit 1 fi -rm -f test.output test.error +rm -f test.output test.error test.error.old