No empty .Rs/.Re
[netbsd-mini2440.git] / gnu / dist / gettext / gettext-tools / tests / xgettext-2
blob92d19ba0817d3aa8c6ada933bab6dd6140afd5d5
1 #! /bin/sh
3 # Even an empty string is extracted, if not overridden by xgettext's
4 # default-constructed header entry.
6 tmpfiles=""
7 trap 'rm -fr $tmpfiles' 1 2 3 15
9 tmpfiles="$tmpfiles xg-test2.in.c"
10 cat <<EOF > xg-test2.in.c
11 This is a test of the xgettext functionality.
12 /* xgettext:no-c-format */
13 _("extract me")
14 Sometimes keywords can be spread apart
15 xgettext:no-c-format
16 _ ( "what about me" )
17 And even further on occasion
20 "hello"
23 /* also empty strings */
24 _("")
25 EOF
27 tmpfiles="$tmpfiles xg-test2.po"
28 : ${XGETTEXT=xgettext}
29 ${XGETTEXT} -d xg-test2 -k_ --omit-header --no-location xg-test2.in.c
30 test $? = 0 || { rm -fr $tmpfiles; exit 1; }
32 tmpfiles="$tmpfiles xg-test2.ok"
33 cat <<EOF > xg-test2.ok
34 #, no-c-format
35 msgid "extract me"
36 msgstr ""
38 msgid "what about me"
39 msgstr ""
41 msgid "hello"
42 msgstr ""
44 msgid ""
45 msgstr ""
46 EOF
48 : ${DIFF=diff}
49 ${DIFF} xg-test2.ok xg-test2.po
50 result=$?
52 rm -fr $tmpfiles
54 exit $result