Home | History | Annotate | Line # | Download | only in tests
      1  1.1  christos #! /bin/sh
      2  1.1  christos 
      3  1.1  christos # Test C support: comments.
      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-c-5.in.cc"
      9  1.1  christos cat <<EOF > xg-c-5.in.cc
     10  1.1  christos main(){printf(gettext/*puke*/(/*barf*/"Hello, " "World!" "\n")); }
     11  1.1  christos EOF
     12  1.1  christos 
     13  1.1  christos tmpfiles="$tmpfiles xg-c-5.po"
     14  1.1  christos : ${XGETTEXT=xgettext}
     15  1.1  christos ${XGETTEXT} --omit-header --no-location --add-comments -d xg-c-5 xg-c-5.in.cc
     16  1.1  christos test $? = 0 || { rm -fr $tmpfiles; exit 1; }
     17  1.1  christos 
     18  1.1  christos tmpfiles="$tmpfiles xg-c-5.ok"
     19  1.1  christos cat <<EOF > xg-c-5.ok
     20  1.1  christos #. puke
     21  1.1  christos #. barf
     22  1.1  christos #, c-format
     23  1.1  christos msgid "Hello, World!\n"
     24  1.1  christos msgstr ""
     25  1.1  christos EOF
     26  1.1  christos 
     27  1.1  christos : ${DIFF=diff}
     28  1.1  christos ${DIFF} xg-c-5.ok xg-c-5.po
     29  1.1  christos result=$?
     30  1.1  christos 
     31  1.1  christos rm -fr $tmpfiles
     32  1.1  christos 
     33  1.1  christos exit $result
     34