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