Imported Upstream version 0.18.1.1
[platform/upstream/gettext.git] / gettext-tools / tests / msgmerge-compendium-1
1 #! /bin/sh
2
3 # Test compendium option.
4
5 tmpfiles=""
6 trap 'rm -fr $tmpfiles' 1 2 3 15
7
8 tmpfiles="$tmpfiles mm-c-1.in1 mm-c-1.com mm-c-1.pot"
9 cat <<EOF > mm-c-1.in1
10 #: file.c:123
11 msgid "1"
12 msgstr "1x"
13 EOF
14
15 cat <<EOF > mm-c-1.com
16 #: file.c:345
17 msgid "2"
18 msgstr "2x"
19 EOF
20
21 cat <<EOF > mm-c-1.pot
22 #: file.c:123
23 msgid "1"
24 msgstr ""
25
26 #: file.c:345
27 msgid "2"
28 msgstr ""
29 EOF
30
31 tmpfiles="$tmpfiles mm-c-1.tmp mm-c-1.out"
32 : ${MSGMERGE=msgmerge}
33 ${MSGMERGE} -q -C mm-c-1.com -o mm-c-1.tmp mm-c-1.in1 mm-c-1.pot
34 test $? = 0 || { rm -fr $tmpfiles; exit 1; }
35 LC_ALL=C tr -d '\r' < mm-c-1.tmp > mm-c-1.out
36 test $? = 0 || { rm -fr $tmpfiles; exit 1; }
37
38 tmpfiles="$tmpfiles mm-c-1.ok"
39 cat << EOF > mm-c-1.ok
40 #: file.c:123
41 msgid "1"
42 msgstr "1x"
43
44 #: file.c:345
45 msgid "2"
46 msgstr "2x"
47 EOF
48
49 : ${DIFF=diff}
50 ${DIFF} mm-c-1.ok mm-c-1.out
51 result=$?
52
53 rm -fr $tmpfiles
54
55 exit $result