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