Home | History | Annotate | Line # | Download | only in tests
      1 #! /bin/sh
      2 
      3 # Test C support: comments meant for xgettext, and whitespace.
      4 
      5 tmpfiles=""
      6 trap 'rm -fr $tmpfiles' 1 2 3 15
      7 
      8 tmpfiles="$tmpfiles xg-c-2.in.c"
      9 cat <<EOF > xg-c-2.in.c
     10 This is a test of the xgettext functionality.
     11 /* xgettext:no-c-format */
     12 _("extract me")
     13 Sometimes keywords can be spread apart
     14 xgettext:no-c-format
     15 _ ( "what about me" )
     16 And even further on accasion
     17 _
     18 (
     19 "hello"
     20 )
     21 EOF
     22 
     23 tmpfiles="$tmpfiles xg-c-2.po"
     24 : ${XGETTEXT=xgettext}
     25 ${XGETTEXT} -d xg-c-2 -k_ --omit-header --no-location xg-c-2.in.c
     26 test $? = 0 || { rm -fr $tmpfiles; exit 1; }
     27 
     28 tmpfiles="$tmpfiles xg-c-2.ok"
     29 cat <<EOF > xg-c-2.ok
     30 #, no-c-format
     31 msgid "extract me"
     32 msgstr ""
     33 
     34 msgid "what about me"
     35 msgstr ""
     36 
     37 msgid "hello"
     38 msgstr ""
     39 EOF
     40 
     41 : ${DIFF=diff}
     42 ${DIFF} xg-c-2.ok xg-c-2.po
     43 result=$?
     44 
     45 rm -fr $tmpfiles
     46 
     47 exit $result
     48