# HG changeset patch # User Bruno Haible # Date 1209212052 -7200 # Node ID 44e4e306d7c5d2d9ae5c52156346d32a450ee39f # Parent 4e68e73d390af7c6323d8a3fc06ab5ad3849ec11 Work around limitation of an old 'tr' program on Solaris. diff -r 4e68e73d390a -r 44e4e306d7c5 ChangeLog --- a/ChangeLog Sat Apr 26 12:43:40 2008 +0200 +++ b/ChangeLog Sat Apr 26 14:14:12 2008 +0200 @@ -1,3 +1,11 @@ +2008-04-26 Bruno Haible + + * tests/test-xstrtol.sh: Work around limitation of an old 'tr' program + on Solaris. + * tests/test-xstrtoimax.sh: Likewise. + * tests/test-xstrtoumax.sh: Likewise. + Reported by Ralf Wildenhues . + 2008-04-26 Bruno Haible * modules/memchr-tests: New file. diff -r 4e68e73d390a -r 44e4e306d7c5 tests/test-xstrtoimax.sh --- a/tests/test-xstrtoimax.sh Sat Apr 26 12:43:40 2008 +0200 +++ b/tests/test-xstrtoimax.sh Sat Apr 26 14:14:12 2008 +0200 @@ -19,8 +19,16 @@ ./test-xstrtoimax${EXEEXT} 010 >> t-xstrtoimax.tmp 2>&1 || result=1 ./test-xstrtoimax${EXEEXT} MiB >> t-xstrtoimax.tmp 2>&1 || result=1 +# Find out how to remove carriage returns from output. Solaris /usr/ucb/tr +# does not understand '\r'. +if echo solaris | tr -d '\r' | grep solais > /dev/null; then + cr='\015' +else + cr='\r' +fi + # normalize output -LC_ALL=C tr -d '\r' < t-xstrtoimax.tmp > t-xstrtoimax.xo +LC_ALL=C tr -d "$cr" < t-xstrtoimax.tmp > t-xstrtoimax.xo mv t-xstrtoimax.xo t-xstrtoimax.tmp # compare expected output diff -r 4e68e73d390a -r 44e4e306d7c5 tests/test-xstrtol.sh --- a/tests/test-xstrtol.sh Sat Apr 26 12:43:40 2008 +0200 +++ b/tests/test-xstrtol.sh Sat Apr 26 14:14:12 2008 +0200 @@ -31,8 +31,16 @@ ./test-xstrtoul${EXEEXT} 010 >> t-xstrtol.tmp 2>&1 || result=1 ./test-xstrtoul${EXEEXT} MiB >> t-xstrtol.tmp 2>&1 || result=1 +# Find out how to remove carriage returns from output. Solaris /usr/ucb/tr +# does not understand '\r'. +if echo solaris | tr -d '\r' | grep solais > /dev/null; then + cr='\015' +else + cr='\r' +fi + # normalize output -LC_ALL=C tr -d '\r' < t-xstrtol.tmp > t-xstrtol.xo +LC_ALL=C tr -d "$cr" < t-xstrtol.tmp > t-xstrtol.xo mv t-xstrtol.xo t-xstrtol.tmp # compare expected output diff -r 4e68e73d390a -r 44e4e306d7c5 tests/test-xstrtoumax.sh --- a/tests/test-xstrtoumax.sh Sat Apr 26 12:43:40 2008 +0200 +++ b/tests/test-xstrtoumax.sh Sat Apr 26 14:14:12 2008 +0200 @@ -19,8 +19,16 @@ ./test-xstrtoumax${EXEEXT} 010 >> t-xstrtoumax.tmp 2>&1 || result=1 ./test-xstrtoumax${EXEEXT} MiB >> t-xstrtoumax.tmp 2>&1 || result=1 +# Find out how to remove carriage returns from output. Solaris /usr/ucb/tr +# does not understand '\r'. +if echo solaris | tr -d '\r' | grep solais > /dev/null; then + cr='\015' +else + cr='\r' +fi + # normalize output -LC_ALL=C tr -d '\r' < t-xstrtoumax.tmp > t-xstrtoumax.xo +LC_ALL=C tr -d "$cr" < t-xstrtoumax.tmp > t-xstrtoumax.xo mv t-xstrtoumax.xo t-xstrtoumax.tmp # compare expected output