Home | History | Annotate | Line # | Download | only in tests
      1  1.1  christos #! /bin/sh
      2  1.1  christos 
      3  1.1  christos # Test --update: location changed, and xgettext comment added. Both changes
      4  1.1  christos # must be reflected in the resulting PO file. With Java .properties syntax.
      5  1.1  christos 
      6  1.1  christos tmpfiles=""
      7  1.1  christos trap 'rm -fr $tmpfiles' 1 2 3 15
      8  1.1  christos 
      9  1.1  christos tmpfiles="$tmpfiles mm-p-2.po"
     10  1.1  christos cat <<\EOF > mm-p-2.po
     11  1.1  christos #: cogarithmetic.cc:12
     12  1.1  christos white=wei\u00df
     13  1.1  christos EOF
     14  1.1  christos 
     15  1.1  christos tmpfiles="$tmpfiles mm-p-2.pot"
     16  1.1  christos cat <<EOF > mm-p-2.pot
     17  1.1  christos #. location changed
     18  1.1  christos #: cogarithmetic.cc:33
     19  1.1  christos !white=
     20  1.1  christos EOF
     21  1.1  christos 
     22  1.1  christos tmpfiles="$tmpfiles mm-p-2.po~"
     23  1.1  christos : ${MSGMERGE=msgmerge}
     24  1.1  christos ${MSGMERGE} -q --properties-input --update mm-p-2.po mm-p-2.pot
     25  1.1  christos test $? = 0 || { rm -fr $tmpfiles; exit 1; }
     26  1.1  christos 
     27  1.1  christos tmpfiles="$tmpfiles mm-p-2.ok"
     28  1.1  christos cat <<\EOF > mm-p-2.ok
     29  1.1  christos #. location changed
     30  1.1  christos #: cogarithmetic.cc:33
     31  1.1  christos white=wei\u00df
     32  1.1  christos EOF
     33  1.1  christos 
     34  1.1  christos : ${DIFF=diff}
     35  1.1  christos ${DIFF} mm-p-2.ok mm-p-2.po
     36  1.1  christos result=$?
     37  1.1  christos 
     38  1.1  christos rm -fr $tmpfiles
     39  1.1  christos 
     40  1.1  christos exit $result
     41