1#!/bin/sh
2. "${srcdir=.}/init.sh"; path_prepend_ . ../src
3
4# Test PHP support: here documents.
5
6cat <<EOF > xg-ph-2.php
7<?
8echo _("Egyptians");
9echo <<<EOTMARKER
10Ramses
11EOTMARKER;
12echo _("Babylonians");
13echo <<<EOTMARKER
14Nebukadnezar
15EOTMARKER
16echo _("Assyrians");
17echo <<<EOTMARKER
18Assurbanipal
19EOT
20echo _("Persians");
21echo <<<EOTMARKER
22Darius
23
24echo _("Greeks");
25echo <<<EOTMARKER
26Alexander
27
28EOTMARKER
29echo _("Romans");
30echo <<<EOTMARKER
31Augustus
32  EOTMARKER
33echo _("Goths");
34echo <<<EOTMARKER
35Odoakar
36Theoderich
37EOTMARKER
38echo _("Franks");
39?>
40EOF
41
42: ${XGETTEXT=xgettext}
43${XGETTEXT} --omit-header --no-location -d xg-ph-2.tmp xg-ph-2.php || Exit 1
44LC_ALL=C tr -d '\r' < xg-ph-2.tmp.po > xg-ph-2.po || Exit 1
45
46sed 's!<<<EOTMARKER!<<<"EOTMARKER"!' xg-ph-2.php > xg-ph-2d.php || Exit 1
47sed "s!<<<EOTMARKER!<<<'EOTMARKER'!" xg-ph-2.php > xg-ph-2s.php || Exit 1
48
49: ${XGETTEXT=xgettext}
50
51${XGETTEXT} --omit-header --no-location -d xg-ph-2.tmp xg-ph-2.php || Exit 1
52LC_ALL=C tr -d '\r' < xg-ph-2.tmp.po > xg-ph-2.po || Exit 1
53
54${XGETTEXT} --omit-header --no-location -d xg-ph-2d.tmp xg-ph-2d.php || Exit 1
55LC_ALL=C tr -d '\r' < xg-ph-2d.tmp.po > xg-ph-2d.po || Exit 1
56
57${XGETTEXT} --omit-header --no-location -d xg-ph-2s.tmp xg-ph-2s.php || Exit 1
58LC_ALL=C tr -d '\r' < xg-ph-2s.tmp.po > xg-ph-2s.po || Exit 1
59
60cat <<EOF > xg-ph-2.ok
61msgid "Egyptians"
62msgstr ""
63
64msgid "Babylonians"
65msgstr ""
66
67msgid "Assyrians"
68msgstr ""
69
70msgid "Romans"
71msgstr ""
72
73msgid "Franks"
74msgstr ""
75EOF
76
77: ${DIFF=diff}
78
79${DIFF} xg-ph-2.ok xg-ph-2.po
80result=$?
81test $result = 0 || exit $result
82
83${DIFF} xg-ph-2.ok xg-ph-2d.po
84result=$?
85test $result = 0 || exit $result
86
87${DIFF} xg-ph-2.ok xg-ph-2s.po
88result=$?
89test $result = 0 || exit $result
90
91exit $result
92