Imported Upstream version 0.19.7
[platform/upstream/gettext.git] / gettext-tools / tests / xgettext-sh-5
1 #!/bin/sh
2 . "${srcdir=.}/init.sh"; path_prepend_ . ../src
3
4 # Test of Shell support: bash $(...) syntax.
5
6 cat <<\EOF > xg-sh-5.sh
7 echo $(gettext 'Simple string')
8 echo "$(gettext 'Simple string inside double-quotes')"
9 echo $(gettext 'Simple decorated string: "x" \"y\"')
10 echo "$(gettext 'Simple decorated string: "x" \"y\" inside double-quotes')"
11 echo $(gettext "Simple dstring")
12 echo "$(gettext "Simple dstring inside double-quotes")"
13 echo $(gettext "Simple decorated dstring: \"x\" \\\"y\\\"")
14 echo "$(gettext "Simple decorated dstring: \"x\" \\\"y\\\" inside double-quotes")"
15 EOF
16
17 : ${XGETTEXT=xgettext}
18 ${XGETTEXT} --omit-header --no-location -d xg-sh-5.tmp xg-sh-5.sh || exit 1
19 LC_ALL=C tr -d '\r' < xg-sh-5.tmp.po > xg-sh-5.po || exit 1
20
21 cat <<\EOF > xg-sh-5.ok
22 msgid "Simple string"
23 msgstr ""
24
25 msgid "Simple string inside double-quotes"
26 msgstr ""
27
28 msgid "Simple decorated string: \"x\" \\\"y\\\""
29 msgstr ""
30
31 msgid "Simple decorated string: \"x\" \\\"y\\\" inside double-quotes"
32 msgstr ""
33
34 msgid "Simple dstring"
35 msgstr ""
36
37 msgid "Simple dstring inside double-quotes"
38 msgstr ""
39
40 msgid "Simple decorated dstring: \"x\" \\\"y\\\""
41 msgstr ""
42
43 msgid "Simple decorated dstring: \"x\" \\\"y\\\" inside double-quotes"
44 msgstr ""
45 EOF
46
47 : ${DIFF=diff}
48 ${DIFF} xg-sh-5.ok xg-sh-5.po
49 result=$?
50
51 exit $result