Home | History | Annotate | Line # | Download | only in tests
      1  1.1  christos #!/bin/sh
      2  1.1  christos 
      3  1.1  christos # Test of comment extraction in the case of duplicated msgids.
      4  1.1  christos 
      5  1.1  christos tmpfiles=""
      6  1.1  christos trap 'rm -fr $tmpfiles' 1 2 3 15
      7  1.1  christos 
      8  1.1  christos tmpfiles="$tmpfiles xg-test7.c"
      9  1.1  christos cat <<\EOF > xg-test7.c
     10  1.1  christos /* first comment */
     11  1.1  christos /* xgettext: c-format */
     12  1.1  christos gettext ("abc");
     13  1.1  christos 
     14  1.1  christos /* first comment */
     15  1.1  christos /* xgettext: lisp-format */
     16  1.1  christos gettext ("abc");
     17  1.1  christos 
     18  1.1  christos /* second comment */
     19  1.1  christos /* xgettext: python-format */
     20  1.1  christos gettext ("abc");
     21  1.1  christos EOF
     22  1.1  christos 
     23  1.1  christos tmpfiles="$tmpfiles xg-test7.po"
     24  1.1  christos : ${XGETTEXT=xgettext}
     25  1.1  christos ${XGETTEXT} --omit-header --add-comments -d xg-test7 xg-test7.c
     26  1.1  christos test $? = 0 || { rm -fr $tmpfiles; exit 1; }
     27  1.1  christos 
     28  1.1  christos tmpfiles="$tmpfiles xg-test7.ok"
     29  1.1  christos cat <<\EOF > xg-test7.ok
     30  1.1  christos #. first comment
     31  1.1  christos #. second comment
     32  1.1  christos #: xg-test7.c:3 xg-test7.c:7 xg-test7.c:11
     33  1.1  christos #, c-format, python-format, lisp-format
     34  1.1  christos msgid "abc"
     35  1.1  christos msgstr ""
     36  1.1  christos EOF
     37  1.1  christos 
     38  1.1  christos : ${DIFF=diff}
     39  1.1  christos ${DIFF} xg-test7.ok xg-test7.po
     40  1.1  christos result=$?
     41  1.1  christos 
     42  1.1  christos rm -fr $tmpfiles
     43  1.1  christos 
     44  1.1  christos exit $result
     45