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