2 . "${srcdir=.}/init.sh"; path_prepend_ . ../src
4 # Test checking of Qt format strings.
6 cat <<\EOF > f-qt-2.data
7 # Valid: %% doesn't count
10 # Valid: same arguments
13 # Valid: same arguments, msgstr may be simpler than msgid
16 # Valid: same arguments, msgstr may be simpler than msgid
19 # Invalid: msgid is simple but msgstr is not
22 # Invalid: msgid is simple but msgstr is not
25 # Valid: repetition of an argument in the translation
28 # Valid: removing repeated argument in the translation
34 # Invalid: too few arguments
37 # Invalid: too many arguments
40 # Invalid: missing non-final argument
43 # Invalid: added non-final argument
50 while read comment; do
54 cat <<EOF > f-qt-2-$n.po
60 if echo "$comment" | grep 'Valid:' > /dev/null; then
61 if ${MSGFMT} --check-format -o f-qt-2-$n.mo f-qt-2-$n.po; then
67 ${MSGFMT} --check-format -o f-qt-2-$n.mo f-qt-2-$n.po 2> /dev/null
74 if test -n "$fail"; then
75 echo "Format string checking error:" 1>&2
79 rm -f f-qt-2-$n.po f-qt-2-$n.mo