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