Imported Upstream version 0.19.7
[platform/upstream/gettext.git] / gettext-tools / tests / xgettext-php-3
1 #!/bin/sh
2 . "${srcdir=.}/init.sh"; path_prepend_ . ../src
3
4 # Test PHP support: --add-comments option.
5
6 cat <<\EOF > xg-ph-3.php
7 <?
8 /* a */
9 /* b */ string = /* c */
10 /* d */
11 /* e */ _( /* f */ "hello " /* g */ . /* h */ "world" /* i */ );
12 ?>
13 EOF
14
15 : ${XGETTEXT=xgettext}
16 ${XGETTEXT} --add-comments --omit-header --no-location --keyword=_ \
17   -d xg-ph-3.tmp xg-ph-3.php || exit 1
18 LC_ALL=C tr -d '\r' < xg-ph-3.tmp.po > xg-ph-3.po || exit 1
19
20 cat <<EOF > xg-ph-3.ok
21 #. a
22 #. b
23 #. c
24 #. d
25 #. e
26 #. f
27 msgid "hello world"
28 msgstr ""
29 EOF
30
31 : ${DIFF=diff}
32 ${DIFF} xg-ph-3.ok xg-ph-3.po
33 result=$?
34
35 exit $result