]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Fix some mingw test failures.
authorBruno Haible <bruno@clisp.org>
Sun, 25 Nov 2018 01:10:28 +0000 (02:10 +0100)
committerBruno Haible <bruno@clisp.org>
Sun, 25 Nov 2018 01:10:28 +0000 (02:10 +0100)
* gettext-tools/tests/intl-1: Ignore different end-of-line convention in the
output.
* gettext-tools/tests/intl-2: Likewise.
* gettext-tools/tests/intl-3: Likewise.
* gettext-tools/tests/msgfmt-desktop-1: Likewise.
* gettext-tools/tests/msgfmt-desktop-2: Likewise.
* gettext-tools/tests/sentence-1: Likewise.
* gettext-tools/tests/cldr-plurals-1: Likewise.
* gettext-tools/tests/lang-c: On native Windows, ignore different end-of-line
convention in the output.
* gettext-tools/tests/lang-c++: Likewise.
* gettext-tools/tests/msgfilter-8: On native Windows, use sh, not /bin/sh.

gettext-tools/tests/cldr-plurals-1
gettext-tools/tests/intl-1
gettext-tools/tests/intl-2
gettext-tools/tests/intl-3
gettext-tools/tests/lang-c
gettext-tools/tests/lang-c++
gettext-tools/tests/msgfilter-8
gettext-tools/tests/msgfmt-desktop-1
gettext-tools/tests/msgfmt-desktop-2
gettext-tools/tests/sentence-1

index 18a8b61bbb725f2ea69d7093c9911a5cc8c02b04..3c6dad0df69603cc1758364a8c9c5f3eb4aad26e 100755 (executable)
@@ -15,9 +15,10 @@ cat > ar.ok <<\EOF
 nplurals=6; plural=(n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 && n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5);
 EOF
 
-"$top_builddir/src/cldr-plurals" > ar.out <<\EOF
+"$top_builddir/src/cldr-plurals" > ar.tmp <<\EOF
 zero: n = 0 @integer 0 @decimal 0.0, 0.00, 0.000, 0.0000; one: n = 1 @integer 1 @decimal 1.0, 1.00, 1.000, 1.0000; two: n = 2 @integer 2 @decimal 2.0, 2.00, 2.000, 2.0000; few: n % 100 = 3..10 @integer 3~10, 103~110, 1003, … @decimal 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 103.0, 1003.0, …; many: n % 100 = 11..99 @integer 11~26, 111, 1011, … @decimal 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 111.0, 1011.0, …; other:  @integer 100~102, 200~202, 300~302, 400~402, 500~502, 600, 1000, 10000, 100000, 1000000, … @decimal 0.1~0.9, 1.1~1.7, 10.1, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …
 EOF
+LC_ALL=C tr -d '\r' < ar.tmp > ar.out || Exit 1
 
 ${DIFF} ar.ok ar.out || Exit 1
 
@@ -25,9 +26,10 @@ cat > ru.ok <<\EOF
 nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : 2);
 EOF
 
-"$top_builddir/src/cldr-plurals" > ru.out <<\EOF
+"$top_builddir/src/cldr-plurals" > ru.tmp <<\EOF
 one: v = 0 and i % 10 = 1 and i % 100 != 11 @integer 1, 21, 31, 41, 51, 61, 71, 81, 101, 1001, …; few: v = 0 and i % 10 = 2..4 and i % 100 != 12..14 @integer 2~4, 22~24, 32~34, 42~44, 52~54, 62, 102, 1002, …; many: v = 0 and i % 10 = 0 or v = 0 and i % 10 = 5..9 or v = 0 and i % 100 = 11..14 @integer 0, 5~19, 100, 1000, 10000, 100000, 1000000, …; other:    @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …
 EOF
+LC_ALL=C tr -d '\r' < ru.tmp > ru.out || Exit 1
 
 ${DIFF} ru.ok ru.out || Exit 1
 
@@ -44,16 +46,18 @@ cat > foo.in <<\EOF
 </supplementalData>
 EOF
 
-"$top_builddir/src/cldr-plurals" foo foo.in > foo.out
+"$top_builddir/src/cldr-plurals" foo foo.in > foo.tmp
 cat > foo.ok <<\EOF
 nplurals=2; plural=(n != 1);
 EOF
+LC_ALL=C tr -d '\r' < foo.tmp > foo.out || Exit 1
 ${DIFF} foo.ok foo.out || Exit 1
 
-"$top_builddir/src/cldr-plurals" -c foo foo.in > foo.cldr.out
+"$top_builddir/src/cldr-plurals" -c foo foo.in > foo.cldr.tmp
 cat > foo.cldr.ok <<\EOF
 one: i = 1 and v = 0 @integer 1; other:  @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …
 EOF
+LC_ALL=C tr -d '\r' < foo.cldr.tmp > foo.cldr.out || Exit 1
 ${DIFF} foo.cldr.ok foo.cldr.out || Exit 1
 
 Exit 0
index 76fb75e0e6954c15817f377525860895db88a70a..cf0f8df80a44dd4fd37b7a5fb8279f533259db1a 100755 (executable)
@@ -19,12 +19,14 @@ EOF
 : ${LOCALE_FR_UTF8=fr_FR.UTF-8}
 if test $LOCALE_FR != none; then
   prepare_locale_ in-1/fr in-1/$LOCALE_FR
-  ../intl-1-prg in-1 $LOCALE_FR > in-1.out || Exit 1
+  ../intl-1-prg in-1 $LOCALE_FR > in-1.tmp || Exit 1
+  LC_ALL=C tr -d '\r' < in-1.tmp > in-1.out || Exit 1
   ${DIFF} in-1.ok in-1.out || Exit 1
 fi
 if test $LOCALE_FR_UTF8 != none; then
   prepare_locale_ in-1/fr in-1/$LOCALE_FR_UTF8
-  ../intl-1-prg in-1 $LOCALE_FR_UTF8 > in-1.out || Exit 1
+  ../intl-1-prg in-1 $LOCALE_FR_UTF8 > in-1.tmp || Exit 1
+  LC_ALL=C tr -d '\r' < in-1.tmp > in-1.out || Exit 1
   ${DIFF} in-1.ok in-1.out || Exit 1
 fi
 if test $LOCALE_FR = none && test $LOCALE_FR_UTF8 = none; then
index a061d57ab1038b5b9c915f21f85bf0e63c15e6f7..a2a2d8dbd8e69994cc7ff90320750ac4d3f2072f 100755 (executable)
@@ -30,17 +30,21 @@ EOF
 if test $LOCALE_FR != none; then
   prepare_locale_ in-2-1/fr in-2-1/$LOCALE_FR
   prepare_locale_ in-2-2/fr in-2-2/$LOCALE_FR
-  ../intl-1-prg in-2-1 $LOCALE_FR > in-2.out || Exit 1
+  ../intl-1-prg in-2-1 $LOCALE_FR > in-2.tmp || Exit 1
+  LC_ALL=C tr -d '\r' < in-2.tmp > in-2.out || Exit 1
   ${DIFF} in-2-1.ok in-2.out || Exit 1
-  ../intl-1-prg in-2-2 $LOCALE_FR > in-2.out || Exit 1
+  ../intl-1-prg in-2-2 $LOCALE_FR > in-2.tmp || Exit 1
+  LC_ALL=C tr -d '\r' < in-2.tmp > in-2.out || Exit 1
   ${DIFF} in-2-1.ok in-2.out || Exit 1
 fi
 if test $LOCALE_FR_UTF8 != none; then
   prepare_locale_ in-2-1/fr in-2-1/$LOCALE_FR_UTF8
   prepare_locale_ in-2-2/fr in-2-2/$LOCALE_FR_UTF8
-  ../intl-1-prg in-2-1 $LOCALE_FR_UTF8 > in-2.out || Exit 1
+  ../intl-1-prg in-2-1 $LOCALE_FR_UTF8 > in-2.tmp || Exit 1
+  LC_ALL=C tr -d '\r' < in-2.tmp > in-2.out || Exit 1
   ${DIFF} in-2-2.ok in-2.out || Exit 1
