automake-patches
[Top][All Lists]
Advanced

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

Re: [PATCH 5/6] Fix tests missing.test and missing2.test.


From: Stefano Lattarini
Subject: Re: [PATCH 5/6] Fix tests missing.test and missing2.test.
Date: Sun, 22 Aug 2010 13:47:19 +0200
User-agent: KMail/1.13.3 (Linux/2.6.30-2-686; KDE/4.4.4; i686; ; )

Patch amended to keep up with amendments in [PATCH 2/6].

Regards,
  Stefano
From 290e734ee3c91320f9326aaae75e817c59083919 Mon Sep 17 00:00:00 2001
From: Stefano Lattarini <address@hidden>
Date: Wed, 18 Aug 2010 22:36:05 +0200
Subject: [PATCH 5/6] Fix tests missing.test and missing2.test.

* tests/missing.test, tests/missing2.test: Do not override
autoconf in calls to ./configure.  Removed obsolted comments.
Add checks to verify that the `missing' script is called anyway,
whenever it's expected to.  Move checks involving version number
suffixes...
* tests/missing7.test: ... to this new tests, and extend them
to check for `gnu'/`g' prefixes too, and to check many more
wrapped tools.
* tests/Makefile.am (TESTS, XFAIL_TESTS): Updated.
---
 ChangeLog           |   11 ++++++++
 tests/Makefile.am   |    3 +-
 tests/Makefile.in   |    3 +-
 tests/missing.test  |   29 ++++----------------
 tests/missing2.test |   31 +++++-----------------
 tests/missing7.test |   72 +++++++++++++++++++++++++++++++++++++++++++++++++++
 6 files changed, 98 insertions(+), 51 deletions(-)
 create mode 100755 tests/missing7.test

diff --git a/ChangeLog b/ChangeLog
index e1bf5aa..f7e0053 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,16 @@
 2010-08-21  Stefano Lattarini  <address@hidden>
 
+       Fix tests missing.test and missing2.test.
+       * tests/missing.test, tests/missing2.test: Do not override
+       autoconf in calls to ./configure.  Removed obsolted comments.
+       Add checks to verify that the `missing' script is called anyway,
+       whenever it's expected to.  Move checks involving version number
+       suffixes...
+       * tests/missing7.test: ... to this new tests, and extend them
+       to check for `gnu'/`g' prefixes too, and to check many more
+       wrapped tools.
+       * tests/Makefile.am (TESTS, XFAIL_TESTS): Updated.
+
        Improve support for non-default autotools in rebuild rules.
        * lib/am/configure.am: (%MAKEFILE-IN%): When appropriate, export
        AUTOCONF and AUTOM4TE to proper values when calling $(AUTOMAKE).
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 414d8a1..9e3b932 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -21,8 +21,6 @@ all.test                                      \
 auxdir2.test                                   \
 cond17.test                                    \
 gcj6.test                                      \
-missing.test                                   \
-missing2.test                                  \
 txinfo5.test
 
 include $(srcdir)/parallel-tests.am
@@ -482,6 +480,7 @@ missing3.test \
 missing4.test \
 missing5.test \
 missing6.test \
+missing7.test \
 mkinstall.test \
 mkinst2.test \
 mkinst3.test \
diff --git a/tests/Makefile.in b/tests/Makefile.in
index 74b02f5..2d9de5a 100644
--- a/tests/Makefile.in
+++ b/tests/Makefile.in
@@ -252,8 +252,6 @@ all.test                                    \
 auxdir2.test                                   \
 cond17.test                                    \
 gcj6.test                                      \
-missing.test                                   \
-missing2.test                                  \
 txinfo5.test
 
 parallel_tests = \
@@ -724,6 +722,7 @@ missing3.test \
 missing4.test \
 missing5.test \
 missing6.test \
+missing7.test \
 mkinstall.test \
 mkinst2.test \
 mkinst3.test \
diff --git a/tests/missing.test b/tests/missing.test
index 861d7bf..95dc406 100755
--- a/tests/missing.test
+++ b/tests/missing.test
@@ -32,18 +32,6 @@ $ACLOCAL
 $AUTOCONF
 $AUTOMAKE --add-missing
 
-# Avoid problems when $AUTOCONF has an absolute value at configure time.
-# Such problems already occurred in practice.
-# They are due the way the `missing' script matches the program it has
-# to wrap:
-#   case $program in 
-#     aclocal*) ...;;
-#     autconf*) ...;;
-#     ...
-#   esac
-# This does not account for absolute paths.  Which makes perfect sense,
-# given the way missing is used in practice, but would break a hack like:
-#  ./configure AUTOCONF="./missing --run /bas/path/to/autoconf"
 mkdir bin
 cat > bin/autoconf <<END
 #!/bin/sh
@@ -62,26 +50,21 @@ PATH=`pwd`/bin:$PATH; export PATH
 # (We cannot export this new value, because it would be used by Automake
 # when tracing, and missing is no good for this.)
 unset AUTOCONF
-MYAUTOCONF="./missing --run autoconf"
 
-./configure AUTOCONF="$MYAUTOCONF"
+./configure
 
 $MAKE
 $sleep
 # Hopefully the install version of Autoconf cannot compete with this one...
 echo 'AC_PREREQ([9999])' >> aclocal.m4
