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