summaryrefslogtreecommitdiffstats
path: root/gettext-tools/tests/xgettext-c-7
blob: 248bfa921834a3fbb1353f0f0fc9fa5629f9a6a5 (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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#! /bin/sh
. "${srcdir=.}/init.sh"; path_prepend_ . ../src

# Test C support: comments.

cat <<EOF > xg-c-7.c
int
main()
{
  /* This is a comment which immediately before a keyword.  */
  gettext ("1");

  // This
  // one
  // too
  // although many blank lines come before the token itself.

      


 gettext("2");

  /* this one also counts */ gettext ("3");

  gettext("4");

  /* this one is also copied */ nada
  gettext ("5");

  /* I hope you do not see the following */
  break;
  gettext("6");

  /* An unnice
     multi-line comment */ evil;
  gettext("7");
}
EOF

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

cat <<EOF > xg-c-7.ok
#. This is a comment which immediately before a keyword.
msgid "1"
msgstr ""

#. This
#. one
#. too
#. although many blank lines come before the token itself.
msgid "2"
msgstr ""

#. this one also counts
msgid "3"
msgstr ""

msgid "4"
msgstr ""

#. this one is also copied
msgid "5"
msgstr ""

msgid "6"
msgstr ""

#. An unnice
#. multi-line comment
msgid "7"
msgstr ""
EOF

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

exit $result

Local Variables:
 nuke-trailing-whitespace-p:nil
End: