summaryrefslogtreecommitdiffstats
path: root/gettext-tools/tests/xgettext-c-3
blob: c06c056cb47e1eaa682bf2eb00a7e753cd4d0a06 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#! /bin/sh
. "${srcdir=.}/init.sh"; path_prepend_ . ../src

# Test C support: recognition of #line.

cat <<EOF > xg-c-3.in.c
#line 42 "bozo"
main(){printf(gettext("Hello, World!\n"));}
# 6 "clown"
gettext("nothing");
EOF

: ${XGETTEXT=xgettext}
${XGETTEXT} --omit-header --add-location -d xg-c-3.tmp xg-c-3.in.c || Exit 1
LC_ALL=C tr -d '\r' < xg-c-3.tmp.po > xg-c-3.po || Exit 1

cat <<EOF > xg-c-3.ok
#: bozo:42
#, c-format
msgid "Hello, World!\n"
msgstr ""

#: clown:6
msgid "nothing"
msgstr ""
EOF

: ${DIFF=diff}
${DIFF} xg-c-3.ok xg-c-3.po
result=$?

exit $result