tests: some improvements to Gettext tests
authorStefano Lattarini <stefano.lattarini@gmail.com>
Sun, 16 Jun 2013 09:36:55 +0000 (11:36 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Sun, 16 Jun 2013 09:36:55 +0000 (11:36 +0200)
Mostly to bring them more in sync with the ones in Automake-NG.
See also commit v1.12.2-824-g5468d52 of 2012-08-10([ng] tests:
reorganize gettext tests a bit) in Automake-NG.

* t/gettext.sh: Rename ...
* t/gettext-basics.sh: ... like this, enhance a little, and
move checks on requirement of 'config.rpath' out into ...
* t/gettext-config-rpath.sh: ... into this new test, and move
checks about PR/381...
* t/gettext-pr381.sh: ... into this new test.
* t/gettext2.sh: Rename ...
* t/gettext-external-pr338.sh: ... like this, and enhance a
little.
* t/gettext3.sh: Rename ...
* t/gettext-intl-subdir.sh: ... like this, and add trailing
':' command.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
t/gettext-basics.sh [new file with mode: 0644]
t/gettext-config-rpath.sh [new file with mode: 0644]
t/gettext-external-pr338.sh [new file with mode: 0644]
t/gettext-intl-subdir.sh [new file with mode: 0644]
t/gettext-pr381.sh [new file with mode: 0644]
t/gettext.sh [deleted file]
t/gettext2.sh [deleted file]
t/gettext3.sh [deleted file]
t/list-of-tests.mk

diff --git a/t/gettext-basics.sh b/t/gettext-basics.sh
new file mode 100644 (file)
index 0000000..d128a0d
--- /dev/null
@@ -0,0 +1,58 @@
+#! /bin/sh
+# Copyright (C) 2002-2013 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# Check basic gettext support.
+
+required='gettext'
+. test-init.sh
+
+cat >> configure.ac << 'END'
+AM_GNU_GETTEXT
+AC_OUTPUT
+END
+
+: > Makefile.am
+: > config.rpath
+mkdir po intl
+
+$ACLOCAL
+$AUTOCONF
+
+# po/ and intl/ are required.
+
+AUTOMAKE_fails --add-missing
+grep 'AM_GNU_GETTEXT.*SUBDIRS' stderr
+
+echo 'SUBDIRS = po' >Makefile.am
+AUTOMAKE_fails --add-missing
+grep 'AM_GNU_GETTEXT.*intl' stderr
+
+echo 'SUBDIRS = intl' >Makefile.am
+AUTOMAKE_fails --add-missing
+grep 'AM_GNU_GETTEXT.*po' stderr
+
+# Ok.
+
+echo 'SUBDIRS = po intl' >Makefile.am
+$AUTOMAKE --add-missing
+
+# Make sure distcheck runs './configure --with-included-gettext'.
+./configure
+echo distdir: > po/Makefile
+echo distdir: > intl/Makefile
+$MAKE -n distcheck | grep '.*--with-included-gettext'
+
+:
diff --git a/t/gettext-config-rpath.sh b/t/gettext-config-rpath.sh
new file mode 100644 (file)
index 0000000..d99e361
--- /dev/null
@@ -0,0 +1,45 @@
+#! /bin/sh
+# Copyright (C) 2002-2013 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# Check the config.rpath requirement.
+
+required='gettext'
+. test-init.sh
+
+cat >> configure.ac << 'END'
+AM_GNU_GETTEXT
+# config.rpath is required by versions >= 0.14.3.
+AM_GNU_GETTEXT_VERSION([0.14.3])
+AC_OUTPUT
+END
+
+echo 'SUBDIRS = po intl' >Makefile.am
+mkdir po intl
+
+# If aclocal fails here, it may be that gettext is too old to provide
+# AM_GNU_GETTEXT_VERSION.  Similarly, autopoint will fail if it's
+# from an older version.  If gettext is too old to provide autopoint,
+# this will fail as well, so we're safe here.
+if ! $ACLOCAL && autopoint -n; then
+  skip_ "too old gettext installation"
+fi
+
+AUTOMAKE_fails --add-missing
+grep '^configure\.ac:.*required file.*config.rpath' stderr
+: > config.rpath
+$AUTOMAKE
+
+:
diff --git a/t/gettext-external-pr338.sh b/t/gettext-external-pr338.sh
new file mode 100644 (file)
index 0000000..c82af69
--- /dev/null
@@ -0,0 +1,65 @@
+#! /bin/sh
+# Copyright (C) 2002-2013 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# Check gettext 'external' support.
+# PR/338, reported by Charles Wilson.
+
+required='gettext'
+. test-init.sh
+
+cat >>configure.ac <<END
+AM_GNU_GETTEXT([external])
+AC_OUTPUT
+END
+
+: >Makefile.am
+mkdir foo po
+
+$ACLOCAL
+$AUTOCONF
+
+# config.rpath is required.
+: >config.rpath
+
+# po/ is required, but intl/ isn't.
+
+AUTOMAKE_fails --add-missing
+grep 'AM_GNU_GETTEXT.*SUBDIRS' stderr
+
+echo 'SUBDIRS = foo' >Makefile.am
+AUTOMAKE_fails --add-missing
+grep 'AM_GNU_GETTEXT.*po' stderr
+
+# Ok.
+
+echo 'SUBDIRS = po' >Makefile.am
+$AUTOMAKE --add-missing
+
+
+# Don't try running ./configure --with-included-gettext if the
+# user is using AM_GNU_GETTEXT([external]).
+grep 'with-included-gettext' Makefile.in && exit 1
+./configure
+$MAKE -n distcheck | grep 'with-included-gettext' && exit 1
+
+# intl/ isn't wanted with AM_GNU_GETTEXT([external]).
+
+mkdir intl
+echo 'SUBDIRS = po intl' >Makefile.am
+AUTOMAKE_fails --add-missing
+grep 'intl.*AM_GNU_GETTEXT' stderr
+
+:
diff --git a/t/gettext-intl-subdir.sh b/t/gettext-intl-subdir.sh
new file mode 100644 (file)
index 0000000..a33f249
--- /dev/null
@@ -0,0 +1,49 @@
+#! /bin/sh
+# Copyright (C) 2006-2013 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# Check gettext 'AM_GNU_GETTEXT_INTL_SUBDIR' support.
+
+required='gettext'
+. test-init.sh
+
+cat >>configure.ac <<END
+AM_GNU_GETTEXT([external])
+AM_GNU_GETTEXT_INTL_SUBDIR
+AC_OUTPUT
+END
+
+echo 'SUBDIRS = po' >Makefile.am
+mkdir po
+
+# If aclocal fails, assume the gettext macros are too old and do not
+# define AM_GNU_GETTEXT_INTL_SUBDIR.
+$ACLOCAL || skip_ "your gettext macros are probably too old"
+
+# config.rpath is required.
+: >config.rpath
+
+# intl/ is required.
+AUTOMAKE_fails --add-missing
+grep 'AM_GNU_GETTEXT.*intl.*SUBDIRS' stderr
+
+mkdir intl
+AUTOMAKE_fails --add-missing
+grep 'AM_GNU_GETTEXT.*intl.*SUBDIRS' stderr
+
+echo 'SUBDIRS = po intl' > Makefile.am
+$AUTOMAKE --add-missing
+
+:
diff --git a/t/gettext-pr381.sh b/t/gettext-pr381.sh
new file mode 100644 (file)
index 0000000..ebf047d
--- /dev/null
@@ -0,0 +1,45 @@
+#! /bin/sh
+# Copyright (C) 2002-2013 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# Automake gettext support: regression check for PR/381:
+# 'SUBDIRS = po intl' must not be required if 'po/' doesn't exist.
+
+required='gettext'
+. test-init.sh
+
+cat >> configure.ac << 'END'
+AM_GNU_GETTEXT
+AC_OUTPUT
+END
+
+$ACLOCAL
+
+: > config.guess
+: > config.rpath
+: > config.sub
+
+test ! -d po # Sanity check.
+mkdir sub
+echo 'SUBDIRS = sub' > Makefile.am
+$AUTOMAKE
+
+# Still, SUBDIRS must be defined.
+
+: > Makefile.am
+AUTOMAKE_fails
+grep '^configure\.ac:.*AM_GNU_GETTEXT used but SUBDIRS not defined' stderr
+
+:
diff --git a/t/gettext.sh b/t/gettext.sh
deleted file mode 100644 (file)
index 496602d..0000000
+++ /dev/null
@@ -1,87 +0,0 @@
-#! /bin/sh
-# Copyright (C) 2002-2013 Free Software Foundation, Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-# Check gettext support.
-
-required='gettext'
-. test-init.sh
-
-cat >>configure.ac <<END
-AM_GNU_GETTEXT
-AM_GNU_GETTEXT_VERSION([0.14.3])
-AC_OUTPUT
-END
-
-: >Makefile.am
-mkdir po intl
-
-# config.rpath is required by versions >= 0.14.3.  We try to verify
-# this requirement, but only when we find we have a working and recent
-# gettext installation.
-
-# If aclocal fails here, it may be that gettext is too old to
-# provide AM_GNU_GETTEXT_VERSION.
-if $ACLOCAL; then
-
-  # autopoint will fail if it's from an older version.
-  # If gettext is too old to provide autopoint, this will
-  # fail as well, so we're safe here.
-  if autopoint -n; then
-    AUTOMAKE_fails --add-missing
-    grep 'required.*config.rpath' stderr
-  fi
-fi
-
-: >config.rpath
-sed '/AM_GNU_GETTEXT_VERSION/d' configure.ac >configure.tmp
-mv -f configure.tmp configure.ac
-
-$ACLOCAL
-
-# po/ and intl/ are required.
-
-AUTOMAKE_fails --add-missing
-grep 'AM_GNU_GETTEXT.*SUBDIRS' stderr
-
-echo 'SUBDIRS = po' >Makefile.am
-AUTOMAKE_fails --add-missing
-grep 'AM_GNU_GETTEXT.*intl' stderr
-
-echo 'SUBDIRS = intl' >Makefile.am
-AUTOMAKE_fails --add-missing
-grep 'AM_GNU_GETTEXT.*po' stderr
-
-# Ok.
-
-echo 'SUBDIRS = po intl' >Makefile.am
-$AUTOMAKE --add-missing
-
-# Make sure distcheck runs './configure --with-included-gettext'.
-grep 'with-included-gettext' Makefile.in
-
-# 'SUBDIRS = po intl' isn't required if po/ doesn't exist.
-# PR/381.
-
-rmdir po
-mkdir sub
-echo 'SUBDIRS = sub' >Makefile.am
-$AUTOMAKE
-
-# Still, SUBDIRS must be defined.
-
-: >Makefile.am
-AUTOMAKE_fails --add-missing
-grep 'AM_GNU_GETTEXT.*SUBDIRS' stderr
diff --git a/t/gettext2.sh b/t/gettext2.sh
deleted file mode 100644 (file)
index e6a8922..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-#! /bin/sh
-# Copyright (C) 2002-2013 Free Software Foundation, Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-# Check gettext 'external' support.
-# PR/338, reported by Charles Wilson.
-
-required='gettext'
-. test-init.sh
-
-cat >>configure.ac <<END
-AM_GNU_GETTEXT([external])
-AC_OUTPUT
-END
-
-: >Makefile.am
-mkdir foo po
-
-$ACLOCAL
-
-# config.rpath is required.
-: >config.rpath
-
-# po/ is required, but intl/ isn't.
-
-AUTOMAKE_fails --add-missing
-grep 'AM_GNU_GETTEXT.*SUBDIRS' stderr
-
-echo 'SUBDIRS = foo' >Makefile.am
-AUTOMAKE_fails --add-missing
-grep 'AM_GNU_GETTEXT.*po' stderr
-
-# Ok.
-
-echo 'SUBDIRS = po' >Makefile.am
-$AUTOMAKE --add-missing
-
-# Don't try running ./configure --with-included-gettext if the
-# user is using AM_GNU_GETTEXT([external]).
-grep 'with-included-gettext' Makefile.in && exit 1
-
-# intl/ isn't wanted with AM_GNU_GETTEXT([external]).
-
-mkdir intl
-echo 'SUBDIRS = po intl' >Makefile.am
-AUTOMAKE_fails --add-missing
-grep 'intl.*AM_GNU_GETTEXT' stderr
-
-:
diff --git a/t/gettext3.sh b/t/gettext3.sh
deleted file mode 100644 (file)
index 28b26a0..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-#! /bin/sh
-# Copyright (C) 2006-2013 Free Software Foundation, Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-# Check gettext 'AM_GNU_GETTEXT_INTL_SUBDIR' support.
-
-required='gettext'
-. test-init.sh
-
-cat >>configure.ac <<END
-AM_GNU_GETTEXT([external])
-AM_GNU_GETTEXT_INTL_SUBDIR
-AC_OUTPUT
-END
-
-echo 'SUBDIRS = po' >Makefile.am
-mkdir po
-
-# If aclocal fails, assume the gettext macros are too old and do not
-# define AM_GNU_GETTEXT_INTL_SUBDIR.
-$ACLOCAL || skip_ "your gettext macros are probably too old"
-
-# config.rpath is required.
-: >config.rpath
-
-# intl/ is required.
-AUTOMAKE_fails --add-missing
-grep 'AM_GNU_GETTEXT.*intl.*SUBDIRS' stderr
-
-mkdir intl
-AUTOMAKE_fails --add-missing
-grep 'AM_GNU_GETTEXT.*intl.*SUBDIRS' stderr
-
-echo 'SUBDIRS = po intl' > Makefile.am
-$AUTOMAKE --add-missing
index d4e15892dc526a922aa9ebcfdab2470679751673..d4d1fda998b5dd12c77df2b606a616d8347a05e8 100644 (file)
@@ -484,9 +484,11 @@ t/gcj3.sh \
 t/gcj4.sh \
 t/gcj5.sh \
 t/gcj6.sh \
-t/gettext.sh \
-t/gettext2.sh \
-t/gettext3.sh \
+t/gettext-basics.sh \
+t/gettext-config-rpath.sh \
+t/gettext-external-pr338.sh \
+t/gettext-intl-subdir.sh \
+t/gettext-pr381.sh \
 t/gnumake.sh \
 t/gnuwarn.sh \
 t/gnuwarn2.sh \