-  ../intl-1-prg in-2-2 $LOCALE_FR_UTF8 > in-2.out || Exit 1
+  ../intl-1-prg in-2-2 $LOCALE_FR_UTF8 > in-2.tmp || Exit 1
+  LC_ALL=C tr -d '\r' < in-2.tmp > in-2.out || Exit 1
   ${DIFF} in-2-2.ok in-2.out || Exit 1
 fi
 if test $LOCALE_FR = none && test $LOCALE_FR_UTF8 = none; then
index 4879e24ed47d29fe994c6a10062bbd29a8aa267a..8c12083aea4f7eb0be43897b8413ad959ad57745 100755 (executable)
@@ -30,25 +30,33 @@ EOF
 if test $LOCALE_FR != none; then
   prepare_locale_ in-3-1/fr in-3-1/$LOCALE_FR
   prepare_locale_ in-3-2/fr in-3-2/$LOCALE_FR
-  ../intl-3-prg in-3-1 $LOCALE_FR ISO-8859-1 > in-3.out || Exit 1
+  ../intl-3-prg in-3-1 $LOCALE_FR ISO-8859-1 > in-3.tmp || Exit 1
+  LC_ALL=C tr -d '\r' < in-3.tmp > in-3.out || Exit 1
   ${DIFF} in-3-1.ok in-3.out || Exit 1
-  ../intl-3-prg in-3-2 $LOCALE_FR ISO-8859-1 > in-3.out || Exit 1
+  ../intl-3-prg in-3-2 $LOCALE_FR ISO-8859-1 > in-3.tmp || Exit 1
+  LC_ALL=C tr -d '\r' < in-3.tmp > in-3.out || Exit 1
   ${DIFF} in-3-1.ok in-3.out || Exit 1
-  ../intl-3-prg in-3-1 $LOCALE_FR UTF-8 > in-3.out || Exit 1
+  ../intl-3-prg in-3-1 $LOCALE_FR UTF-8 > in-3.tmp || Exit 1
+  LC_ALL=C tr -d '\r' < in-3.tmp > in-3.out || Exit 1
   ${DIFF} in-3-2.ok in-3.out || Exit 1
-  ../intl-3-prg in-3-2 $LOCALE_FR UTF-8 > in-3.out || Exit 1
+  ../intl-3-prg in-3-2 $LOCALE_FR UTF-8 > in-3.tmp || Exit 1
+  LC_ALL=C tr -d '\r' < in-3.tmp > in-3.out || Exit 1
   ${DIFF} in-3-2.ok in-3.out || Exit 1
 fi
 if test $LOCALE_FR_UTF8 != none; then
   prepare_locale_ in-3-1/fr in-3-1/$LOCALE_FR_UTF8
   prepare_locale_ in-3-2/fr in-3-2/$LOCALE_FR_UTF8
-  ../intl-3-prg in-3-1 $LOCALE_FR_UTF8 ISO-8859-1 > in-3.out || Exit 1
+  ../intl-3-prg in-3-1 $LOCALE_FR_UTF8 ISO-8859-1 > in-3.tmp || Exit 1
+  LC_ALL=C tr -d '\r' < in-3.tmp > in-3.out || Exit 1
   ${DIFF} in-3-1.ok in-3.out || Exit 1
-  ../intl-3-prg in-3-2 $LOCALE_FR_UTF8 ISO-8859-1 > in-3.out || Exit 1
+  ../intl-3-prg in-3-2 $LOCALE_FR_UTF8 ISO-8859-1 > in-3.tmp || Exit 1
+  LC_ALL=C tr -d '\r' < in-3.tmp > in-3.out || Exit 1
   ${DIFF} in-3-1.ok in-3.out || Exit 1
