• Home
  • History
  • Annotate
  • Line#
  • Navigate
  • Raw
  • Download
  • only in /netgear-WNDR4500v2-V1.0.0.60_1.0.38/ap/gpl/timemachine/gettext-0.17/gettext-tools/tests/
1#! /bin/sh
2
3# Test C support: --add-comments option.
4
5tmpfiles=""
6trap 'rm -fr $tmpfiles' 1 2 3 15
7
8tmpfiles="$tmpfiles xg-c-6.in.C"
9cat <<EOF > xg-c-6.in.C
10/* This comment will not be extracted.  */
11gettext ("help");
12
13/*   XXX: But this one will.  */
14gettext_noop ("me");
15
16//XXX: ..and this
17dcgettext ("foo", "quick", LC_MESSAGES);
18
19  /* not not not */
20dgettext ("bar", "!");
21EOF
22
23tmpfiles="$tmpfiles xg-c-6.tmp.po xg-c-6.po"
24: ${XGETTEXT=xgettext}
25${XGETTEXT} --omit-header --no-location --add-comments=XXX \
26  -d xg-c-6.tmp xg-c-6.in.C
27test $? = 0 || { rm -fr $tmpfiles; exit 1; }
28tr -d '\r' < xg-c-6.tmp.po > xg-c-6.po
29test $? = 0 || { rm -fr $tmpfiles; exit 1; }
30
31tmpfiles="$tmpfiles xg-c-6.ok"
32cat <<EOF > xg-c-6.ok
33msgid "help"
34msgstr ""
35
36#. XXX: But this one will.
37msgid "me"
38msgstr ""
39
40#. XXX: ..and this
41msgid "quick"
42msgstr ""
43
44msgid "!"
45msgstr ""
46EOF
47
48: ${DIFF=diff}
49${DIFF} xg-c-6.ok xg-c-6.po
50result=$?
51
52rm -fr $tmpfiles
53
54exit $result
55