• Home
  • History
  • Annotate
  • Line#
  • Navigate
  • Raw
  • Download
  • only in /netgear-WNDR4500-V1.0.1.40_1.0.68/ap/gpl/timemachine/gettext-0.17/gettext-tools/tests/
1#!/bin/sh
2
3# Test of Shell support: bash $(...) syntax.
4
5tmpfiles=""
6trap 'rm -fr $tmpfiles' 1 2 3 15
7
8tmpfiles="$tmpfiles xg-sh-5.sh"
9cat <<\EOF > xg-sh-5.sh
10echo $(gettext 'Simple string')
11echo "$(gettext 'Simple string inside double-quotes')"
12echo $(gettext 'Simple decorated string: "x" \"y\"')
13echo "$(gettext 'Simple decorated string: "x" \"y\" inside double-quotes')"
14echo $(gettext "Simple dstring")
15echo "$(gettext "Simple dstring inside double-quotes")"
16echo $(gettext "Simple decorated dstring: \"x\" \\\"y\\\"")
17echo "$(gettext "Simple decorated dstring: \"x\" \\\"y\\\" inside double-quotes")"
18EOF
19
20tmpfiles="$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
23test $? = 0 || { rm -fr $tmpfiles; exit 1; }
24tr -d '\r' < xg-sh-5.tmp.po > xg-sh-5.po
25test $? = 0 || { rm -fr $tmpfiles; exit 1; }
26
27tmpfiles="$tmpfiles xg-sh-5.ok"
28cat <<\EOF > xg-sh-5.ok
29msgid "Simple string"
30msgstr ""
31
32msgid "Simple string inside double-quotes"
33msgstr ""
34
35msgid "Simple decorated string: \"x\" \\\"y\\\""
36msgstr ""
37
38msgid "Simple decorated string: \"x\" \\\"y\\\" inside double-quotes"
39msgstr ""
40
41msgid "Simple dstring"
42msgstr ""
43
44msgid "Simple dstring inside double-quotes"
45msgstr ""
46
47msgid "Simple decorated dstring: \"x\" \\\"y\\\""
48msgstr ""
49
50msgid "Simple decorated dstring: \"x\" \\\"y\\\" inside double-quotes"
51msgstr ""
52EOF
53
54: ${DIFF=diff}
55${DIFF} xg-sh-5.ok xg-sh-5.po
56result=$?
57
58rm -fr $tmpfiles
59
60exit $result
61