Imported Upstream version 0.19.7
[platform/upstream/gettext.git] / gettext-tools / tests / xgettext-objc-1
1 #! /bin/sh
2 . "${srcdir=.}/init.sh"; path_prepend_ . ../src
3
4 # Test ObjectiveC extractor.
5
6 cat <<\EOF > xg-ob-1.m
7 id str = _(@
8 "conca" /* comment */
9 @
10 // another comment
11  "tenated");
12
13 _(@"foo") _ ( @"foo2" /* test */ )
14
15 "_()"
16
17 "  \" _(foo) \" /* comment "
18
19 _ // test
20 (@ /* comment " */ "test"
21 @
22 " test2"
23 )
24
25 NSLocalizedString(@"Information", @"")
26 EOF
27
28 : ${XGETTEXT=xgettext}
29 ${XGETTEXT} --omit-header -k_ -kNSLocalizedString -d xg-ob-1.tmp xg-ob-1.m || exit 1
30 LC_ALL=C tr -d '\r' < xg-ob-1.tmp.po > xg-ob-1.po || exit 1
31
32 cat <<\EOF > xg-ob-1.ok
33 #: xg-ob-1.m:2
34 msgid "concatenated"
35 msgstr ""
36
37 #: xg-ob-1.m:7
38 msgid "foo"
39 msgstr ""
40
41 #: xg-ob-1.m:7
42 msgid "foo2"
43 msgstr ""
44
45 #: xg-ob-1.m:14
46 msgid "test test2"
47 msgstr ""
48
49 #: xg-ob-1.m:19
50 msgid "Information"
51 msgstr ""
52 EOF
53
54 : ${DIFF=diff}
55 ${DIFF} xg-ob-1.ok xg-ob-1.po
56 result=$?
57
58 exit $result