xref: /netbsd-src/external/gpl2/gettext/dist/gettext-tools/tests/xgettext-objc-1 (revision e6c7e151de239c49d2e38720a061ed9d1fa99309)
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.po"
32: ${XGETTEXT=xgettext}
33${XGETTEXT} --omit-header -k_ -kNSLocalizedString -d xg-ob-1 xg-ob-1.m
34test $? = 0 || { rm -fr $tmpfiles; exit 1; }
35
36tmpfiles="$tmpfiles xg-ob-1.ok"
37cat <<\EOF > xg-ob-1.ok
38#: xg-ob-1.m:2
39msgid "concatenated"
40msgstr ""
41
42#: xg-ob-1.m:7
43msgid "foo"
44msgstr ""
45
46#: xg-ob-1.m:7
47msgid "foo2"
48msgstr ""
49
50#: xg-ob-1.m:14
51msgid "test test2"
52msgstr ""
53
54#: xg-ob-1.m:19
55msgid "Information"
56msgstr ""
57EOF
58
59: ${DIFF=diff}
60${DIFF} xg-ob-1.ok xg-ob-1.po
61result=$?
62
63rm -fr $tmpfiles
64
65exit $result
66