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