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