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