-  ../intl-3-prg in-3-1 $LOCALE_FR_UTF8 UTF-8 > in-3.out || Exit 1
+  ../intl-3-prg in-3-1 $LOCALE_FR_UTF8 UTF-8 > in-3.tmp || Exit 1
+  LC_ALL=C tr -d '\r' < in-3.tmp > in-3.out || Exit 1
   ${DIFF} in-3-2.ok in-3.out || Exit 1
-  ../intl-3-prg in-3-2 $LOCALE_FR_UTF8 UTF-8 > in-3.out || Exit 1
+  ../intl-3-prg in-3-2 $LOCALE_FR_UTF8 UTF-8 > in-3.tmp || Exit 1
+  LC_ALL=C tr -d '\r' < in-3.tmp > in-3.out || Exit 1
   ${DIFF} in-3-2.ok in-3.out || Exit 1
 fi
 if test $LOCALE_FR = none && test $LOCALE_FR_UTF8 = none; then
index ad6be73f711d806950eb12c49c7fa83ad43e2ef3..b350899a675edf3d4f8ce2e2087ee5b72d8d8694 100755 (executable)
@@ -130,18 +130,26 @@ EOF
 : ${LOCALE_FR_UTF8=fr_FR.UTF-8}
 if test $LOCALE_FR != none; then
   prepare_locale_ fr $LOCALE_FR
-  LANGUAGE= ./prog $LOCALE_FR 2 > prog.out
+  LANGUAGE= ./prog $LOCALE_FR 2 > prog.tmp
   case $? in
-    0) ${DIFF} prog.ok prog.out || Exit 1;;
+    0) case "$host_os" in
+         mingw*) LC_ALL=C tr -d '\r' < prog.tmp > prog.out || Exit 1 ;;
+         *) cp prog.tmp prog.out || Exit 1 ;;
+       esac
+       ${DIFF} prog.ok prog.out || Exit 1;;
     77) LOCALE_FR=none;;
     *) Exit 1;;
   esac
 fi
 if test $LOCALE_FR_UTF8 != none; then
   prepare_locale_ fr $LOCALE_FR_UTF8
-  LANGUAGE= ./prog $LOCALE_FR_UTF8 2 > prog.out
+  LANGUAGE= ./prog $LOCALE_FR_UTF8 2 > prog.tmp
   case $? in
-    0) ${DIFF} prog.oku prog.out || Exit 1;;
+    0) case "$host_os" in
+         mingw*) LC_ALL=C tr -d '\r' < prog.tmp > prog.out || Exit 1 ;;
+         *) cp prog.tmp prog.out || Exit 1 ;;
+       esac
+       ${DIFF} prog.oku prog.out || Exit 1;;
     77) LOCALE_FR_UTF8=none;;
     *) Exit 1;;
   esac
index cad6af8bbbcf4e0aac0fcf4a19bd0a689f5517a5..f2b72ac19760a4f9fbadc68d14b0bf183139982f 100755 (executable)
@@ -150,18 +150,26 @@ EOF
 : ${LOCALE_FR_UTF8=fr_FR.UTF-8}
 if test $LOCALE_FR != none; then
   prepare_locale_ fr $LOCALE_FR
-  LANGUAGE= ./prog $LOCALE_FR 2 > prog.out
+  LANGUAGE= ./prog $LOCALE_FR 2 > prog.tmp
   case $? in
-    0) ${DIFF} prog.ok prog.out || Exit 1;;
+    0) case "$host_os" in
+         mingw*) LC_ALL=C tr -d '\r' < prog.tmp > prog.out || Exit 1 ;;
+         *) cp prog.tmp prog.out || Exit 1 ;;
+       esac
+       ${DIFF} prog.ok prog.out || Exit 1;;
     77) LOCALE_FR=none;;
     *) Exit 1;;
   esac
 fi
 if test $LOCALE_FR_UTF8 != none; then
   prepare_locale_ fr $LOCALE_FR_UTF8
-  LANGUAGE= ./prog $LOCALE_FR_UTF8 2 > prog.out
+  LANGUAGE= ./prog $LOCALE_FR_UTF8 2 > prog.tmp
   case $? in
