Imported Upstream version 0.19.7
[platform/upstream/gettext.git] / gettext-tools / tests / xgettext-c-3
1 #! /bin/sh
2 . "${srcdir=.}/init.sh"; path_prepend_ . ../src
3
4 # Test C support: recognition of #line.
5
6 cat <<EOF > xg-c-3.in.c
7 #line 42 "bozo"
8 main(){printf(gettext("Hello, World!\n"));}
9 # 6 "clown"
10 gettext("nothing");
11 EOF
12
13 : ${XGETTEXT=xgettext}
14 ${XGETTEXT} --omit-header --add-location -d xg-c-3.tmp xg-c-3.in.c || exit 1
15 LC_ALL=C tr -d '\r' < xg-c-3.tmp.po > xg-c-3.po || exit 1
16
17 cat <<EOF > xg-c-3.ok
18 #: bozo:42
19 #, c-format
20 msgid "Hello, World!\n"
21 msgstr ""
22
23 #: clown:6
24 msgid "nothing"
25 msgstr ""
26 EOF
27
28 : ${DIFF=diff}
29 ${DIFF} xg-c-3.ok xg-c-3.po
30 result=$?
31
32 exit $result