summaryrefslogtreecommitdiffstats
path: root/gettext-tools/tests/xgettext-c-12
blob: 6fe1d7ff9983a66287b2120b18e85c9e23b662e9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#! /bin/sh
. "${srcdir=.}/init.sh"; path_prepend_ . ../src

# Test C support: valid but unlikely C format strings are _not_ marked as
# c-format by default.

cat <<\EOF > xg-c-12.c
gettext ("%1% on, %2% off");
EOF

: ${XGETTEXT=xgettext}
${XGETTEXT} --omit-header --no-location -d xg-c-12.tmp xg-c-12.c || Exit 1
LC_ALL=C tr -d '\r' < xg-c-12.tmp.po > xg-c-12.po || Exit 1

cat <<EOF > xg-c-12.ok
msgid "%1% on, %2% off"
msgstr ""
EOF

: ${DIFF=diff}
${DIFF} xg-c-12.ok xg-c-12.po
result=$?

exit $result