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