-    0) ${DIFF} prog.oku prog.out || Exit 1;;
+    0) case "$host_os" in
+         mingw*) LC_ALL=C tr -d '\r' < prog.tmp > prog.out || Exit 1 ;;
+         *) cp prog.tmp prog.out || Exit 1 ;;
+       esac
+       ${DIFF} prog.oku prog.out || Exit 1;;
     77) LOCALE_FR_UTF8=none;;
     *) Exit 1;;
   esac
index f7b7b27c58d17d21606e36c5e187f43759851cab..9b665eb31be583c09c20a31bcca0a021bbc0c9b1 100755 (executable)
@@ -76,7 +76,10 @@ fi
 EOF
 
 : ${MSGFILTER=msgfilter}
-: ${CONFIG_SHELL=${SHELL-/bin/sh}}
+case "$host_os" in
+  mingw*) CONFIG_SHELL='sh' ;;
+  *) : ${CONFIG_SHELL=${SHELL-/bin/sh}} ;;
+esac
 LC_ALL=C ${MSGFILTER} --newline -i mfi-test8.po -o mfi-test8.out \
       ${CONFIG_SHELL} filter.sh >mfi-test8.err 2>&1
 result=$?
index 24b7484588dd26305a42ad1c3ee3ffe050d2b28a..d410c0101df4321d4afa80b5af74a532f5f00f06 100755 (executable)
@@ -75,8 +75,9 @@ ${MSGFMT} --desktop --template=mf.desktop fr.po -o mf.desktop.out \
 
 # Proceed to the .desktop file generation.
 
-${MSGFMT} --desktop --template=mf.desktop -l fr fr.po -o mf.desktop.out \
+${MSGFMT} --desktop --template=mf.desktop -l fr fr.po -o mf.desktop.tmp \
   || Exit 1
+LC_ALL=C tr -d '\r' < mf.desktop.tmp > mf.desktop.out || Exit 1
 
 : ${DIFF=diff}
 ${DIFF} mf.desktop.ok mf.desktop.out
index 19391cab09e91c3a2f7dd06a88a980c20d741114..d131980d8f4fddbaf462ab5704870319c30f3fa9 100755 (executable)
@@ -160,7 +160,8 @@ ${MSGFMT} --desktop --template=mf.desktop -d po -o mf.desktop.out po/fr.po \
 
 # Proceed to the .desktop file generation.
 
-${MSGFMT} --desktop --template=mf.desktop -d po -o mf.desktop.out || Exit 1
+${MSGFMT} --desktop --template=mf.desktop -d po -o mf.desktop.tmp || Exit 1
+LC_ALL=C tr -d '\r' < mf.desktop.tmp > mf.desktop.out || Exit 1
 
 : ${DIFF=diff}
 ${DIFF} mf.desktop.ok mf.desktop.out
@@ -168,7 +169,9 @@ test $? = 0 || Exit 1
 
 # Restrict the desired languages with the LINGUAS envvar.
 
-LINGUAS="fr ja" ${MSGFMT} --desktop --template=mf.desktop -d po -o mf.desktop.desired.out || Exit 1
+LINGUAS="fr ja" \
+${MSGFMT} --desktop --template=mf.desktop -d po -o mf.desktop.desired.tmp || Exit 1
+LC_ALL=C tr -d '\r' < mf.desktop.desired.tmp > mf.desktop.desired.out || Exit 1
 
 : ${DIFF=diff}
 ${DIFF} mf.desktop.desired.ok mf.desktop.desired.out
index 62b5a04bee5718175a19914294bd2cbef3e2e2d1..7df9e2cd82205b1dcf7f482def53903060795786 100755 (executable)
@@ -113,7 +113,8 @@ This is a secondary sentence
 
 EOF
 
-../sentence-1-prg < s1.in > s1.out || Exit 1
+../sentence-1-prg < s1.in > s1.tmp || Exit 1
+LC_ALL=C tr -d '\r' < s1.tmp > s1.out || Exit 1
 
 : ${DIFF=diff}
 ${DIFF} s1.ok s1.out || Exit 1