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