• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#! /bin/sh
2. "${srcdir=.}/init.sh"; path_prepend_ . ../src
3
4# Test ISO C 99 <inttypes.h> format string directives.
5
6: ${XGETTEXT=xgettext}
7${XGETTEXT} -o fc3.tmp --omit-header --no-location "$wabs_srcdir"/format-c-3-prg.c || Exit 1
8LC_ALL=C tr -d '\r' < fc3.tmp > fc3.pot || Exit 1
9
10cat <<EOF > fc3.ok
11#, c-format
12msgid "father of %<PRId8> children"
13msgstr ""
14EOF
15
16: ${DIFF=diff}
17${DIFF} fc3.ok fc3.pot || Exit 1
18
19cat <<EOF > fc3-de.po
20#, c-format
21msgid "father of %<PRId8> children"
22msgstr "Vater von %<PRId8> Kindern"
23EOF
24
25test -d fc3-dir || mkdir fc3-dir
26test -d fc3-dir/fr || mkdir fc3-dir/fr
27test -d fc3-dir/fr/LC_MESSAGES || mkdir fc3-dir/fr/LC_MESSAGES
28
29: ${MSGFMT=msgfmt}
30${MSGFMT} -o fc3-dir/fr/LC_MESSAGES/fc3.mo fc3-de.po
31
32: ${MSGUNFMT=msgunfmt}
33${MSGUNFMT} -o fc3-de.po.tmp fc3-dir/fr/LC_MESSAGES/fc3.mo || Exit 1
34LC_ALL=C tr -d '\r' < fc3-de.po.tmp > fc3-de.po.un || Exit 1
35
36: ${DIFF=diff}
37${DIFF} fc3-de.po fc3-de.po.un || Exit 1
38
39if test -z "$USE_SYSTEM_LIBINTL"; then
40  # In the tests/ dir: Rely on a fake setlocale, so that we can exercise
41  # the test on all platforms.
42
43  LANGUAGE= ../fc3 fr_FR || Exit 1
44
45else
46  # In the system-tests/ dir: Don't use a fake setlocale.
47
48  : ${LOCALE_FR=fr_FR}
49  : ${LOCALE_FR_UTF8=fr_FR.UTF-8}
50  if test $LOCALE_FR != none; then
51    prepare_locale_ fc3-dir/fr fc3-dir/$LOCALE_FR
52    LANGUAGE= ../fc3 $LOCALE_FR || Exit 1
53  fi
54  if test $LOCALE_FR_UTF8 != none; then
55    prepare_locale_ fc3-dir/fr fc3-dir/$LOCALE_FR_UTF8
56    LANGUAGE= ../fc3 $LOCALE_FR_UTF8 || Exit 1
57  fi
58  if test $LOCALE_FR = none && test $LOCALE_FR_UTF8 = none; then
59    if test -f /usr/bin/localedef; then
60      echo "Skipping test: no french locale is installed"
61    else
62      echo "Skipping test: no french locale is supported"
63    fi
64    Exit 77
65  fi
66
67fi
68
69Exit 0
70