• Home
  • History
  • Annotate
  • Line#
  • Navigate
  • Raw
  • Download
  • only in /netgear-WNDR4500v2-V1.0.0.60_1.0.38/ap/gpl/timemachine/gettext-0.17/gettext-tools/tests/
1#! /bin/sh
2
3# Test ObjectiveC extractor.
4
5tmpfiles=""
6trap 'rm -fr $tmpfiles' 1 2 3 15
7
8tmpfiles="$tmpfiles xg-ob-1.m"
9cat <<\EOF > xg-ob-1.m
10id str = _(@
11"conca" /* comment */
12@
13// another comment
14 "tenated");
15
16_(@"foo") _ ( @"foo2" /* test */ )
17
18"_()"
19
20"  \" _(foo) \" /* comment "
21
22_ // test
23(@ /* comment " */ "test"
24@
25" test2"
26)
27
28NSLocalizedString(@"Information", @"")
29EOF
30
31tmpfiles="$tmpfiles xg-ob-1.tmp.po xg-ob-1.po"
32: ${XGETTEXT=xgettext}
33${XGETTEXT} --omit-header -k_ -kNSLocalizedString -d xg-ob-1.tmp xg-ob-1.m
34test $? = 0 || { rm -fr $tmpfiles; exit 1; }
35tr -d '\r' < xg-ob-1.tmp.po > xg-ob-1.po
36test $? = 0 || { rm -fr $tmpfiles; exit 1; }
37
38tmpfiles="$tmpfiles xg-ob-1.ok"
39cat <<\EOF > xg-ob-1.ok
40#: xg-ob-1.m:2
41msgid "concatenated"
42msgstr ""
43
44#: xg-ob-1.m:7
45msgid "foo"
46msgstr ""
47
48#: xg-ob-1.m:7
49msgid "foo2"
50msgstr ""
51
52#: xg-ob-1.m:14
53msgid "test test2"
54msgstr ""
55
56#: xg-ob-1.m:19
57msgid "Information"
58msgstr ""
59EOF
60
61: ${DIFF=diff}
62${DIFF} xg-ob-1.ok xg-ob-1.po
63result=$?
64
65rm -fr $tmpfiles
66
67exit $result
68