Home | History | Annotate | Line # | Download | only in tests
      1  1.1  christos #!/bin/sh
      2  1.1  christos 
      3  1.1  christos # Test librep support: --add-comments option.
      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-lr-1.jl"
      9  1.1  christos cat <<EOF > xg-lr-1.jl
     10  1.1  christos ; This comment will not be extracted.
     11  1.1  christos (princ (_ "help"))
     12  1.1  christos ;;  TRANSLATORS: This is an extracted comment.
     13  1.1  christos (princ (_ "me"))
     14  1.1  christos #| Not extracted either. |#
     15  1.1  christos (princ (_ "Hey Jude"))
     16  1.1  christos #|  TRANSLATORS:
     17  1.1  christos      Nickname of the Beatles
     18  1.1  christos |#
     19  1.1  christos (princ (_ "The Fabulous Four"))
     20  1.1  christos EOF
     21  1.1  christos 
     22  1.1  christos tmpfiles="$tmpfiles xg-lr-1.po"
     23  1.1  christos : ${XGETTEXT=xgettext}
     24  1.1  christos ${XGETTEXT} --omit-header --no-location --add-comments=TRANSLATORS: \
     25  1.1  christos   -d xg-lr-1 xg-lr-1.jl
     26  1.1  christos test $? = 0 || { rm -fr $tmpfiles; exit 1; }
     27  1.1  christos 
     28  1.1  christos tmpfiles="$tmpfiles xg-lr-1.ok"
     29  1.1  christos cat <<EOF > xg-lr-1.ok
     30  1.1  christos msgid "help"
     31  1.1  christos msgstr ""
     32  1.1  christos 
     33  1.1  christos #. TRANSLATORS: This is an extracted comment.
     34  1.1  christos msgid "me"
     35  1.1  christos msgstr ""
     36  1.1  christos 
     37  1.1  christos msgid "Hey Jude"
     38  1.1  christos msgstr ""
     39  1.1  christos 
     40  1.1  christos #. TRANSLATORS:
     41  1.1  christos #. Nickname of the Beatles
     42  1.1  christos #.
     43  1.1  christos msgid "The Fabulous Four"
     44  1.1  christos msgstr ""
     45  1.1  christos EOF
     46  1.1  christos 
     47  1.1  christos : ${DIFF=diff}
     48  1.1  christos ${DIFF} xg-lr-1.ok xg-lr-1.po
     49  1.1  christos result=$?
     50  1.1  christos 
     51  1.1  christos rm -fr $tmpfiles
     52  1.1  christos 
     53  1.1  christos exit $result
     54