Add -lm dependency for gettextlib to fix LTO build
[platform/upstream/gettext.git] / gettext-tools / tests / xgettext-php-4
1 #!/bin/sh
2 . "${srcdir=.}/init.sh"; path_prepend_ . ../src
3
4 # Test PHP support: string concatenation.
5
6 cat <<EOF > xg-ph-4.php
7 <?
8 echo _("foo"."bar");
9 echo _("hello " .
10 "world");
11 echo _("1" + "2" . "3");
12 echo _("4" . "5" + "6");
13 echo _("7" . "8" . "9");
14 ?>
15 EOF
16
17 : ${XGETTEXT=xgettext}
18 ${XGETTEXT} --omit-header --no-location --extract-all \
19   -d xg-ph-4.tmp xg-ph-4.php || exit 1
20 LC_ALL=C tr -d '\r' < xg-ph-4.tmp.po > xg-ph-4.po || exit 1
21
22 cat <<EOF > xg-ph-4.ok
23 msgid "foobar"
24 msgstr ""
25
26 msgid "hello world"
27 msgstr ""
28
29 msgid "1"
30 msgstr ""
31
32 msgid "2"
33 msgstr ""
34
35 msgid "3"
36 msgstr ""
37
38 msgid "45"
39 msgstr ""
40
41 msgid "6"
42 msgstr ""
43
44 msgid "789"
45 msgstr ""
46 EOF
47
48 : ${DIFF=diff}
49 ${DIFF} xg-ph-4.ok xg-ph-4.po
50 result=$?
51
52 exit $result