• Home
  • History
  • Annotate
  • Line#
  • Navigate
  • Raw
  • Download
  • only in /netgear-WNDR4500v2-V1.0.0.60_1.0.38/ap/gpl/timemachine/gettext-0.17/gettext-tools/tests/
1#!/bin/sh
2
3# Test awk support: --add-comments option.
4
5tmpfiles=""
6trap 'rm -fr $tmpfiles' 1 2 3 15
7
8tmpfiles="$tmpfiles xg-a-2.awk"
9cat <<\EOF > xg-a-2.awk
10# a
11string = # b
12# c
13_"hello world" # d
14# e
15;
16EOF
17
18tmpfiles="$tmpfiles xg-a-2.tmp.po xg-a-2.po"
19: ${XGETTEXT=xgettext}
20${XGETTEXT} --add-comments --omit-header --no-location --keyword=_ \
21  -d xg-a-2.tmp xg-a-2.awk
22test $? = 0 || { rm -fr $tmpfiles; exit 1; }
23tr -d '\r' < xg-a-2.tmp.po > xg-a-2.po
24test $? = 0 || { rm -fr $tmpfiles; exit 1; }
25
26tmpfiles="$tmpfiles xg-a-2.ok"
27cat <<EOF > xg-a-2.ok
28#. a
29#. b
30#. c
31msgid "hello world"
32msgstr ""
33EOF
34
35: ${DIFF=diff}
36${DIFF} xg-a-2.ok xg-a-2.po
37result=$?
38
39rm -fr $tmpfiles
40
41exit $result
42