summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2007-06-25 09:19:06 +0000
committerBruno Haible <bruno@clisp.org>2009-06-23 12:14:57 +0200
commit4178dd4a281d3fa1f7dd1365baf5501fd99cbd99 (patch)
tree00fa638936266d5ae0bf76a96a2241ef044b40cb
parent4a984d135fd517a242bab1de1dd183c7687733af (diff)
downloadexternal_gettext-4178dd4a281d3fa1f7dd1365baf5501fd99cbd99.zip
external_gettext-4178dd4a281d3fa1f7dd1365baf5501fd99cbd99.tar.gz
external_gettext-4178dd4a281d3fa1f7dd1365baf5501fd99cbd99.tar.bz2
Tests for extracted comments.
-rw-r--r--gettext-tools/tests/ChangeLog19
-rw-r--r--gettext-tools/tests/Makefile.am27
-rwxr-xr-xgettext-tools/tests/xgettext-awk-241
-rwxr-xr-xgettext-tools/tests/xgettext-c-1642
-rwxr-xr-xgettext-tools/tests/xgettext-csharp-642
-rwxr-xr-xgettext-tools/tests/xgettext-elisp-243
-rwxr-xr-xgettext-tools/tests/xgettext-java-642
-rwxr-xr-xgettext-tools/tests/xgettext-librep-242
-rwxr-xr-xgettext-tools/tests/xgettext-lisp-242
-rwxr-xr-xgettext-tools/tests/xgettext-perl-744
-rwxr-xr-xgettext-tools/tests/xgettext-php-344
-rwxr-xr-xgettext-tools/tests/xgettext-python-442
-rwxr-xr-xgettext-tools/tests/xgettext-scheme-343
-rwxr-xr-xgettext-tools/tests/xgettext-sh-635
-rwxr-xr-xgettext-tools/tests/xgettext-smalltalk-244
-rwxr-xr-xgettext-tools/tests/xgettext-tcl-336
-rwxr-xr-xgettext-tools/tests/xgettext-ycp-442
17 files changed, 658 insertions, 12 deletions
diff --git a/gettext-tools/tests/ChangeLog b/gettext-tools/tests/ChangeLog
index 36d045b..be9b023 100644
--- a/gettext-tools/tests/ChangeLog
+++ b/gettext-tools/tests/ChangeLog
@@ -1,3 +1,22 @@
+2007-06-25 Bruno Haible <bruno@clisp.org>
+
+ * xgettext-awk-2: New file.
+ * xgettext-c-16: New file.
+ * xgettext-csharp-6: New file.
+ * xgettext-elisp-2: New file.
+ * xgettext-java-6: New file.
+ * xgettext-librep-2: New file.
+ * xgettext-lisp-2: New file.
+ * xgettext-perl-7: New file.
+ * xgettext-php-3: New file.
+ * xgettext-python-4: New file.
+ * xgettext-scheme-3: New file.
+ * xgettext-sh-6: New file.
+ * xgettext-smalltalk-2: New file.
+ * xgettext-tcl-3: New file.
+ * xgettext-ycp-4: New file.
+ * Makefile.am (TESTS): Add them.
+
2007-05-14 Bruno Haible <bruno@clisp.org>
Avoid test suite failures on mingw.
diff --git a/gettext-tools/tests/Makefile.am b/gettext-tools/tests/Makefile.am
index 745a88a..6a4c5fb 100644
--- a/gettext-tools/tests/Makefile.am
+++ b/gettext-tools/tests/Makefile.am
@@ -68,31 +68,34 @@ TESTS = gettext-1 gettext-2 gettext-3 gettext-4 gettext-5 gettext-6 gettext-7 \
recode-sr-latin-1 recode-sr-latin-2 \
xgettext-1 xgettext-2 xgettext-3 xgettext-4 xgettext-5 xgettext-6 \
xgettext-7 xgettext-8 xgettext-9 \
- xgettext-awk-1 \
+ xgettext-awk-1 xgettext-awk-2 \
xgettext-c-1 xgettext-c-2 xgettext-c-3 xgettext-c-4 xgettext-c-5 \
xgettext-c-6 xgettext-c-7 xgettext-c-8 xgettext-c-9 xgettext-c-10 \
xgettext-c-11 xgettext-c-12 xgettext-c-13 xgettext-c-14 xgettext-c-15 \
+ xgettext-c-16 \
xgettext-csharp-1 xgettext-csharp-2 xgettext-csharp-3 \
- xgettext-csharp-4 xgettext-csharp-5 \
- xgettext-elisp-1 \
+ xgettext-csharp-4 xgettext-csharp-5 xgettext-csharp-6 \
+ xgettext-elisp-1 xgettext-elisp-2 \
xgettext-glade-1 xgettext-glade-2 xgettext-glade-3 \
xgettext-java-1 xgettext-java-2 xgettext-java-3 xgettext-java-4 \
- xgettext-java-5 \
- xgettext-librep-1 \
- xgettext-lisp-1 \
+ xgettext-java-5 xgettext-java-6 \
+ xgettext-librep-1 xgettext-librep-2 \
+ xgettext-lisp-1 xgettext-lisp-2 \
xgettext-objc-1 xgettext-objc-2 \
xgettext-perl-1 xgettext-perl-2 xgettext-perl-3 xgettext-perl-4 \
- xgettext-perl-5 xgettext-perl-6 \
- xgettext-php-1 xgettext-php-2 \
+ xgettext-perl-5 xgettext-perl-6 xgettext-perl-7 \
+ xgettext-php-1 xgettext-php-2 xgettext-php-3 \
xgettext-po-1 \
xgettext-properties-1 \
xgettext-python-1 xgettext-python-2 xgettext-python-3 \
- xgettext-scheme-1 xgettext-scheme-2 \
+ xgettext-python-4 \
+ xgettext-scheme-1 xgettext-scheme-2 xgettext-scheme-3 \
xgettext-sh-1 xgettext-sh-2 xgettext-sh-3 xgettext-sh-4 xgettext-sh-5 \
- xgettext-smalltalk-1 \
+ xgettext-sh-6 \
+ xgettext-smalltalk-1 xgettext-smalltalk-2 \
xgettext-stringtable-1 \
- xgettext-tcl-1 xgettext-tcl-2 \
- xgettext-ycp-1 xgettext-ycp-2 xgettext-ycp-3 \
+ xgettext-tcl-1 xgettext-tcl-2 xgettext-tcl-3 \
+ xgettext-ycp-1 xgettext-ycp-2 xgettext-ycp-3 xgettext-ycp-4 \
format-awk-1 format-awk-2 \
format-boost-1 format-boost-2 \
format-c-1 format-c-2 format-c-3 format-c-4 format-c-5 \
diff --git a/gettext-tools/tests/xgettext-awk-2 b/gettext-tools/tests/xgettext-awk-2
new file mode 100755
index 0000000..eb2ad1c
--- /dev/null
+++ b/gettext-tools/tests/xgettext-awk-2
@@ -0,0 +1,41 @@
+#!/bin/sh
+
+# Test awk support: --add-comments option.
+
+tmpfiles=""
+trap 'rm -fr $tmpfiles' 1 2 3 15
+
+tmpfiles="$tmpfiles xg-a-2.awk"
+cat <<\EOF > xg-a-2.awk
+# a
+string = # b
+# c
+_"hello world" # d
+# e
+;
+EOF
+
+tmpfiles="$tmpfiles xg-a-2.tmp.po xg-a-2.po"
+: ${XGETTEXT=xgettext}
+${XGETTEXT} --add-comments --omit-header --no-location --keyword=_ \
+ -d xg-a-2.tmp xg-a-2.awk
+test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+tr -d '\r' < xg-a-2.tmp.po > xg-a-2.po
+test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+
+tmpfiles="$tmpfiles xg-a-2.ok"
+cat <<EOF > xg-a-2.ok
+#. a
+#. b
+#. c
+msgid "hello world"
+msgstr ""
+EOF
+
+: ${DIFF=diff}
+${DIFF} xg-a-2.ok xg-a-2.po
+result=$?
+
+rm -fr $tmpfiles
+
+exit $result
diff --git a/gettext-tools/tests/xgettext-c-16 b/gettext-tools/tests/xgettext-c-16
new file mode 100755
index 0000000..e103e19
--- /dev/null
+++ b/gettext-tools/tests/xgettext-c-16
@@ -0,0 +1,42 @@
+#!/bin/sh
+
+# Test C support: --add-comments option.
+
+tmpfiles=""
+trap 'rm -fr $tmpfiles' 1 2 3 15
+
+tmpfiles="$tmpfiles xg-c-16.c"
+cat <<\EOF > xg-c-16.c
+/* a */
+/* b */ char *string = /* c */
+/* d */
+/* e */ _( /* f */ "hello " /* g */ "world" /* h */ );
+EOF
+
+tmpfiles="$tmpfiles xg-c-16.tmp.po xg-c-16.po"
+: ${XGETTEXT=xgettext}
+${XGETTEXT} --add-comments --omit-header --no-location --keyword=_ \
+ -d xg-c-16.tmp xg-c-16.c
+test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+tr -d '\r' < xg-c-16.tmp.po > xg-c-16.po
+test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+
+tmpfiles="$tmpfiles xg-c-16.ok"
+cat <<EOF > xg-c-16.ok
+#. a
+#. b
+#. c
+#. d
+#. e
+#. f
+msgid "hello world"
+msgstr ""
+EOF
+
+: ${DIFF=diff}
+${DIFF} xg-c-16.ok xg-c-16.po
+result=$?
+
+rm -fr $tmpfiles
+
+exit $result
diff --git a/gettext-tools/tests/xgettext-csharp-6 b/gettext-tools/tests/xgettext-csharp-6
new file mode 100755
index 0000000..fa700ea
--- /dev/null
+++ b/gettext-tools/tests/xgettext-csharp-6
@@ -0,0 +1,42 @@
+#!/bin/sh
+
+# Test C# support: --add-comments option.
+
+tmpfiles=""
+trap 'rm -fr $tmpfiles' 1 2 3 15
+
+tmpfiles="$tmpfiles xg-cs-6.cs"
+cat <<\EOF > xg-cs-6.cs
+/* a */
+/* b */ string s = /* c */
+/* d */
+/* e */ _( /* f */ "hello " /* g */ + /* h */ "world" /* i */ );
+EOF
+
+tmpfiles="$tmpfiles xg-cs-6.tmp.po xg-cs-6.po"
+: ${XGETTEXT=xgettext}
+${XGETTEXT} --add-comments --omit-header --no-location --keyword=_ \
+ -d xg-cs-6.tmp xg-cs-6.cs
+test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+tr -d '\r' < xg-cs-6.tmp.po > xg-cs-6.po
+test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+
+tmpfiles="$tmpfiles xg-cs-6.ok"
+cat <<EOF > xg-cs-6.ok
+#. a
+#. b
+#. c
+#. d
+#. e
+#. f
+msgid "hello world"
+msgstr ""
+EOF
+
+: ${DIFF=diff}
+${DIFF} xg-cs-6.ok xg-cs-6.po
+result=$?
+
+rm -fr $tmpfiles
+
+exit $result
diff --git a/gettext-tools/tests/xgettext-elisp-2 b/gettext-tools/tests/xgettext-elisp-2
new file mode 100755
index 0000000..8d4e99c
--- /dev/null
+++ b/gettext-tools/tests/xgettext-elisp-2
@@ -0,0 +1,43 @@
+#!/bin/sh
+
+# Test EmacsLisp support: --add-comments option.
+
+tmpfiles=""
+trap 'rm -fr $tmpfiles' 1 2 3 15
+
+tmpfiles="$tmpfiles xg-el-2.el"
+cat <<\EOF > xg-el-2.el
+; a
+(setq string ; b
+; c
+(_ ; d
+"hello world" ; e
+; f
+))
+EOF
+
+tmpfiles="$tmpfiles xg-el-2.tmp.po xg-el-2.po"
+: ${XGETTEXT=xgettext}
+${XGETTEXT} --add-comments --omit-header --no-location --keyword=_ \
+ -d xg-el-2.tmp xg-el-2.el
+test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+tr -d '\r' < xg-el-2.tmp.po > xg-el-2.po
+test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+
+tmpfiles="$tmpfiles xg-el-2.ok"
+cat <<EOF > xg-el-2.ok
+#. a
+#. b
+#. c
+#. d
+msgid "hello world"
+msgstr ""
+EOF
+
+: ${DIFF=diff}
+${DIFF} xg-el-2.ok xg-el-2.po
+result=$?
+
+rm -fr $tmpfiles
+
+exit $result
diff --git a/gettext-tools/tests/xgettext-java-6 b/gettext-tools/tests/xgettext-java-6
new file mode 100755
index 0000000..32850cb
--- /dev/null
+++ b/gettext-tools/tests/xgettext-java-6
@@ -0,0 +1,42 @@
+#!/bin/sh
+
+# Test Java support: --add-comments option.
+
+tmpfiles=""
+trap 'rm -fr $tmpfiles' 1 2 3 15
+
+tmpfiles="$tmpfiles xg-j-6.java"
+cat <<\EOF > xg-j-6.java
+/* a */
+/* b */ String string = /* c */
+/* d */
+/* e */ _( /* f */ "hello " /* g */ + /* h */ "world" /* i */ );
+EOF
+
+tmpfiles="$tmpfiles xg-j-6.tmp.po xg-j-6.po"
+: ${XGETTEXT=xgettext}
+${XGETTEXT} --add-comments --omit-header --no-location --keyword=_ \
+ -d xg-j-6.tmp xg-j-6.java
+test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+tr -d '\r' < xg-j-6.tmp.po > xg-j-6.po
+test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+
+tmpfiles="$tmpfiles xg-j-6.ok"
+cat <<EOF > xg-j-6.ok
+#. a
+#. b
+#. c
+#. d
+#. e
+#. f
+msgid "hello world"
+msgstr ""
+EOF
+
+: ${DIFF=diff}
+${DIFF} xg-j-6.ok xg-j-6.po
+result=$?
+
+rm -fr $tmpfiles
+
+exit $result
diff --git a/gettext-tools/tests/xgettext-librep-2 b/gettext-tools/tests/xgettext-librep-2
new file mode 100755
index 0000000..13c62f7
--- /dev/null
+++ b/gettext-tools/tests/xgettext-librep-2
@@ -0,0 +1,42 @@
+#!/bin/sh
+
+# Test librep support: --add-comments option.
+
+tmpfiles=""
+trap 'rm -fr $tmpfiles' 1 2 3 15
+
+tmpfiles="$tmpfiles xg-lr-2.jl"
+cat <<\EOF > xg-lr-2.jl
+#| a |#
+#| b |# (setq string #| c |#
+#| d |#
+#| e |# (_ #| f |# "hello world" #| g |# ))
+EOF
+
+tmpfiles="$tmpfiles xg-lr-2.tmp.po xg-lr-2.po"
+: ${XGETTEXT=xgettext}
+${XGETTEXT} --add-comments --omit-header --no-location --keyword=_ \
+ -d xg-lr-2.tmp xg-lr-2.jl
+test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+tr -d '\r' < xg-lr-2.tmp.po > xg-lr-2.po
+test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+
+tmpfiles="$tmpfiles xg-lr-2.ok"
+cat <<EOF > xg-lr-2.ok
+#. a
+#. b
+#. c
+#. d
+#. e
+#. f
+msgid "hello world"
+msgstr ""
+EOF
+
+: ${DIFF=diff}
+${DIFF} xg-lr-2.ok xg-lr-2.po
+result=$?
+
+rm -fr $tmpfiles
+
+exit $result
diff --git a/gettext-tools/tests/xgettext-lisp-2 b/gettext-tools/tests/xgettext-lisp-2
new file mode 100755
index 0000000..45218c9
--- /dev/null
+++ b/gettext-tools/tests/xgettext-lisp-2
@@ -0,0 +1,42 @@
+#!/bin/sh
+
+# Test Lisp support: --add-comments option.
+
+tmpfiles=""
+trap 'rm -fr $tmpfiles' 1 2 3 15
+
+tmpfiles="$tmpfiles xg-ls-2.lisp"
+cat <<\EOF > xg-ls-2.lisp
+#| a |#
+#| b |# (setq string #| c |#
+#| d |#
+#| e |# (_ #| f |# "hello world" #| g |# ))
+EOF
+
+tmpfiles="$tmpfiles xg-ls-2.tmp.po xg-ls-2.po"
+: ${XGETTEXT=xgettext}
+${XGETTEXT} --add-comments --omit-header --no-location --keyword=_ \
+ -d xg-ls-2.tmp xg-ls-2.lisp
+test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+tr -d '\r' < xg-ls-2.tmp.po > xg-ls-2.po
+test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+
+tmpfiles="$tmpfiles xg-ls-2.ok"
+cat <<EOF > xg-ls-2.ok
+#. a
+#. b
+#. c
+#. d
+#. e
+#. f
+msgid "hello world"
+msgstr ""
+EOF
+
+: ${DIFF=diff}
+${DIFF} xg-ls-2.ok xg-ls-2.po
+result=$?
+
+rm -fr $tmpfiles
+
+exit $result
diff --git a/gettext-tools/tests/xgettext-perl-7 b/gettext-tools/tests/xgettext-perl-7
new file mode 100755
index 0000000..17eedfe
--- /dev/null
+++ b/gettext-tools/tests/xgettext-perl-7
@@ -0,0 +1,44 @@
+#!/bin/sh
+
+# Test Perl support: --add-comments option.
+
+tmpfiles=""
+trap 'rm -fr $tmpfiles' 1 2 3 15
+
+tmpfiles="$tmpfiles xg-pl-7.pl"
+cat <<\EOF > xg-pl-7.pl
+# a
+string = # b
+# c
+_( # d
+"hello " # e
+. # f
+"world" # g
+);
+EOF
+
+tmpfiles="$tmpfiles xg-pl-7.tmp.po xg-pl-7.po"
+: ${XGETTEXT=xgettext}
+${XGETTEXT} --add-comments --omit-header --no-location --keyword=_ \
+ -d xg-pl-7.tmp xg-pl-7.pl
+test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+tr -d '\r' < xg-pl-7.tmp.po > xg-pl-7.po
+test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+
+tmpfiles="$tmpfiles xg-pl-7.ok"
+cat <<EOF > xg-pl-7.ok
+#. a
+#. b
+#. c
+#. d
+msgid "hello world"
+msgstr ""
+EOF
+
+: ${DIFF=diff}
+${DIFF} xg-pl-7.ok xg-pl-7.po
+result=$?
+
+rm -fr $tmpfiles
+
+exit $result
diff --git a/gettext-tools/tests/xgettext-php-3 b/gettext-tools/tests/xgettext-php-3
new file mode 100755
index 0000000..fb5fdb0
--- /dev/null
+++ b/gettext-tools/tests/xgettext-php-3
@@ -0,0 +1,44 @@
+#!/bin/sh
+
+# Test PHP support: --add-comments option.
+
+tmpfiles=""
+trap 'rm -fr $tmpfiles' 1 2 3 15
+
+tmpfiles="$tmpfiles xg-ph-3.php"
+cat <<\EOF > xg-ph-3.php
+<?
+/* a */
+/* b */ string = /* c */
+/* d */
+/* e */ _( /* f */ "hello world" /* g */ );
+?>
+EOF
+
+tmpfiles="$tmpfiles xg-ph-3.tmp.po xg-ph-3.po"
+: ${XGETTEXT=xgettext}
+${XGETTEXT} --add-comments --omit-header --no-location --keyword=_ \
+ -d xg-ph-3.tmp xg-ph-3.php
+test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+tr -d '\r' < xg-ph-3.tmp.po > xg-ph-3.po
+test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+
+tmpfiles="$tmpfiles xg-ph-3.ok"
+cat <<EOF > xg-ph-3.ok
+#. a
+#. b
+#. c
+#. d
+#. e
+#. f
+msgid "hello world"
+msgstr ""
+EOF
+
+: ${DIFF=diff}
+${DIFF} xg-ph-3.ok xg-ph-3.po
+result=$?
+
+rm -fr $tmpfiles
+
+exit $result
diff --git a/gettext-tools/tests/xgettext-python-4 b/gettext-tools/tests/xgettext-python-4
new file mode 100755
index 0000000..eb662d4
--- /dev/null
+++ b/gettext-tools/tests/xgettext-python-4
@@ -0,0 +1,42 @@
+#!/bin/sh
+
+# Test Python support: --add-comments option.
+
+tmpfiles=""
+trap 'rm -fr $tmpfiles' 1 2 3 15
+
+tmpfiles="$tmpfiles xg-py-3.py"
+cat <<\EOF > xg-py-3.py
+# a
+string = # b
+# c
+_( # d
+"hello " "world" # e
+);
+EOF
+
+tmpfiles="$tmpfiles xg-py-3.tmp.po xg-py-3.po"
+: ${XGETTEXT=xgettext}
+${XGETTEXT} --add-comments --omit-header --no-location --keyword=_ \
+ -d xg-py-3.tmp xg-py-3.py
+test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+tr -d '\r' < xg-py-3.tmp.po > xg-py-3.po
+test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+
+tmpfiles="$tmpfiles xg-py-3.ok"
+cat <<EOF > xg-py-3.ok
+#. a
+#. b
+#. c
+#. d
+msgid "hello world"
+msgstr ""
+EOF
+
+: ${DIFF=diff}
+${DIFF} xg-py-3.ok xg-py-3.po
+result=$?
+
+rm -fr $tmpfiles
+
+exit $result
diff --git a/gettext-tools/tests/xgettext-scheme-3 b/gettext-tools/tests/xgettext-scheme-3
new file mode 100755
index 0000000..e4df4cb
--- /dev/null
+++ b/gettext-tools/tests/xgettext-scheme-3
@@ -0,0 +1,43 @@
+#!/bin/sh
+
+# Test Scheme support: --add-comments option.
+
+tmpfiles=""
+trap 'rm -fr $tmpfiles' 1 2 3 15
+
+tmpfiles="$tmpfiles xg-sc-3.scm"
+cat <<\EOF > xg-sc-3.scm
+; a
+(setq string ; b
+; c
+(_ ; d
+"hello world" ; e
+; f
+))
+EOF
+
+tmpfiles="$tmpfiles xg-sc-3.tmp.po xg-sc-3.po"
+: ${XGETTEXT=xgettext}
+${XGETTEXT} --add-comments --omit-header --no-location --keyword=_ \
+ -d xg-sc-3.tmp xg-sc-3.scm
+test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+tr -d '\r' < xg-sc-3.tmp.po > xg-sc-3.po
+test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+
+tmpfiles="$tmpfiles xg-sc-3.ok"
+cat <<EOF > xg-sc-3.ok
+#. a
+#. b
+#. c
+#. d
+msgid "hello world"
+msgstr ""
+EOF
+
+: ${DIFF=diff}
+${DIFF} xg-sc-3.ok xg-sc-3.po
+result=$?
+
+rm -fr $tmpfiles
+
+exit $result
diff --git a/gettext-tools/tests/xgettext-sh-6 b/gettext-tools/tests/xgettext-sh-6
new file mode 100755
index 0000000..2f8e975
--- /dev/null
+++ b/gettext-tools/tests/xgettext-sh-6
@@ -0,0 +1,35 @@
+#!/bin/sh
+
+# Test Shell support: --add-comments option.
+
+tmpfiles=""
+trap 'rm -fr $tmpfiles' 1 2 3 15
+
+tmpfiles="$tmpfiles xg-sh-6.sh"
+cat <<\EOF > xg-sh-6.sh
+# a
+_ "hello world" # b
+EOF
+
+tmpfiles="$tmpfiles xg-sh-6.tmp.po xg-sh-6.po"
+: ${XGETTEXT=xgettext}
+${XGETTEXT} --add-comments --omit-header --no-location --keyword=_ \
+ -d xg-sh-6.tmp xg-sh-6.sh
+test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+tr -d '\r' < xg-sh-6.tmp.po > xg-sh-6.po
+test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+
+tmpfiles="$tmpfiles xg-sh-6.ok"
+cat <<EOF > xg-sh-6.ok
+#. a
+msgid "hello world"
+msgstr ""
+EOF
+
+: ${DIFF=diff}
+${DIFF} xg-sh-6.ok xg-sh-6.po
+result=$?
+
+rm -fr $tmpfiles
+
+exit $result
diff --git a/gettext-tools/tests/xgettext-smalltalk-2 b/gettext-tools/tests/xgettext-smalltalk-2
new file mode 100755
index 0000000..0e65670
--- /dev/null
+++ b/gettext-tools/tests/xgettext-smalltalk-2
@@ -0,0 +1,44 @@
+#!/bin/sh
+
+# Test Smalltalk support: --add-comments option.
+
+tmpfiles=""
+trap 'rm -fr $tmpfiles' 1 2 3 15
+
+tmpfiles="$tmpfiles xg-st-2.st"
+cat <<\EOF > xg-st-2.st
+"a"
+"b" Transcript showCr:
+"c" (
+"d" NLS
+"e" ?
+"f" 'hello world' "h" ).
+EOF
+
+tmpfiles="$tmpfiles xg-st-2.tmp.po xg-st-2.po"
+: ${XGETTEXT=xgettext}
+${XGETTEXT} --add-comments --omit-header --no-location \
+ -d xg-st-2.tmp xg-st-2.st
+test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+tr -d '\r' < xg-st-2.tmp.po > xg-st-2.po
+test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+
+tmpfiles="$tmpfiles xg-st-2.ok"
+cat <<EOF > xg-st-2.ok
+#. a
+#. b
+#. c
+#. d
+#. e
+#. f
+msgid "hello world"
+msgstr ""
+EOF
+
+: ${DIFF=diff}
+${DIFF} xg-st-2.ok xg-st-2.po
+result=$?
+
+rm -fr $tmpfiles
+
+exit $result
diff --git a/gettext-tools/tests/xgettext-tcl-3 b/gettext-tools/tests/xgettext-tcl-3
new file mode 100755
index 0000000..4cddca6
--- /dev/null
+++ b/gettext-tools/tests/xgettext-tcl-3
@@ -0,0 +1,36 @@
+#!/bin/sh
+
+# Test Tcl support: --add-comments option.
+
+tmpfiles=""
+trap 'rm -fr $tmpfiles' 1 2 3 15
+
+tmpfiles="$tmpfiles xg-t-3.tcl"
+cat <<\EOF > xg-t-3.tcl
+# a
+set string [_ "hello world" # b
+] # c
+EOF
+
+tmpfiles="$tmpfiles xg-t-3.tmp.po xg-t-3.po"
+: ${XGETTEXT=xgettext}
+${XGETTEXT} --add-comments --omit-header --no-location --keyword=_ \
+ -d xg-t-3.tmp xg-t-3.tcl
+test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+tr -d '\r' < xg-t-3.tmp.po > xg-t-3.po
+test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+
+tmpfiles="$tmpfiles xg-t-3.ok"
+cat <<EOF > xg-t-3.ok
+#. a
+msgid "hello world"
+msgstr ""
+EOF
+
+: ${DIFF=diff}
+${DIFF} xg-t-3.ok xg-t-3.po
+result=$?
+
+rm -fr $tmpfiles
+
+exit $result
diff --git a/gettext-tools/tests/xgettext-ycp-4 b/gettext-tools/tests/xgettext-ycp-4
new file mode 100755
index 0000000..b6faa9c
--- /dev/null
+++ b/gettext-tools/tests/xgettext-ycp-4
@@ -0,0 +1,42 @@
+#!/bin/sh
+
+# Test YCP support: --add-comments option.
+
+tmpfiles=""
+trap 'rm -fr $tmpfiles' 1 2 3 15
+
+tmpfiles="$tmpfiles xg-y-4.ycp"
+cat <<\EOF > xg-y-4.ycp
+/* a */
+/* b */ string = /* c */
+/* d */
+/* e */ _( /* f */ "hello " /* g */ "world" /* h */ );
+EOF
+
+tmpfiles="$tmpfiles xg-y-4.tmp.po xg-y-4.po"
+: ${XGETTEXT=xgettext}
+${XGETTEXT} --add-comments --omit-header --no-location --keyword=_ \
+ -d xg-y-4.tmp xg-y-4.ycp
+test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+tr -d '\r' < xg-y-4.tmp.po > xg-y-4.po
+test $? = 0 || { rm -fr $tmpfiles; exit 1; }
+
+tmpfiles="$tmpfiles xg-y-4.ok"
+cat <<EOF > xg-y-4.ok
+#. a
+#. b
+#. c
+#. d
+#. e
+#. f
+msgid "hello world"
+msgstr ""
+EOF
+
+: ${DIFF=diff}
+${DIFF} xg-y-4.ok xg-y-4.po
+result=$?
+
+rm -fr $tmpfiles
+
+exit $result