]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
tests: Skip KUIT tests when libexpat is missing
authorDaiki Ueno <ueno@gnu.org>
Wed, 24 Jun 2015 01:35:25 +0000 (10:35 +0900)
committerDaiki Ueno <ueno@gnu.org>
Wed, 24 Jun 2015 01:35:48 +0000 (10:35 +0900)
* format-kde-kuit-1: Skip if KDE KUIT format is not supported.
* format-kde-kuit-2: Likewise.
Suggested by Chusslove Illich.

gettext-tools/tests/ChangeLog
gettext-tools/tests/format-kde-kuit-1
gettext-tools/tests/format-kde-kuit-2

index 632568e370faae3566f83b9e05e64e5aef1c05e5..dc7aa3e77f7a09db0db880189fee838dc2280fd3 100644 (file)
@@ -1,3 +1,9 @@
+2015-06-24  Daiki Ueno  <ueno@gnu.org>
+
+       * format-kde-kuit-1: Skip if KDE KUIT format is not supported.
+       * format-kde-kuit-2: Likewise.
+       Suggested by Chusslove Illich.
+
 2015-06-23  Daiki Ueno  <ueno@gnu.org>
 
        * msginit-4: Don't check the Project-Id-Version: field, which
index a63ff3d0e7bf4902863d3bdd8f318fb58a452e59..aeaa7432439c55d4a6868cd3403229271fc5381c 100755 (executable)
@@ -3,6 +3,18 @@
 
 # Test recognition of KUIT format strings.
 
+: ${XGETTEXT=xgettext}
+
+cat <<\EOF > f-kd-invalid.cpp
+xi18n("<invalid>");
+EOF
+
+LC_ALL=C ${XGETTEXT} -L C++ --kde --flag=xi18n:1:kde-kuit-format -o - f-kd-invalid.cpp 2>&1 | grep 'not a valid KDE KUIT format' > /dev/null 2>&1
+test $? = 0 || {
+  echo "Skipping test: xgettext was built without KDE KUIT format support"
+  exit 77
+}
+
 cat <<\EOF > f-kd-1.data
 # Unrecognized: unbalanced filename tag
 "<filename>a"
@@ -24,7 +36,6 @@ cat <<\EOF > f-kd-1.data
 "<command>&#x2A;&#x2a;&#x61;&#141;</command>"
 EOF
 
-: ${XGETTEXT=xgettext}
 n=0
 while read comment; do
   read string
index b2653d188f6c7d1e5fb08014a05232a2dd808bb2..0634b628cbaa3aab24dcb67e55c7c84c8bdb7afa 100755 (executable)
@@ -3,6 +3,20 @@
 
 # Test checking of KDE KUIT format strings.
 
+cat <<\EOF > f-kd-invalid.po
+#, kde-kuit-format
+msgid "foo"
+msgstr "<"
+EOF
+
+: ${MSGFMT=msgfmt}
+
+LC_ALL=C ${MSGFMT} --check-format -o /dev/null f-kd-invalid.po 2>&1 | grep 'not a valid KDE KUIT format' > /dev/null 2>&1
+test $? = 0 || {
+  echo "Skipping test: msgfmt was built without KDE KUIT format support"
+  exit 77
+}
+
 cat <<\EOF > f-kd-2.data
 # Valid: one argument
 msgid "<filename>%1</filename>"
@@ -30,7 +44,6 @@ msgid "<filename>foo</filename>"
 msgstr "<foo>&amp;</foo>"
 EOF
 
-: ${MSGFMT=msgfmt}
 n=0
 while read comment; do
   read msgid_line