1#!/bin/sh 2 3# Test PHP support: --add-comments option. 4 5tmpfiles="" 6trap 'rm -fr $tmpfiles' 1 2 3 15 7 8tmpfiles="$tmpfiles xg-ph-3.php" 9cat <<\EOF > xg-ph-3.php 10<? 11/* a */ 12/* b */ string = /* c */ 13/* d */ 14/* e */ _( /* f */ "hello " /* g */ . /* h */ "world" /* i */ ); 15?> 16EOF 17 18tmpfiles="$tmpfiles xg-ph-3.tmp.po xg-ph-3.po" 19: ${XGETTEXT=xgettext} 20${XGETTEXT} --add-comments --omit-header --no-location --keyword=_ \ 21 -d xg-ph-3.tmp xg-ph-3.php 22test $? = 0 || { rm -fr $tmpfiles; exit 1; } 23tr -d '\r' < xg-ph-3.tmp.po > xg-ph-3.po 24test $? = 0 || { rm -fr $tmpfiles; exit 1; } 25 26tmpfiles="$tmpfiles xg-ph-3.ok" 27cat <<EOF > xg-ph-3.ok 28#. a 29#. b 30#. c 31#. d 32#. e 33#. f 34msgid "hello world" 35msgstr "" 36EOF 37 38: ${DIFF=diff} 39${DIFF} xg-ph-3.ok xg-ph-3.po 40result=$? 41 42rm -fr $tmpfiles 43 44exit $result 45