No empty .Rs/.Re
[netbsd-mini2440.git] / gnu / dist / gettext / gettext-tools / tests / xgettext-po-1
blob5c733e46805abe9881e66dd41373f2ccf7605e10
1 #! /bin/sh
3 # Test C, C++, PO extractors.
5 tmpfiles=""
6 trap 'rm -fr $tmpfiles' 1 2 3 15
8 tmpfiles="$tmpfiles xg-po-1.in.po xg-po-1.c xg-po-1.cc"
9 cat <<EOF > xg-po-1.in.po
10 #: file1.c:199
11 #, fuzzy
12 msgid "extract me"
13 msgstr "some text to get fuzzy copied to result"
15 #: file2.cc:200
16 msgid "what about me"
17 msgstr ""
19 #: file3.c:10
20 #, c-format, fuzzy
21 msgid "hello"
22 msgstr "Again some text for fuzzy"
23 EOF
25 cat <<EOF > xg-po-1.c
26 #include <libintl.h>
27 #include <stdio.h>
28 int
29 main (int argc, char *argv[])
31 printf (dcgettext ("hello", "Hello, world."));
32 return 0;
34 EOF
36 cat <<EOF > xg-po-1.cc
37 #include <iostream.h>
38 #include <libintl.h>
39 #include <locale.h>
40 int
41 main (int argc, char *argv[])
43 cout << dcgettext ("hello", "Hello world!", LC_MESSAGES) << endl;
44 return 0;
46 EOF
48 tmpfiles="$tmpfiles xg-po-1.po"
49 : ${XGETTEXT=xgettext}
50 ${XGETTEXT} --omit-header -n xg-po-1.in.po \
51 xg-po-1.c xg-po-1.cc -d xg-po-1
52 test $? = 0 || { rm -fr $tmpfiles; exit 1; }
54 tmpfiles="$tmpfiles xg-po-1.ok"
55 cat <<EOF > xg-po-1.ok
56 #: file1.c:199
57 #, fuzzy
58 msgid "extract me"
59 msgstr "some text to get fuzzy copied to result"
61 #: file2.cc:200
62 msgid "what about me"
63 msgstr ""
65 #: file3.c:10
66 #, fuzzy, c-format
67 msgid "hello"
68 msgstr "Again some text for fuzzy"
70 #: xg-po-1.c:6
71 #, c-format
72 msgid "Hello, world."
73 msgstr ""
75 #: xg-po-1.cc:7
76 msgid "Hello world!"
77 msgstr ""
78 EOF
80 : ${DIFF=diff}
81 ${DIFF} xg-po-1.ok xg-po-1.po
82 result=$?
84 rm -fr $tmpfiles
86 exit $result