xref: /netbsd-src/external/gpl2/gettext/dist/gettext-tools/tests/format-c-3 (revision 946379e7b37692fc43f68eb0d1c10daa0a7f3b6c)
1#! /bin/sh
2
3# Test ISO C 99 <inttypes.h> format string directives.
4
5tmpfiles=""
6trap 'rm -fr $tmpfiles' 1 2 3 15
7
8tmpfiles="$tmpfiles fc3.pot"
9: ${XGETTEXT=xgettext}
10${XGETTEXT} -o fc3.pot --omit-header --no-location ${top_srcdir}/tests/format-c-3-prg.c
11
12tmpfiles="$tmpfiles fc3.ok"
13cat <<EOF > fc3.ok
14#, c-format
15msgid "father of %<PRId8> children"
16msgstr ""
17EOF
18
19: ${DIFF=diff}
20${DIFF} fc3.ok fc3.pot || exit 1
21
22tmpfiles="$tmpfiles de.po"
23cat <<EOF > de.po
24#, c-format
25msgid "father of %<PRId8> children"
26msgstr "Vater von %<PRId8> Kindern"
27EOF
28
29tmpfiles="$tmpfiles de"
30test -d de || mkdir de
31test -d de/LC_MESSAGES || mkdir de/LC_MESSAGES
32
33: ${MSGFMT=msgfmt}
34${MSGFMT} -o de/LC_MESSAGES/fc3.mo de.po
35
36tmpfiles="$tmpfiles de.po.tmp"
37: ${MSGUNFMT=msgunfmt}
38${MSGUNFMT} -o de.po.tmp de/LC_MESSAGES/fc3.mo
39
40: ${DIFF=diff}
41${DIFF} de.po de.po.tmp || exit 1
42
43LANGUAGE= ./fc3 de_DE
44result=$?
45
46rm -fr $tmpfiles
47
48exit $result
49