From 3911e72f350db41219cae293f0ef90eb3d9361eb Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sat, 26 Apr 2008 14:14:12 +0200 Subject: [PATCH] Work around limitation of an old 'tr' program on Solaris. --- ChangeLog | 8 ++++++++ tests/test-xstrtoimax.sh | 10 +++++++++- tests/test-xstrtol.sh | 10 +++++++++- tests/test-xstrtoumax.sh | 10 +++++++++- 4 files changed, 35 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4ac751f4b5..b005118c9d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -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 --git a/tests/test-xstrtoimax.sh b/tests/test-xstrtoimax.sh index 14cb9e07ed..e6a5e5dd5e 100755 --- a/tests/test-xstrtoimax.sh +++ b/tests/test-xstrtoimax.sh @@ -19,8 +19,16 @@ result=0 ./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 --git a/tests/test-xstrtol.sh b/tests/test-xstrtol.sh index 4c65122bca..c56c675000 100755 --- a/tests/test-xstrtol.sh +++ b/tests/test-xstrtol.sh @@ -31,8 +31,16 @@ result=0 ./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 --git a/tests/test-xstrtoumax.sh b/tests/test-xstrtoumax.sh index c86c9fbfca..12a7ba9f60 100755 --- a/tests/test-xstrtoumax.sh +++ b/tests/test-xstrtoumax.sh @@ -19,8 +19,16 @@ result=0 ./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 -- 2.30.2