1#! /bin/sh
2. "${srcdir=.}/init.sh"; path_prepend_ . ../src
3
4# Test C, C++, JavaProperties extractors.
5
6cat <<EOF > xg-pr-1.in.properties
7#: file1.c:199
8#, fuzzy
9!extract\ me=some text to get fuzzy copied to result
10
11#: file2.cc:200
12!what\ about\ me=
13
14#: file3.c:10
15#, c-format, fuzzy
16!hello=Again some text for fuzzy
17EOF
18
19cat <<EOF > xg-pr-1.c
20#include <libintl.h>
21#include <stdio.h>
22int
23main (int argc, char *argv[])
24{
25  printf (dcgettext ("hello", "Hello, world."));
26  return 0;
27}
28EOF
29
30cat <<EOF > xg-pr-1.cc
31#include <iostream.h>
32#include <libintl.h>
33#include <locale.h>
34int
35main (int argc, char *argv[])
36{
37  cout << dcgettext ("hello", "Hello world!", LC_MESSAGES) << endl;
38  return 0;
39}
40EOF
41
42: ${XGETTEXT=xgettext}
43${XGETTEXT} --omit-header -n \
44  -d xg-pr-1.tmp xg-pr-1.in.properties xg-pr-1.c xg-pr-1.cc || Exit 1
45LC_ALL=C tr -d '\r' < xg-pr-1.tmp.po > xg-pr-1.po || Exit 1
46
47cat <<EOF > xg-pr-1.ok
48#: file1.c:199
49#, fuzzy
50msgid "extract me"
51msgstr "some text to get fuzzy copied to result"
52
53#: file2.cc:200
54msgid "what about me"
55msgstr ""
56
57#: file3.c:10
58#, fuzzy, c-format
59msgid "hello"
60msgstr "Again some text for fuzzy"
61
62#: xg-pr-1.c:6
63#, c-format
64msgid "Hello, world."
65msgstr ""
66
67#: xg-pr-1.cc:7
68msgid "Hello world!"
69msgstr ""
70EOF
71
72: ${DIFF=diff}
73${DIFF} xg-pr-1.ok xg-pr-1.po
74result=$?
75
76exit $result
77