summaryrefslogtreecommitdiff
path: root/tests/gettext-macros.test
diff options
context:
space:
mode:
authorStefano Lattarini <stefano.lattarini@gmail.com>2011-12-23 10:15:29 +0100
committerStefano Lattarini <stefano.lattarini@gmail.com>2011-12-23 10:25:58 +0100
commit23acc63042bd7ad7ce81f6b0d6a4437a0712301d (patch)
tree4c79d0b28e886a8c7202ef813a20ab844cb1115f /tests/gettext-macros.test
parentc62c2c4ff232215bc37b64c635ecaadb01265828 (diff)
parent3749d843083e552232579a85288e7dfee126ad91 (diff)
downloadautomake-23acc63042bd7ad7ce81f6b0d6a4437a0712301d.tar.gz
Merge branch 'master' into testsuite-work
* tests/gettext-macros.test: In the generated `get.sh' file, use `skip_all_', not `skip_'. * tests/libtool-macros.test: Likewise. * tests/list-of-tests.mk: Update.
Diffstat (limited to 'tests/gettext-macros.test')
-rwxr-xr-xtests/gettext-macros.test78
1 files changed, 78 insertions, 0 deletions
diff --git a/tests/gettext-macros.test b/tests/gettext-macros.test
new file mode 100755
index 000000000..ad7e13a21
--- /dev/null
+++ b/tests/gettext-macros.test
@@ -0,0 +1,78 @@
+#! /bin/sh
+# Copyright (C) 2011 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/>.
+
+# Try to find the gettext `.m4' files and make them easily accessed
+# to the test cases requiring them.
+# See also automake bug#9807.
+
+. ./defs || Exit 1
+
+echo "# Automatically generated by $me." > get.sh
+echo : >> get.sh
+
+# The `gettextize' and `autopoint' scripts will look into Makefile.am.
+echo ACLOCAL_AMFLAGS = -I m4 > Makefile.am
+
+# Required by autopoint.
+echo 'AM_GNU_GETTEXT' > configure.in
+# Likewise; and older version specified here *won't* work!
+echo 'AM_GNU_GETTEXT_VERSION([0.10.35])' >> configure.in
+
+# Prefer autopoint to gettextize, since the more modern versions of the
+# latter might unconditionally require user interaction to complete;
+# yes, this means confirmation from /dev/tty (!) -- see:
+# <http://lists.gnu.org/archive/html/bug-gettext/2011-12/msg00000.html>
+# Since this "forced interaction" behaviour of gettextize wasn't present
+# before the introduction of autopoint, we should be able to safely
+# fall back to calling gettextize non-interactively if autopoint is not
+# present.
+if autopoint --version; then
+ am_gettextize_command=autopoint
+else
+ am_gettextize_command=gettextize
+fi
+
+if $am_gettextize_command --force && test -f m4/gettext.m4; then
+ echo "ACLOCAL_PATH='`pwd`/m4':\$ACLOCAL_PATH" >> get.sh
+ echo "export ACLOCAL_PATH" >> get.sh
+else
+ # Older versions of gettext might not have a gettextize program
+ # available, but this doesn't mean the user hasn't made the gettext
+ # macros available, e.g., by properly setting ACLOCAL_PATH.
+ rm -rf m4
+ mkdir m4
+ # See below for an explanation about the use the of `-Wno-syntax'.
+ if $ACLOCAL -Wno-syntax -I m4 --install && test -f m4/gettext.m4; then
+ : # Gettext macros already accessible by default.
+ else
+ echo "skip_all_ \"couldn't find or get gettext macros\"" >> get.sh
+ fi
+fi
+
+. ./get.sh
+
+$ACLOCAL --force -I m4 || cat >> get.sh <<'END'
+# We need to use `-Wno-syntax', since we do not want our test suite
+# to fail merely because some third-party `.m4' file is underquoted.
+ACLOCAL="$ACLOCAL -Wno-syntax"
+END
+
+# The file gettextize or autopoint might have copied in the `m4'
+# subdirectory of the test directory are going to be needed by
+# other tests, so we must not remove the test directory.
+keep_testdirs=yes
+
+: