automake-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[automake-commit] branch master updated: automake: if TEST_EXTENSIONS is


From: Karl Berry
Subject: [automake-commit] branch master updated: automake: if TEST_EXTENSIONS is set to empty, don't look inside it.
Date: Fri, 28 Aug 2020 19:30:25 -0400

This is an automated email from the git hooks/post-receive script.

karl pushed a commit to branch master
in repository automake.

View the commit online:
https://git.savannah.gnu.org/gitweb/?p=automake.git;a=commitdiff;h=3bbcf6832ef28598ac322633d39462c1293d709b

The following commit(s) were added to refs/heads/master by this push:
     new 3bbcf68  automake: if TEST_EXTENSIONS is set to empty, don't look 
inside it.
3bbcf68 is described below

commit 3bbcf6832ef28598ac322633d39462c1293d709b
Author: Karl Berry <karl@freefriends.org>
AuthorDate: Fri Aug 28 16:26:54 2020 -0700

    automake: if TEST_EXTENSIONS is set to empty, don't look inside it.
    
    This change fixes https://bugs.gnu.org/42635.
    
    * bin/automake.in (handle_tests): do not use $test_suffixes[0]
    if it does not exist.
    * t/test-extensions-empty.sh: new test.
    * t/list-of-tests.mk (handwritten_TESTS): add it.
---
 bin/automake.in            |  2 +-
 t/list-of-tests.mk         |  1 +
 t/test-extensions-empty.sh | 52 ++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 54 insertions(+), 1 deletion(-)

diff --git a/bin/automake.in b/bin/automake.in
index 67f6f3a..c120787 100644
--- a/bin/automake.in
+++ b/bin/automake.in
@@ -4954,7 +4954,7 @@ sub handle_tests ()
          if ($handle_exeext)
            {
              unshift (@test_suffixes, $at_exeext)
-               unless $test_suffixes[0] eq $at_exeext;
+               unless @test_suffixes && $test_suffixes[0] eq $at_exeext;
            }
          unshift (@test_suffixes, '');
 
diff --git a/t/list-of-tests.mk b/t/list-of-tests.mk
index 1608313..3bd1211 100644
--- a/t/list-of-tests.mk
+++ b/t/list-of-tests.mk
@@ -832,6 +832,7 @@ t/test-driver-strip-vpath.sh \
 t/test-driver-trs-suffix-registered.sh \
 t/test-driver-fail.sh \
 t/test-driver-is-distributed.sh \
+t/test-extensions-empty.sh \
 t/test-harness-vpath-rewrite.sh \
 t/test-log.sh \
 t/test-logs-repeated.sh \
diff --git a/t/test-extensions-empty.sh b/t/test-extensions-empty.sh
new file mode 100755
index 0000000..5f466e0
--- /dev/null
+++ b/t/test-extensions-empty.sh
@@ -0,0 +1,52 @@
+#! /bin/sh
+# Copyright (C) 2020 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 <https://www.gnu.org/licenses/>.
+
+# Empty assignment to TEST_EXTENSIONS should not provoke Perl warning.
+# https://bugs.gnu.org/42635
+
+. test-init.sh
+
+cat > configure.ac << 'END'
+AC_INIT([foo],[1.0])
+AM_INIT_AUTOMAKE([foreign])
+AC_PROG_CC  dnl comment this line to make the warning disappear
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+TEST_EXTENSIONS =
+LOG_COMPILER = echo
+TESTS = foo.test
+END
+
+touch foo.test
+
+autoreconf -fi >reconf.out 2>&1 
+grep 'uninitialized value' reconf.out && exit 1
+
+# What we're trying to avoid:
+# ...
+# Use of uninitialized value in string eq at /usr/bin/automake line 4953.
+# ...
+# nl -ba `command -v automake` | sed -n '4951,4955p'
+#  4951            if ($handle_exeext)
+#  4952              {
+#  4953                unshift (@test_suffixes, $at_exeext)
+#  4954                  unless $test_suffixes[0] eq $at_exeext;
+#  4955              }
+
+:



reply via email to

[Prev in Thread] Current Thread [Next in Thread]