]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Test PHP support.
authorBruno Haible <bruno@clisp.org>
Mon, 15 May 2006 11:55:04 +0000 (11:55 +0000)
committerBruno Haible <bruno@clisp.org>
Tue, 23 Jun 2009 10:13:18 +0000 (12:13 +0200)
gettext-tools/tests/xgettext-php-2 [new file with mode: 0755]

diff --git a/gettext-tools/tests/xgettext-php-2 b/gettext-tools/tests/xgettext-php-2
new file mode 100755 (executable)
index 0000000..67669ae
--- /dev/null
@@ -0,0 +1,73 @@
+#!/bin/sh
+
+# Test PHP support: here documents.
+
+tmpfiles=""
+trap 'rm -fr $tmpfiles' 1 2 3 15
+
+tmpfiles="$tmpfiles xg-ph-2.php"
+cat <<EOF > xg-ph-2.php
+<?
+echo _("Egyptians");
+echo <<<EOTMARKER
+Ramses
+EOTMARKER;
+echo _("Babylonians");
+echo <<<EOTMARKER
+Nebukadnezar
+EOTMARKER
+echo _("Assyrians");
+echo <<<EOTMARKER
+Assurbanipal
+EOT
+echo _("Persians");
+echo <<<EOTMARKER
+Darius
+
+echo _("Greeks");
+echo <<<EOTMARKER
+Alexander
+
+EOTMARKER
+echo _("Romans");
+echo <<<EOTMARKER
+Augustus
+  EOTMARKER
+echo _("Goths");
+echo <<<EOTMARKER
+Odoakar
+EOTMARKER
+echo _("Franks");
+?>
+EOF
+
+tmpfiles="$tmpfiles xg-ph-2.po"
+: ${XGETTEXT=xgettext}
+${XGETTEXT} --omit-header --no-location -d xg-ph-2 xg-ph-2.php
+test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+
+tmpfiles="$tmpfiles xg-ph-2.ok"
+cat <<EOF > xg-ph-2.ok
+msgid "Egyptians"
+msgstr ""
+
+msgid "Babylonians"
+msgstr ""
+
+msgid "Assyrians"
+msgstr ""
+
+msgid "Romans"
+msgstr ""
+
+msgid "Franks"
+msgstr ""
+EOF
+
+: ${DIFF=diff}
+${DIFF} xg-ph-2.ok xg-ph-2.po
+result=$?
+
+rm -fr $tmpfiles
+
+exit $result