Blame gettext-tools/tests/gettext-4

Packit 5b56b6
#! /bin/sh
Packit 5b56b6
. "${srcdir=.}/init.sh"; path_prepend_ . ../src
Packit 5b56b6
Packit 5b56b6
# Test that bind_textdomain_codeset() works.
Packit 5b56b6
Packit 5b56b6
# This test works only on systems that have a traditional french locale
Packit 5b56b6
# installed.
Packit 5b56b6
# gettext-4.po is actually a German PO file, but only the encoding of the
Packit 5b56b6
# locale matters, not the language. configure has already checked whether
Packit 5b56b6
# a traditional french locale is installed; no need to check also for a
Packit 5b56b6
# traditional german locale.
Packit 5b56b6
: ${LOCALE_FR=fr_FR}
Packit 5b56b6
{ test $LOCALE_FR != none && LC_ALL=$LOCALE_FR ../testlocale; } || {
Packit 5b56b6
  if test -f /usr/bin/localedef; then
Packit 5b56b6
    echo "Skipping test: no traditional french locale is installed"
Packit 5b56b6
  else
Packit 5b56b6
    echo "Skipping test: no traditional french locale is supported"
Packit 5b56b6
  fi
Packit 5b56b6
  exit 77
Packit 5b56b6
}
Packit 5b56b6
Packit 5b56b6
test -d gt-4 || mkdir gt-4
Packit 5b56b6
test -d gt-4/fr || mkdir gt-4/fr
Packit 5b56b6
test -d gt-4/fr/LC_MESSAGES || mkdir gt-4/fr/LC_MESSAGES
Packit 5b56b6
Packit 5b56b6
: ${MSGFMT=msgfmt}
Packit 5b56b6
${MSGFMT} -o gt-4/fr/LC_MESSAGES/codeset.mo "$abs_srcdir"/gettext-4.po
Packit 5b56b6
Packit 5b56b6
../gettext-4-prg $LOCALE_FR || exit 1
Packit 5b56b6
Packit 5b56b6
exit 0