Imported Upstream version 0.18.3.2
[platform/upstream/gettext.git] / gettext-tools / tests / gettext-1
1 #! /bin/sh
2
3 # Test the gettext program with -e option.
4
5 tmpfiles=""
6 trap 'rm -fr $tmpfiles' 1 2 3 15
7
8 # Create binary test file in correct position.
9 tmpfiles="$tmpfiles gt-1"
10 test -d gt-1 || mkdir gt-1
11 test -d gt-1/LC_MESSAGES || mkdir gt-1/LC_MESSAGES
12 cp $top_srcdir/tests/test.mo gt-1/LC_MESSAGES
13
14 tmpfiles="$tmpfiles gt-test1.out"
15 : ${GETTEXT=gettext}
16 TEXTDOMAINDIR=. LANGUAGE=gt-1 \
17 ${GETTEXT} --env LC_ALL=en -e test 'SYS_(C)\n' | LC_ALL=C tr -d '\r' > gt-test1.out
18
19 # Create correct file.
20 tmpfile="$tmpfiles gtmf-test1.ok"
21 cat <<EOF > gtmf-test1.ok
22 MSGFMT(1) portable message object file compiler
23 Copyright (C) 1995 Free Software Foundation
24 Report bugs to <bug-gnu-utils@gnu.org>
25 EOF
26
27 : ${DIFF=diff}
28 ${DIFF} gtmf-test1.ok gt-test1.out
29 result=$?
30
31 rm -fr $tmpfiles
32
33 exit $result