summaryrefslogtreecommitdiff
path: root/gettext-tools/tests/gettext-2
blob: 46d6a995137a24b9dfb200a2252fce8464d40e70 (plain)
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
#! /bin/sh
. "${srcdir=.}/init.sh"; path_prepend_ . ../src

# Test the gettext program without -e option.

if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
    ac_n= ac_c='
' ac_t='        '
  else
    ac_n=-n ac_c= ac_t=
  fi
else
  ac_n= ac_c='\c' ac_t=
fi

# Create binary test file in correct position.
test -d gt-2 || mkdir gt-2
test -d gt-2/LC_MESSAGES || mkdir gt-2/LC_MESSAGES
cp "$abs_srcdir"/test.mo gt-2/LC_MESSAGES

: ${GETTEXT=gettext}
TEXTDOMAINDIR=. LANGUAGE=gt-2 \
${GETTEXT} --env LC_ALL=en test 'error 3' > gt-test2.out

# Create correct file.
echo $ac_n "error 3 translation$ac_c" > gtmf-test2.ok

: ${DIFF=diff}
${DIFF} gtmf-test2.ok gt-test2.out
result=$?

exit $result