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