xref: /netbsd-src/external/gpl2/gettext/dist/gettext-tools/tests/msgcomm-15 (revision 946379e7b37692fc43f68eb0d1c10daa0a7f3b6c)
1#! /bin/sh
2
3# Test that without --force-po option, a PO file without translations is
4# not created.
5
6tmpfiles=""
7trap 'rm -fr $tmpfiles' 1 2 3 15
8
9# no unique msg in input files.
10# with --force-po create an empty PO file; cf. msgcomm-14
11
12tmpfiles="$tmpfiles mcomm-test15.in1 mcomm-test15.in2 mcomm-test15.in3"
13cat <<EOF > mcomm-test15.in1
14msgid ""
15msgstr ""
16"Project-Id-Version: GNU one 1.2.3\n"
17"POT-Creation-Date: 2000-12-11 20:49+0100\n"
18"PO-Revision-Date: 2000-03-18 15:25+01:00\n"
19"Last-Translator: Karl Eichwalder <ke@suse.de>\n"
20"Language-Team: German <de@li.org>\n"
21"MIME-Version: 1.0\n"
22"Content-Type: text/plain; charset=iso-8859-1\n"
23"Content-Transfer-Encoding: 8bit\n"
24
25# occurs 3 times
26#: first.c:123
27msgid "1"
28msgstr "1x"
29EOF
30
31cat <<EOF > mcomm-test15.in2
32msgid ""
33msgstr ""
34"Project-Id-Version: GNU one 1.2.3\n"
35"POT-Creation-Date: 2000-12-11 20:49+0100\n"
36"PO-Revision-Date: 2000-03-18 15:25+01:00\n"
37"Last-Translator: Karl Eichwalder <ke@suse.de>\n"
38"Language-Team: German <de@li.org>\n"
39"MIME-Version: 1.0\n"
40"Content-Type: text/plain; charset=iso-8859-1\n"
41"Content-Transfer-Encoding: 8bit\n"
42
43#: hunt.c:759
44msgid "1"
45msgstr ""
46EOF
47
48cat <<EOF > mcomm-test15.in3
49msgid ""
50msgstr ""
51"Project-Id-Version: GNU one 1.2.3\n"
52"POT-Creation-Date: 2000-12-11 20:49+0100\n"
53"PO-Revision-Date: 2000-03-18 15:25+01:00\n"
54"Last-Translator: Karl Eichwalder <ke@suse.de>\n"
55"Language-Team: German <de@li.org>\n"
56"MIME-Version: 1.0\n"
57"Content-Type: text/plain; charset=iso-8859-1\n"
58"Content-Transfer-Encoding: 8bit\n"
59
60#: hunt.c:789
61msgid "1"
62msgstr ""
63EOF
64
65tmpfiles="$tmpfiles mcomm-test15.out"
66rm -f mcomm-test15.out
67
68: ${MSGCOMM=msgcomm}
69
70# --unique is shorthand for --less-than=2; do we've to test both
71# switches?  Are 'for' loops allowed? -ke-
72${MSGCOMM} --less-than=2 --no-location -o mcomm-test15.out \
73    mcomm-test15.in1 mcomm-test15.in2 mcomm-test15.in3
74test $? = 0 || { rm -fr $tmpfiles; exit 1; }
75
76# we've no unique msg; thus no PO should be created.
77if test -f mcomm-test15.out; then
78  echo "mcomm-test15.out wrongly written."
79  result=1
80else
81  result=0
82fi
83
84rm -fr $tmpfiles
85
86exit $result
87