Home | History | Annotate | Line # | Download | only in tests
      1 #! /bin/sh
      2 
      3 # Test that without --force-po option, a PO file without translations is
      4 # not created.
      5 
      6 tmpfiles=""
      7 trap '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 
     12 tmpfiles="$tmpfiles mcomm-test15.in1 mcomm-test15.in2 mcomm-test15.in3"
     13 cat <<EOF > mcomm-test15.in1
     14 msgid ""
     15 msgstr ""
     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 (at] suse.de>\n"
     20 "Language-Team: German <de (at] 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
     27 msgid "1"
     28 msgstr "1x"
     29 EOF
     30 
     31 cat <<EOF > mcomm-test15.in2
     32 msgid ""
     33 msgstr ""
     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 (at] suse.de>\n"
     38 "Language-Team: German <de (at] 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
     44 msgid "1"
     45 msgstr ""
     46 EOF
     47 
     48 cat <<EOF > mcomm-test15.in3
     49 msgid ""
     50 msgstr ""
     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 (at] suse.de>\n"
     55 "Language-Team: German <de (at] 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
     61 msgid "1"
     62 msgstr ""
     63 EOF
     64 
     65 tmpfiles="$tmpfiles mcomm-test15.out"
     66 rm -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
     74 test $? = 0 || { rm -fr $tmpfiles; exit 1; }
     75 
     76 # we've no unique msg; thus no PO should be created.
     77 if test -f mcomm-test15.out; then
     78   echo "mcomm-test15.out wrongly written."
     79   result=1
     80 else
     81   result=0
     82 fi
     83 
     84 rm -fr $tmpfiles
     85 
     86 exit $result
     87