File: gettext-3

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 (62 lines) | stat: -rwxr-xr-x 1,528 bytes parent folder | download | duplicates (3)
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
56
57
58
59
60
61
62
#! /bin/sh

# Test that on glibc systems, gettext() works right even with intermediate
# setlocale() calls.

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 and fr_FR locale installed.
LC_ALL=de_DE ./testlocale || {
  if test -f /usr/bin/localedef; then
    echo "Skipping test: locale de_DE not installed"
  else
    echo "Skipping test: locale de_DE not supported"
  fi
  exit 77
}
LC_ALL=fr_FR ./testlocale || {
  if test -f /usr/bin/localedef; then
    echo "Skipping test: locale fr_FR not installed"
  else
    echo "Skipping test: locale fr_FR not supported"
  fi
  exit 77
}

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

: ${MSGFMT=msgfmt}
${MSGFMT} -o de_DE/LC_MESSAGES/tstlang.mo ${top_srcdir}/tests/gettext-3-1.po
${MSGFMT} -o fr_FR/LC_MESSAGES/tstlang.mo ${top_srcdir}/tests/gettext-3-2.po

tmpfiles="$tmpfiles gt-3.ok"
cat <<EOF > gt-3.ok
String1 - Lang1: 1st string
String2 - Lang1: 2nd string
String1 - Lang2: 1st string
String2 - Lang2: 2nd string
String1 - First string for testing.
String2 - Another string for testing.
EOF

tmpfiles="$tmpfiles gt-3.out"
./gettext-3-prg > gt-3.out || exit 1

: ${DIFF=diff}
${DIFF} gt-3.ok gt-3.out || exit 1

rm -fr $tmpfiles

exit 0