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