File: gettext-7

package info (click to toggle)
gettext 0.17-4
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 64,956 kB
  • ctags: 38,653
  • sloc: ansic: 299,024; sh: 49,429; makefile: 8,097; perl: 4,181; lisp: 3,261; yacc: 665; java: 618; cs: 578; sed: 369; objc: 337; cpp: 325; awk: 80; tcl: 63; pascal: 12; php: 8
file content (55 lines) | stat: -rwxr-xr-x 1,357 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#! /bin/sh

# Test that on glibc systems, gettext() in multithreaded applications works
# correctly if different threads operate in different locales referring to
# the same catalog file but with different encodings.

tmpfiles=""
trap 'rm -fr $tmpfiles' 1 2 3 15

# This test works only on glibc systems.
: ${GLIBC2=no}
test "$GLIBC2" = yes || {
  echo "Skipping test: not a glibc system"
  exit 77
}

# This test works only on systems that have a de_DE.ISO-8859-1 and
# de_DE.UTF-8 locale installed.
LC_ALL=de_DE.ISO-8859-1 ./testlocale || {
  if test -f /usr/bin/localedef; then
    echo "Skipping test: locale de_DE.ISO-8859-1 not installed"
  else
    echo "Skipping test: locale de_DE.ISO-8859-1 not supported"
  fi
  exit 77
}
LC_ALL=de_DE.UTF-8 ./testlocale || {
  if test -f /usr/bin/localedef; then
    echo "Skipping test: locale de_DE.UTF-8 not installed"
  else
    echo "Skipping test: locale de_DE.UTF-8 not supported"
  fi
  exit 77
}

tmpfiles="$tmpfiles de_DE"
test -d de_DE || mkdir de_DE
test -d de_DE/LC_MESSAGES || mkdir de_DE/LC_MESSAGES

: ${MSGFMT=msgfmt}
${MSGFMT} -o de_DE/LC_MESSAGES/tstthread.mo ${top_srcdir}/tests/gettext-7.po

tmpfiles="$tmpfiles gt-7.out"
./gettext-7-prg > gt-7.out
case $? in
  0) ;;
  77)
    echo "Skipping test: not a glibc 2.3 system"
    rm -fr $tmpfiles; exit 77
    ;;
esac

rm -fr $tmpfiles

exit 0