From: Bruno Haible Date: Sun, 30 Aug 2009 23:15:19 +0000 (+0200) Subject: Fix a test failure on Solaris. X-Git-Tag: v0.18~116 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a39348370abf798e7edd9b460b883a621cbab59e;p=thirdparty%2Fgettext.git Fix a test failure on Solaris. --- diff --git a/gettext-tools/tests/ChangeLog b/gettext-tools/tests/ChangeLog index f96b1f573..b8507d6aa 100644 --- a/gettext-tools/tests/ChangeLog +++ b/gettext-tools/tests/ChangeLog @@ -1,3 +1,8 @@ +2009-08-30 Bruno Haible + + Fix a test failure on Solaris. + * msgexec-2 (TR): New variable. + 2009-08-15 Bruno Haible * msgunfmt-tcl-1: Explain that this test fails on mingw. diff --git a/gettext-tools/tests/msgexec-2 b/gettext-tools/tests/msgexec-2 index 9191d0598..94d61e9db 100755 --- a/gettext-tools/tests/msgexec-2 +++ b/gettext-tools/tests/msgexec-2 @@ -5,6 +5,18 @@ tmpfiles="" trap 'rm -fr $tmpfiles' 1 2 3 15 +# Find a 'tr' program that supports NUL bytes in the input. +# Solaris /usr/bin/tr does not. +if test -f /usr/xpg6/bin/tr; then + TR=/usr/xpg6/bin/tr +else + if test -f /usr/xpg4/bin/tr; then + TR=/usr/xpg4/bin/tr + else + TR=tr + fi +fi + tmpfiles="$tmpfiles mex-test2.po" cat <<\EOF > mex-test2.po # HEADER. @@ -64,7 +76,7 @@ ${MSGEXEC} -i mex-test2.po 0 > mex-test2.tmp 2> mex-test2.err result=$? cat mex-test2.err | grep -v 'warning: Locale charset' | grep -v '^ ' test $result = 0 || { rm -fr $tmpfiles; exit 1; } -LC_ALL=C tr -d '\r' < mex-test2.tmp > mex-test2.out +LC_ALL=C $TR -d '\r' < mex-test2.tmp > mex-test2.out test $? = 0 || { rm -fr $tmpfiles; exit 1; } : ${CMP=cmp}