Imported Upstream version 0.18.1.1
[platform/upstream/gettext.git] / gettext-tools / tests / xgettext-scheme-3
1 #!/bin/sh
2
3 # Test Scheme support: --add-comments option.
4
5 tmpfiles=""
6 trap 'rm -fr $tmpfiles' 1 2 3 15
7
8 tmpfiles="$tmpfiles xg-sc-3.scm"
9 cat <<\EOF > xg-sc-3.scm
10 ; a
11 (setq string ; b
12 ; c
13 (_ ; d
14 "hello world" ; e
15 ; f
16 ))
17 EOF
18
19 tmpfiles="$tmpfiles xg-sc-3.tmp.po xg-sc-3.po"
20 : ${XGETTEXT=xgettext}
21 ${XGETTEXT} --add-comments --omit-header --no-location --keyword=_ \
22   -d xg-sc-3.tmp xg-sc-3.scm
23 test $? = 0 || { rm -fr $tmpfiles; exit 1; }
24 LC_ALL=C tr -d '\r' < xg-sc-3.tmp.po > xg-sc-3.po
25 test $? = 0 || { rm -fr $tmpfiles; exit 1; }
26
27 tmpfiles="$tmpfiles xg-sc-3.ok"
28 cat <<EOF > xg-sc-3.ok
29 #. a
30 #. b
31 #. c
32 #. d
33 msgid "hello world"
34 msgstr ""
35 EOF
36
37 : ${DIFF=diff}
38 ${DIFF} xg-sc-3.ok xg-sc-3.po
39 result=$?
40
41 rm -fr $tmpfiles
42
43 exit $result