xref: /netbsd-src/external/gpl2/gettext/dist/gettext-tools/tests/msgunfmt-2 (revision 946379e7b37692fc43f68eb0d1c10daa0a7f3b6c)
1#! /bin/sh
2
3# Test ISO C 99 <inttypes.h> format string directives.
4# Verify that msgunfmt, applied to a .mo file of major revision 1 (with
5# system-dependent strings), yields a PO file with c-format annotation, so that
6# msgfmt applied to it will again produce a .mo file of major revision 1.
7
8tmpfiles=""
9trap 'rm -fr $tmpfiles' 1 2 3 15
10
11tmpfiles="$tmpfiles mu-2.in"
12cat <<EOF > mu-2.in
13#, c-format
14msgid "truncating at %<PRIuMAX> bytes in output file %s"
15msgstr "schneide bei %<PRIuMAX> Bytes in Ausgabedatei %s ab"
16EOF
17
18tmpfiles="$tmpfiles mu-2.mo"
19: ${MSGFMT=msgfmt}
20${MSGFMT} -o mu-2.mo mu-2.in
21test $? = 0 || { rm -fr $tmpfiles; exit 1; }
22
23tmpfiles="$tmpfiles mu-2.out"
24: ${MSGUNFMT=msgunfmt}
25${MSGUNFMT} -o mu-2.out mu-2.mo
26test $? = 0 || { rm -fr $tmpfiles; exit 1; }
27
28: ${DIFF=diff}
29${DIFF} mu-2.in mu-2.out
30result=$?
31
32rm -fr $tmpfiles
33
34exit $result
35