1#! /bin/sh
2
3# Test C support: comments.
4
5tmpfiles=""
6trap 'rm -fr $tmpfiles' 1 2 3 15
7
8tmpfiles="$tmpfiles xg-c-7.c"
9cat <<EOF > xg-c-7.c
10int
11main()
12{
13  /* This is a comment which immediately before a keyword.  */
14  gettext ("1");
15
16  // This
17  // one
18  // too
19  // although many blank lines come before the token itself.
20
21      
22
23
24 gettext("2");
25
26  /* this one also counts */ gettext ("3");
27
28  gettext("4");
29
30  /* this one is also copied */ nada
31  gettext ("5");
32
33  /* I hope you do not see the following */
34  break;
35  gettext("6");
36
37  /* An unnice
38     multi-line comment */ evil;
39  gettext("7");
40}
41EOF
42
43tmpfiles="$tmpfiles xg-c-7.po"
44: ${XGETTEXT=xgettext}
45${XGETTEXT} --omit-header --no-location -c --c++ -d xg-c-7 xg-c-7.c
46test $? = 0 || { rm -fr $tmpfiles; exit 1; }
47
48tmpfiles="$tmpfiles xg-c-7.ok"
49cat <<EOF > xg-c-7.ok
50#. This is a comment which immediately before a keyword.
51msgid "1"
52msgstr ""
53
54#. This
55#. one
56#. too
57#. although many blank lines come before the token itself.
58msgid "2"
59msgstr ""
60
61#. this one also counts
62msgid "3"
63msgstr ""
64
65msgid "4"
66msgstr ""
67
68#. this one is also copied
69msgid "5"
70msgstr ""
71
72msgid "6"
73msgstr ""
74
75#. An unnice
76#. multi-line comment
77msgid "7"
78msgstr ""
79EOF
80
81: ${DIFF=diff}
82${DIFF} xg-c-7.ok xg-c-7.po
83result=$?
84
85rm -fr $tmpfiles
86
87exit $result
88
89Local Variables:
90 nuke-trailing-whitespace-p:nil
91End:
92