xref: /netbsd-src/external/gpl2/gettext/dist/gettext-tools/tests/xgettext-php-2 (revision 181254a7b1bdde6873432bffef2d2decc4b5c22f)
1#!/bin/sh
2
3# Test PHP support: here documents.
4
5tmpfiles=""
6trap 'rm -fr $tmpfiles' 1 2 3 15
7
8tmpfiles="$tmpfiles xg-ph-2.php"
9cat <<EOF > xg-ph-2.php
10<?
11echo _("Egyptians");
12echo <<<EOTMARKER
13Ramses
14EOTMARKER;
15echo _("Babylonians");
16echo <<<EOTMARKER
17Nebukadnezar
18EOTMARKER
19echo _("Assyrians");
20echo <<<EOTMARKER
21Assurbanipal
22EOT
23echo _("Persians");
24echo <<<EOTMARKER
25Darius
26
27echo _("Greeks");
28echo <<<EOTMARKER
29Alexander
30
31EOTMARKER
32echo _("Romans");
33echo <<<EOTMARKER
34Augustus
35  EOTMARKER
36echo _("Goths");
37echo <<<EOTMARKER
38Odoakar
39Theoderich
40EOTMARKER
41echo _("Franks");
42?>
43EOF
44
45tmpfiles="$tmpfiles xg-ph-2.po"
46: ${XGETTEXT=xgettext}
47${XGETTEXT} --omit-header --no-location -d xg-ph-2 xg-ph-2.php
48test $? = 0 || { rm -fr $tmpfiles; exit 1; }
49
50tmpfiles="$tmpfiles xg-ph-2.ok"
51cat <<EOF > xg-ph-2.ok
52msgid "Egyptians"
53msgstr ""
54
55msgid "Babylonians"
56msgstr ""
57
58msgid "Assyrians"
59msgstr ""
60
61msgid "Romans"
62msgstr ""
63
64msgid "Franks"
65msgstr ""
66EOF
67
68: ${DIFF=diff}
69${DIFF} xg-ph-2.ok xg-ph-2.po
70result=$?
71
72rm -fr $tmpfiles
73
74exit $result
75