-$MAKE distdir
-
-# Try version number suffixes.
-./configure AUTOCONF="${MYAUTOCONF}6789"
-$MAKE
-$sleep
-touch aclocal.m4
-$MAKE distdir
+$MAKE distdir 2>stderr || { cat stderr >&2; Exit 1; }
+cat stderr >&2
+# Check that `missing' was really run.
+grep '^WARNING.*too old' stderr
 
 # Run again, but without missing to wrap aclocal/automake, to ensure that
 # timestamps were updated.
-./configure AUTOCONF="$MYAUTOCONF" AUTOMAKE="$AUTOMAKE" ACLOCAL="$ACLOCAL"
+./configure AUTOMAKE="$AUTOMAKE" ACLOCAL="$ACLOCAL"
 $MAKE
 
 # Make sure $MAKE fails when timestamps aren't updated and missing is not used.
diff --git a/tests/missing2.test b/tests/missing2.test
index 9ffd1f2..9731c48 100755
--- a/tests/missing2.test
+++ b/tests/missing2.test
@@ -16,7 +16,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 # Test missing with version mismatches.
-# Keep this in sync with sister test `missing.test'.
+# Keep this in sync with sister tests `missing.test'.
 
 . ./defs || Exit 1
 
@@ -34,18 +34,6 @@ $ACLOCAL
 $AUTOCONF
 $AUTOMAKE --add-missing
 
-# Avoid problems when $AUTOCONF has an absolute value at configure time.
-# Such problems already occurred in practice.
-# They are due the way the `missing' script matches the program it has
-# to wrap:
-#   case $program in 
-#     aclocal*) ...;;
-#     autconf*) ...;;
-#     ...
-#   esac
-# This does not account for absolute paths.  Which makes perfect sense,
-# given the way missing is used in practice, but would break a hack like:
-#  ./configure AUTOCONF="./missing --run /bas/path/to/autoconf"
 mkdir bin
 cat > bin/autoconf <<END
 #!/bin/sh
@@ -64,26 +52,21 @@ PATH=`pwd`/bin:$PATH; export PATH
 # (We cannot export this new value, because it would be used by Automake
 # when tracing, and missing is no good for this.)
 unset AUTOCONF
-MYAUTOCONF="./missing --run autoconf"
 
-./configure AUTOCONF="$MYAUTOCONF"
+./configure
 
 $MAKE
 $sleep
 # Hopefully the install version of Autoconf cannot compete with this one...
 echo 'AC_PREREQ([9999])' > v.m4
-$MAKE distdir
-
-# Try version number suffixes.
-./configure AUTOCONF="${MYAUTOCONF}6789"
-$MAKE
-$sleep
-touch v.m4
-$MAKE distdir
+$MAKE distdir 2>stderr || { cat stderr >&2; Exit 1; }
+cat stderr >&2
+# Check that `missing' was really run.
+grep '^WARNING.*too old' stderr
 
 # Run again, but without missing to wrap aclocal/automake, to ensure that
 # timestamps were updated.
-./configure AUTOCONF="$MYAUTOCONF" AUTOMAKE="$AUTOMAKE" ACLOCAL="$ACLOCAL"
+./configure AUTOMAKE="$AUTOMAKE" ACLOCAL="$ACLOCAL"
 $MAKE
 
 # Make sure $MAKE fails when timestamps aren't updated and missing is not used.
diff --git a/tests/missing7.test b/tests/missing7.test
new file mode 100755
index 0000000..880636e
--- /dev/null
+++ b/tests/missing7.test
@@ -0,0 +1,72 @@
+#! /bin/sh
+# Copyright (C) 2010 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/>.
+
+# Test missing with version mismatches, with version number suffixes.
+# and `gnu'/`g' prefixes.
+
+. ./defs || Exit 1
+
+set -e
+
+cat >fail.sh <<END
+#! /bin/sh
+exit 1
+END
+chmod a+x fail.sh
+
+# Keep this in sync when you update the `missing' script.
+tools='aclocal autoconf autoheader automake autom4te
+       bison yacc flex lex help2man makeinfo tar'
+
+PATH=.:$PATH; export PATH
+
+for tool in $tools; do
+  for prefix in '' 'g' 'gnu' 'gnu-'; do
+    for version in '' 1 -2 12.34 -67.8.9; do
+      what=${prefix}${tool}${version}
+      case $what in
+        *.*) qtool=`echo "$tool" | sed 's/\./\\./g'`;;
+          *) qtool=$tool;;
+      esac
+      mkdir $what.dir
+      cd $what.dir
+      cp ../fail.sh $what
+      args=''
+      ok_to_fail=false
+      err_regex="^WARNING:.*$qtool.*missing on your system"
+      case $tool in
+        autom4te|makeinfo)
+          args='-o foo'
+          : > foo
+          ;;
+        tar)
+          err_regex="^WARNING:.*can't.*run.*tar.*with.*given arguments"
+          ok_to_fail=:
+          ;;
+      esac
+      if ../missing --run $what $args 2>stderr; then
+        cat stderr >&2
+      else
+        cat stderr >&2
+        $ok_to_fail || Exit 1
+      fi
+      grep "$err_regex" stderr
+      cd ..
+    done
+  done
+done
+
+:
-- 
1.7.1


reply via email to

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