• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#! /bin/sh
2. "${srcdir=.}/init.sh"; path_prepend_ . ../src
3
4# Test that gettext() in multithreaded applications works correctly if
5# different threads operate in different locales referring to the same
6# catalog file but with different encodings.
7
8# Let's use two locales that configure already checked for: French.
9# The PO file is actually German, not French, but that doesn't matter.
10
11test -d in-th-3 || mkdir in-th-3
12test -d in-th-3/fr || mkdir in-th-3/fr
13test -d in-th-3/fr/LC_MESSAGES || mkdir in-th-3/fr/LC_MESSAGES
14
15: ${MSGFMT=msgfmt}
16${MSGFMT} -o in-th-3/fr/LC_MESSAGES/tstthread.mo "$wabs_srcdir"/intl-thread-3.po
17
18: ${LOCALE_FR=fr_FR}
19: ${LOCALE_FR_UTF8=fr_FR.UTF-8}
20if test $LOCALE_FR != none && test $LOCALE_FR_UTF8 != none; then
21  prepare_locale_ in-th-3/fr in-th-3/$LOCALE_FR
22  prepare_locale_ in-th-3/fr in-th-3/$LOCALE_FR_UTF8
23  ../intl-thread-3-prg $LOCALE_FR $LOCALE_FR_UTF8 > in-th-3.out
24  case $? in
25    0) ;;
26    77)
27      echo "Skipping test: POSIX per-thread locales not supported"
28      Exit 77
29      ;;
30    *)
31      Exit 1
32      ;;
33  esac
34else
35  if test -f /usr/bin/localedef; then
36    echo "Skipping test: no traditional and modern french locales are installed"
37  else
38    echo "Skipping test: no traditional and modern french locales are supported"
39  fi
40  Exit 77
41fi
42
43Exit 0
44