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