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