Chusslove Illich <[email protected]> writes: > These two failures I can reproduce if I force libexpat not to be found. Does > it make sense to skip these tests in case libexpat is missing? If yes, > something like this could be put at the top of > gettext-tools/tests/format-kde-kuit-* files: > > if grep -q "HAVE_LIBEXPAT *= *$" "${srcdir=.}/Makefile"; then > echo "Skipping test: libexpat not available" > exit 77 > fi
Thanks. Unfortunately, we can't determine the missing case from the configure artefacts, since gettext loads the library with dlopen. So, I've used the attached patch. I'll do similar for the cldr-plurals tests. Regards, -- Daiki Ueno
>From 945abda2f0fe59bf8ad1871f4d82b69479c75515 Mon Sep 17 00:00:00 2001 From: Daiki Ueno <[email protected]> Date: Wed, 24 Jun 2015 10:35:25 +0900 Subject: [PATCH] tests: Skip KUIT tests when libexpat is missing * 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 | 6 ++++++ gettext-tools/tests/format-kde-kuit-1 | 13 ++++++++++++- gettext-tools/tests/format-kde-kuit-2 | 15 ++++++++++++++- 3 files changed, 32 insertions(+), 2 deletions(-) diff --git a/gettext-tools/tests/ChangeLog b/gettext-tools/tests/ChangeLog index 632568e..dc7aa3e 100644 --- a/gettext-tools/tests/ChangeLog +++ b/gettext-tools/tests/ChangeLog @@ -1,3 +1,9 @@ +2015-06-24 Daiki Ueno <[email protected]> + + * 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 <[email protected]> * msginit-4: Don't check the Project-Id-Version: field, which diff --git a/gettext-tools/tests/format-kde-kuit-1 b/gettext-tools/tests/format-kde-kuit-1 index a63ff3d..aeaa743 100755 --- a/gettext-tools/tests/format-kde-kuit-1 +++ b/gettext-tools/tests/format-kde-kuit-1 @@ -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>**a</command>" EOF -: ${XGETTEXT=xgettext} n=0 while read comment; do read string diff --git a/gettext-tools/tests/format-kde-kuit-2 b/gettext-tools/tests/format-kde-kuit-2 index b2653d1..0634b62 100755 --- a/gettext-tools/tests/format-kde-kuit-2 +++ b/gettext-tools/tests/format-kde-kuit-2 @@ -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>&</foo>" EOF -: ${MSGFMT=msgfmt} n=0 while read comment; do read msgid_line -- 2.4.2
