2 . "${srcdir=.}/init.sh"; path_prepend_ . ../src
4 # Test recognition of Qt format strings.
6 cat <<\EOF > f-qt-1.data
7 # Unrecognized: no argument
13 # Valid: one argument specified by two digits
15 # Valid: one argument specified by two digits
25 # Valid: zero specified by two digits
29 # Valid: multiple uses of same argument
31 # Valid: an argument with locale-dependency flag
33 # Valid: an argument with locale-dependency flag and two digits
37 : ${XGETTEXT=xgettext}
39 while read comment; do
42 cat <<EOF > f-qt-1-$n.in
45 ${XGETTEXT} -L C++ --qt -k_ -o f-qt-1-$n.po f-qt-1-$n.in || exit 1
46 test -f f-qt-1-$n.po || exit 1
48 if echo "$comment" | grep 'Valid:' > /dev/null; then
49 if grep qt-format f-qt-1-$n.po > /dev/null; then
55 if grep qt-format f-qt-1-$n.po > /dev/null; then
61 if test -n "$fail"; then
62 echo "Format string recognition error:" 1>&2
68 rm -f f-qt-1-$n.in f-qt-1-$n.po