NetBSD/gnu/dist/gettext/gettext-tools/tests/xgettext-c-4

32 lines
579 B
Bash

#! /bin/sh
# Test C support: --trigraphs option.
tmpfiles=""
trap 'rm -fr $tmpfiles' 1 2 3 15
tmpfiles="$tmpfiles xg-c-4.in.c"
cat <<EOF > xg-c-4.in.c
main()??<printf(gettext("Hello, " "World!" "??/n")); ??>
EOF
tmpfiles="$tmpfiles xg-c-4.po"
: ${XGETTEXT=xgettext}
${XGETTEXT} --omit-header --no-location --trigraphs xg-c-4.in.c -d xg-c-4
test $? = 0 || { rm -fr $tmpfiles; exit 1; }
tmpfiles="$tmpfiles xg-c-4.ok"
cat <<EOF > xg-c-4.ok
#, c-format
msgid "Hello, World!\n"
msgstr ""
EOF
: ${DIFF=diff}
${DIFF} xg-c-4.ok xg-c-4.po
result=$?
rm -fr $tmpfiles
exit $result