summaryrefslogtreecommitdiffstats
path: root/gettext-tools/tests/xgettext-10
blob: b82fa95f12df2fa052a61f91d02771e326e28467 (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
33
34
35
36
#! /bin/sh
. "${srcdir=.}/init.sh"; path_prepend_ . ../src

# Test --add-location=file option.

cat <<\EOF > xg-test10a.c
gettext ("foo");
EOF

cat <<\EOF > xg-test10b.c
gettext ("foo");
gettext ("bar");
EOF

: ${XGETTEXT=xgettext}
${XGETTEXT} --add-location=file --omit-header xg-test10a.c xg-test10b.c \
            -o xg-test10.out >xg-test10.err 2>&1
result=$?
cat xg-test10.err | grep -v 'warning: Charset' | grep -v '^ '
test $result = 0 || { Exit 1; }

cat <<\EOF > xg-test10.ok
#: xg-test10a.c xg-test10b.c
msgid "foo"
msgstr ""

#: xg-test10b.c
msgid "bar"
msgstr ""
EOF

: ${DIFF=diff}
${DIFF} xg-test10.ok xg-test10.out
result=$?

exit $result