]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
tests: Improve reliability.
authorBruno Haible <bruno@clisp.org>
Sun, 28 Oct 2018 10:52:43 +0000 (11:52 +0100)
committerBruno Haible <bruno@clisp.org>
Sun, 28 Oct 2018 10:52:43 +0000 (11:52 +0100)
* xgettext-3: Verify the exit code of the xgettext invocation.
* xgettext-4: Likewise.
* xgettext-appdata-1: Likewise.
* xgettext-c-19: Likewise.
* xgettext-c-20: Likewise.
* xgettext-c-21: Likewise.
* xgettext-csharp-2: Likewise.
* xgettext-csharp-3: Likewise.
* xgettext-csharp-8: Likewise.
* xgettext-desktop-1: Likewise.
* xgettext-glade-1: Likewise.
* xgettext-glade-6: Likewise.
* xgettext-glade-7: Likewise.
* xgettext-gsettings-1: Likewise.
* xgettext-perl-2: Likewise.
* xgettext-perl-3: Likewise.

16 files changed:
gettext-tools/tests/xgettext-3
gettext-tools/tests/xgettext-4
gettext-tools/tests/xgettext-appdata-1
gettext-tools/tests/xgettext-c-19
gettext-tools/tests/xgettext-c-20
gettext-tools/tests/xgettext-c-21
gettext-tools/tests/xgettext-csharp-2
gettext-tools/tests/xgettext-csharp-3
gettext-tools/tests/xgettext-csharp-8
gettext-tools/tests/xgettext-desktop-1
gettext-tools/tests/xgettext-glade-1
gettext-tools/tests/xgettext-glade-6
gettext-tools/tests/xgettext-glade-7
gettext-tools/tests/xgettext-gsettings-1
gettext-tools/tests/xgettext-perl-2
gettext-tools/tests/xgettext-perl-3

index b3fd04ed2e128003522615bd8f87555f98dc00c2..f5e9f902c0d6816c8873816b40a6840ca2017db3 100755 (executable)
@@ -23,8 +23,8 @@ EOF
 
 : ${XGETTEXT=xgettext}
 # delete POT-Creation-Date: line because the date depends on local time.
-${XGETTEXT} --output - --no-location -k_ xg-test3.in.c 2>/dev/null \
-  | sed '/\"POT-Creation-Date:.*/d' | LC_ALL=C tr -d '\r' > xg-test3.po
+${XGETTEXT} --output xg-test3.tmp --no-location -k_ xg-test3.in.c 2>/dev/null || Exit 1
+sed -e '/\"POT-Creation-Date:.*/d' < xg-test3.tmp | LC_ALL=C tr -d '\r' > xg-test3.po
 
 cat <<EOF > xg-test3.ok
 # SOME DESCRIPTIVE TITLE.
index e33c06217f41a2cd9cc1e873dde32c1fa1247865..1adae342f3bdeee12c1de72ba726fb28d7543f54 100755 (executable)
@@ -9,8 +9,8 @@ EOF
 
 : ${XGETTEXT=xgettext}
 # delete POT-Creation-Date: line because the date depends on local time.
-${XGETTEXT} --output - --foreign-user --no-location -k_ xg-test4.in.c \
-  | sed '/\"POT-Creation-Date:.*/d' | LC_ALL=C tr -d '\r' > xg-test4.po
+${XGETTEXT} --output xg-test4.tmp --foreign-user --no-location -k_ xg-test4.in.c || Exit 1
+sed -e '/\"POT-Creation-Date:.*/d' < xg-test4.tmp | LC_ALL=C tr -d '\r' > xg-test4.po
 
 cat <<EOF > xg-test4.ok
 # SOME DESCRIPTIVE TITLE.
index ac0ed7e70e6ce233db0acac7170f40567d7e5b00..7de80c7c031a421909ff45d7abf00b4f4ea0aa2a 100755 (executable)
@@ -57,7 +57,8 @@ cat <<EOF > xg-gs-1.appdata.xml
 EOF
 
 : ${XGETTEXT=xgettext}
-${XGETTEXT} --add-comments -o - xg-gs-1.appdata.xml | grep -v 'POT-Creation-Date' > xg-gs-1.pot || Exit 1
+${XGETTEXT} --add-comments -o xg-gs-1.tmp xg-gs-1.appdata.xml || Exit 1
+grep -v 'POT-Creation-Date' < xg-gs-1.tmp > xg-gs-1.pot || Exit 1
 
 cat <<EOF > xg-gs-1.ok
 # SOME DESCRIPTIVE TITLE.
index 628ecb822364dd0a927e6807584892edf7b3b3c1..f1aeceb1bdfa58b91623beaaa8fab9cdf3f5b926 100755 (executable)
@@ -32,9 +32,9 @@ iconv -f UTF-8 -t EUC-JP < xg-c-19.in.c > xg-c-19.c \
   || { echo "Skipping test: iconv does not work for EUC-JP"; Exit 77; }
 
 ${XGETTEXT} --from-code=EUC-JP --add-comments --no-location --no-wrap \
-           -o - xg-c-19.c | grep -v 'POT-Creation-Date' > xg-c-19.tmp.po \
-           || Exit 1
-LC_ALL=C tr -d '\r' < xg-c-19.tmp.po > xg-c-19.po || Exit 1
+            -o xg-c-19.tmp xg-c-19.c || Exit 1
+grep -v 'POT-Creation-Date' < xg-c-19.tmp > xg-c-19.tmq || Exit 1
+LC_ALL=C tr -d '\r' < xg-c-19.tmq > xg-c-19.po || Exit 1
 
 cat <<\EOF > xg-c-19.ok
 # SOME DESCRIPTIVE TITLE.
index 2dcbac98112dfbd9317f0e908c8b1b772f8d11e2..2e56bcb7bbcb4471d623351d075b3e4aa78e97c0 100755 (executable)
@@ -79,9 +79,9 @@ gettext(\"abc\");
 EOF
 
 ${XGETTEXT} --add-comments --no-location --no-wrap \
-           -o - xg-c-20.cc | grep -v 'POT-Creation-Date' > xg-c-20.tmp.po \
-           || Exit 1
-LC_ALL=C tr -d '\r' < xg-c-20.tmp.po > xg-c-20.po || Exit 1
+            -o xg-c-20.tmp xg-c-20.cc || Exit 1
+grep -v 'POT-Creation-Date' < xg-c-20.tmp > xg-c-20.tmq || Exit 1
+LC_ALL=C tr -d '\r' < xg-c-20.tmq > xg-c-20.po || Exit 1
 
 cat <<\EOF > xg-c-20.ok
 # SOME DESCRIPTIVE TITLE.
@@ -134,9 +134,9 @@ uR"aaa(This is NOT a raw string";
 EOF
 
 ${XGETTEXT} --add-comments --no-location --no-wrap \
-           -o - xg-c-20.c | grep -v 'POT-Creation-Date' > xg-c-20c.tmp.po \
-           || Exit 1
-LC_ALL=C tr -d '\r' < xg-c-20c.tmp.po > xg-c-20c.po || Exit 1
+            -o xg-c-20c.tmp xg-c-20.c || Exit 1
+grep -v 'POT-Creation-Date' < xg-c-20c.tmp > xg-c-20c.tmq || Exit 1
+LC_ALL=C tr -d '\r' < xg-c-20c.tmq > xg-c-20c.po || Exit 1
 
 cat <<\EOF > xg-c-20c.ok
 # SOME DESCRIPTIVE TITLE.
index c96b3c9e3c07509d77b583e0a775a0a12a818a12..a293653151aae8cacddc5e048a68c1761b318295 100755 (executable)
@@ -6,9 +6,9 @@
 : ${XGETTEXT=xgettext}
 
 ${XGETTEXT} --add-comments --no-location --no-wrap \
-           -o - "$abs_srcdir"/xg-c-21.c \
-  | grep -v 'POT-Creation-Date' > xg-c-21.tmp.po || Exit 1
-LC_ALL=C tr -d '\r' < xg-c-21.tmp.po > xg-c-21.po || Exit 1
+            -o xg-c-21.tmp "$abs_srcdir"/xg-c-21.c || Exit 1
+grep -v 'POT-Creation-Date' < xg-c-21.tmp > xg-c-21.tmq || Exit 1
+LC_ALL=C tr -d '\r' < xg-c-21.tmq > xg-c-21.po || Exit 1
 
 cat <<\EOF > xg-c-21.ok
 # SOME DESCRIPTIVE TITLE.
index 934af5324c7c9e2f9bef0f7c7f14ce8383ec967a..68b93cc14db84fd449a5a56517a0aeee6ebaba0f 100755 (executable)
@@ -28,8 +28,8 @@ EOF
 
 : ${XGETTEXT=xgettext}
 # delete POT-Creation-Date: line because the date depends on local time.
-${XGETTEXT} --output - --add-location -c --from-code=UTF-8 xg-cs-2.cs \
-  | sed '/\"POT-Creation-Date:.*/d' | LC_ALL=C tr -d '\r' > xg-cs-2.po || Exit 1
+${XGETTEXT} --output xg-cs-2.tmp --add-location -c --from-code=UTF-8 xg-cs-2.cs || Exit 1
+sed -e '/\"POT-Creation-Date:.*/d' < xg-cs-2.tmp | LC_ALL=C tr -d '\r' > xg-cs-2.po || Exit 1
 
 cat <<\EOF > xg-cs-2.ok
 # SOME DESCRIPTIVE TITLE.
index 0e91e94ec9ba2b0a3e4579cade894a59d87b4c43..a2b94fcd1312b828edacf869f2a47fd93ac646a1 100755 (executable)
@@ -50,8 +50,8 @@ EOF
 
 : ${XGETTEXT=xgettext}
 # delete POT-Creation-Date: line because the date depends on local time.
-${XGETTEXT} --output - --add-location -c -kMyGetString:2 xg-cs-3.cs 2>/dev/null \
-  | sed '/\"POT-Creation-Date:.*/d' | LC_ALL=C tr -d '\r' > xg-cs-3.po || Exit 1
+${XGETTEXT} --output xg-cs-3.tmp --add-location -c -kMyGetString:2 xg-cs-3.cs 2>/dev/null || Exit 1
+sed -e '/\"POT-Creation-Date:.*/d' < xg-cs-3.tmp | LC_ALL=C tr -d '\r' > xg-cs-3.po || Exit 1
 
 cat <<\EOF > xg-cs-3.ok
 # SOME DESCRIPTIVE TITLE.
index 5b43f11e5c41b24406b447904fe532fbcded4365..d1c0df1e3a4de8d5176514ab672d66a85be47d7c 100755 (executable)
@@ -19,9 +19,8 @@ string i3 = "\uD840\uDE1";    // Unterminated after a high surrogate
 EOF
 
 : ${XGETTEXT=xgettext}
-${XGETTEXT} --output - --add-location xg-cs-8.cs -a 2>/dev/null | \
-  sed '/\"POT-Creation-Date:.*/d' | LC_ALL=C tr -d '\r' > xg-cs-8.po || \
-  Exit 1
+${XGETTEXT} --output xg-cs-8.tmp --add-location xg-cs-8.cs -a 2>/dev/null || Exit 1
+sed -e '/\"POT-Creation-Date:.*/d' < xg-cs-8.tmp | LC_ALL=C tr -d '\r' > xg-cs-8.po || Exit 1
 
 cat <<\EOF > xg-cs-8.ok
 # SOME DESCRIPTIVE TITLE.
index 212043ff76bec8dbd4106cc4e2311144aa3793ed..a43d2d521c11e02b92c4b95f18ad14942ede9eb3 100755 (executable)
@@ -53,7 +53,8 @@ X-Foo = bar
 Keywords=Keyword1;Keyword2;Key\;word3;
 EOF
 
-${XGETTEXT} --add-comments -o - xg.desktop | grep -v 'POT-Creation-Date' > xg-desktop.pot || Exit 1
+${XGETTEXT} --add-comments -o xg-de-1.tmp xg.desktop || Exit 1
+grep -v 'POT-Creation-Date' < xg-de-1.tmp > xg-desktop.pot || Exit 1
 
 cat <<\EOF > xg-desktop.ok
 # SOME DESCRIPTIVE TITLE.
index b31b3e108a475230c6a15ccb10e662568844c8f0..e7ae5f663a9a0df49876be2becb5bd141b812817 100755 (executable)
@@ -1330,7 +1330,8 @@ for said code in libglade.</text>
 EOF
 
 : ${XGETTEXT=xgettext}
-${XGETTEXT} --add-comments -o - xg-gl-1-widgets.glade | grep -v 'POT-Creation-Date' > xg-gl-1.pot || Exit 1
+${XGETTEXT} --add-comments -o xg-gl-1.tmp xg-gl-1-widgets.glade || Exit 1
+grep -v 'POT-Creation-Date' < xg-gl-1.tmp > xg-gl-1.pot || Exit 1
 
 cat <<EOF > xg-gl-1.ok
 # SOME DESCRIPTIVE TITLE.
index e195cdcbea6572de8254784ea2af7d0470a9be92..2eda586193d38ace509cdc7f10ef20be8546c360 100755 (executable)
@@ -32,7 +32,8 @@ cat <<EOF > xg-gl-6.ui
 EOF
 
 : ${XGETTEXT=xgettext}
-${XGETTEXT} -o - xg-gl-6.ui | grep -v 'POT-Creation-Date' > xg-gl-6.pot || Exit 1
+${XGETTEXT} -o xg-gl-6.tmp xg-gl-6.ui || Exit 1
+grep -v 'POT-Creation-Date' < xg-gl-6.tmp > xg-gl-6.pot || Exit 1
 
 cat <<EOF > xg-gl-6.ok
 # SOME DESCRIPTIVE TITLE.
@@ -69,7 +70,8 @@ test $result = 0 || {
 }
 
 # Check with --extract-all option.
-${XGETTEXT} -a -o - xg-gl-6.ui | grep -v 'POT-Creation-Date' > xg-gl-6.pot || Exit 1
+${XGETTEXT} -a -o xg-gl-6.tmp xg-gl-6.ui || Exit 1
+grep -v 'POT-Creation-Date' < xg-gl-6.tmp > xg-gl-6.pot || Exit 1
 
 # Must be ignored.
 ${DIFF} xg-gl-6.ok xg-gl-6.pot
index 8a559d79dc50f2d3926c0c30940a8b0f6acac4fb..f491472490be65350eb3d1d647176ac6f52c92bd 100755 (executable)
@@ -184,7 +184,8 @@ cat <<EOF > xg-gl-7.ui
 EOF
 
 : ${XGETTEXT=xgettext}
-${XGETTEXT} -o - xg-gl-7.ui | grep -v 'POT-Creation-Date' > xg-gl-7.pot || Exit 1
+${XGETTEXT} -o xg-gl-7.tmp xg-gl-7.ui || Exit 1
+grep -v 'POT-Creation-Date' < xg-gl-7.tmp > xg-gl-7.pot || Exit 1
 
 cat <<\EOF > xg-gl-7.ok
 # SOME DESCRIPTIVE TITLE.
index 75fc725ec7fca90b743988787ca38b6926d64c2b..7e958719dcb0ca4d56903d2d2dd4584aa1daf710 100755 (executable)
@@ -43,7 +43,8 @@ cat <<EOF > xg-gs-1.gschema.xml
 EOF
 
 : ${XGETTEXT=xgettext}
-${XGETTEXT} --add-comments -o - xg-gs-1.gschema.xml | grep -v 'POT-Creation-Date' > xg-gs-1.pot || Exit 1
+${XGETTEXT} --add-comments -o xg-gs-1.tmp xg-gs-1.gschema.xml || Exit 1
+grep -v 'POT-Creation-Date' < xg-gs-1.tmp > xg-gs-1.pot || Exit 1
 
 cat <<EOF > xg-gs-1.ok
 # SOME DESCRIPTIVE TITLE.
index e6f2ee7d66672e1f92b811d9c5313647d7ba67c7..060a232021d4e516e660738ffdbca25340ed02d9 100755 (executable)
@@ -13,8 +13,8 @@ EOF
 
 : ${XGETTEXT=xgettext}
 # delete POT-Creation-Date: line because the date depends on local time.
-${XGETTEXT} --output - --from-code=ISO-8859-1 xg-pl-2.pl \
-  | sed '/\"POT-Creation-Date:.*/d' | LC_ALL=C tr -d '\r' > xg-pl-2.po || Exit 1
+${XGETTEXT} --output xg-pl-2.tmp --from-code=ISO-8859-1 xg-pl-2.pl || Exit 1
+sed -e '/\"POT-Creation-Date:.*/d' < xg-pl-2.tmp | LC_ALL=C tr -d '\r' > xg-pl-2.po || Exit 1
 
 cat <<\EOF > xg-pl-2.ok
 # SOME DESCRIPTIVE TITLE.
index 01f5a77fa6aeb0dbe796dd8b824f2ee89c84a3ed..40af9b982ca2a975a2e5e427fbca29e1a634fd30 100755 (executable)
@@ -13,8 +13,8 @@ EOF
 
 : ${XGETTEXT=xgettext}
 # delete POT-Creation-Date: line because the date depends on local time.
-${XGETTEXT} --output - --from-code=UTF-8 xg-pl-3.pl \
-  | sed '/\"POT-Creation-Date:.*/d' | LC_ALL=C tr -d '\r' > xg-pl-3.po || Exit 1
+${XGETTEXT} --output xg-pl-3.tmp --from-code=UTF-8 xg-pl-3.pl || Exit 1
+sed -e '/\"POT-Creation-Date:.*/d' < xg-pl-3.tmp | LC_ALL=C tr -d '\r' > xg-pl-3.po || Exit 1
 
 cat <<\EOF > xg-pl-3.ok
 # SOME DESCRIPTIVE TITLE.