Home | History | Annotate | Line # | Download | only in tests
      1 #! /bin/sh
      2 
      3 # Test C support: valid but unlikely C format strings are _not_ marked as
      4 # c-format by default.
      5 
      6 tmpfiles=""
      7 trap 'rm -fr $tmpfiles' 1 2 3 15
      8 
      9 tmpfiles="$tmpfiles xg-c-12.c"
     10 cat <<\EOF > xg-c-12.c
     11 gettext ("%1% on, %2% off");
     12 EOF
     13 
     14 tmpfiles="$tmpfiles xg-c-12.po"
     15 : ${XGETTEXT=xgettext}
     16 ${XGETTEXT} --omit-header --no-location -d xg-c-12 xg-c-12.c
     17 test $? = 0 || { rm -fr $tmpfiles; exit 1; }
     18 
     19 tmpfiles="$tmpfiles xg-c-12.ok"
     20 cat <<EOF > xg-c-12.ok
     21 msgid "%1% on, %2% off"
     22 msgstr ""
     23 EOF
     24 
     25 : ${DIFF=diff}
     26 ${DIFF} xg-c-12.ok xg-c-12.po
     27 result=$?
     28 
     29 rm -fr $tmpfiles
     30 
     31 exit $result
     32