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