]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Elementary test for the xgettext Scheme backend.
authorBruno Haible <bruno@clisp.org>
Tue, 18 Jan 2005 11:43:47 +0000 (11:43 +0000)
committerBruno Haible <bruno@clisp.org>
Tue, 23 Jun 2009 10:12:05 +0000 (12:12 +0200)
gettext-tools/tests/xgettext-scheme-1 [new file with mode: 0755]

diff --git a/gettext-tools/tests/xgettext-scheme-1 b/gettext-tools/tests/xgettext-scheme-1
new file mode 100755 (executable)
index 0000000..4bb2fe7
--- /dev/null
@@ -0,0 +1,44 @@
+#!/bin/sh
+
+# Test Scheme support: --add-comments option.
+
+tmpfiles=""
+trap 'rm -fr $tmpfiles' 1 2 3 15
+
+tmpfiles="$tmpfiles xg-sc-1.scm"
+cat <<EOF > xg-sc-1.scm
+; This comment will not be extracted.
+(display (_ "help"))
+;;  TRANSLATORS: This is an extracted comment.
+(display (_ "me"))
+#!  Not extracted either.
+!#
+(display (_ "The Fabulous Four"))
+EOF
+
+tmpfiles="$tmpfiles xg-sc-1.po"
+: ${XGETTEXT=xgettext}
+${XGETTEXT} -k_ --omit-header --no-location --add-comments=TRANSLATORS: \
+  xg-sc-1.scm -d xg-sc-1
+test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+
+tmpfiles="$tmpfiles xg-sc-1.ok"
+cat <<EOF > xg-sc-1.ok
+msgid "help"
+msgstr ""
+
+#. TRANSLATORS: This is an extracted comment.
+msgid "me"
+msgstr ""
+
+msgid "The Fabulous Four"
+msgstr ""
+EOF
+
+: ${DIFF=diff}
+${DIFF} xg-sc-1.ok xg-sc-1.po
+result=$?
+
+rm -fr $tmpfiles
+
+exit $result