1#! /bin/sh 2 3# Test C support: recognition of #line. 4 5tmpfiles="" 6trap 'rm -fr $tmpfiles' 1 2 3 15 7 8tmpfiles="$tmpfiles xg-c-3.in.c" 9cat <<EOF > xg-c-3.in.c 10#line 42 "bozo" 11main(){printf(gettext("Hello, World!\n"));} 12# 6 "clown" 13gettext("nothing"); 14EOF 15 16tmpfiles="$tmpfiles xg-c-3.tmp.po xg-c-3.po" 17: ${XGETTEXT=xgettext} 18${XGETTEXT} --omit-header --add-location -d xg-c-3.tmp xg-c-3.in.c 19test $? = 0 || { rm -fr $tmpfiles; exit 1; } 20tr -d '\r' < xg-c-3.tmp.po > xg-c-3.po 21test $? = 0 || { rm -fr $tmpfiles; exit 1; } 22 23tmpfiles="$tmpfiles xg-c-3.ok" 24cat <<EOF > xg-c-3.ok 25#: bozo:42 26#, c-format 27msgid "Hello, World!\n" 28msgstr "" 29 30#: clown:6 31msgid "nothing" 32msgstr "" 33EOF 34 35: ${DIFF=diff} 36${DIFF} xg-c-3.ok xg-c-3.po 37result=$? 38 39rm -fr $tmpfiles 40 41exit $result 42