b138dcbb7e5b789b703a0423d1d889c0bcf3b318
[platform/upstream/gettext.git] / gettext-tools / tests / xgettext-c-12
1 #! /bin/sh
2
3 # Test C support: valid but unlikely C format strings are _not_ marked as
4 # c-format by default.
5
6 tmpfiles=""
7 trap 'rm -fr $tmpfiles' 1 2 3 15
8
9 tmpfiles="$tmpfiles xg-c-12.c"
10 cat <<\EOF > xg-c-12.c
11 gettext ("%1% on, %2% off");
12 EOF
13
14 tmpfiles="$tmpfiles xg-c-12.tmp.po xg-c-12.po"
15 : ${XGETTEXT=xgettext}
16 ${XGETTEXT} --omit-header --no-location -d xg-c-12.tmp xg-c-12.c
17 test $? = 0 || { rm -fr $tmpfiles; exit 1; }
18 LC_ALL=C tr -d '\r' < xg-c-12.tmp.po > xg-c-12.po
19 test $? = 0 || { rm -fr $tmpfiles; exit 1; }
20
21 tmpfiles="$tmpfiles xg-c-12.ok"
22 cat <<EOF > xg-c-12.ok
23 msgid "%1% on, %2% off"
24 msgstr ""
25 EOF
26
27 : ${DIFF=diff}
28 ${DIFF} xg-c-12.ok xg-c-12.po
29 result=$?
30
31 rm -fr $tmpfiles
32
33 exit $result