]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
Introduce a new test keyword `recursive' for tests that create a
authorRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Sun, 28 Jan 2007 12:43:37 +0000 (12:43 +0000)
committerRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Sun, 28 Jan 2007 12:43:37 +0000 (12:43 +0000)
modified `libtool' script and run the suite on this script.  All
tests with the keyword `libtool' are (by definition) suitable to
be used here.

* tests/cmdline_wrap.at: New test.
* Makefile.am: Adjust.
* tests/testsuite.at (LT_ESCAPE): New macro: clone of Autoconf
AS_ESCAPE that does not escape `$'.
(LT_AT_CHECK): New macro: print a command-to-be-run while
expanding parameters but nothing else.
* tests/stresstest.at: Use LT_AT_CHECK.  Create some files to
expose erroneous globbing errors with `-export-symbols-regex',
similar to those reported by Charles Wilson.  Use `eval' and
adjusted quoting so the expansion doesn't already happen in the
testsuite commands.
* HACKING: Update.

ChangeLog
HACKING
Makefile.am
tests/cmdline_wrap.at [new file with mode: 0644]
tests/stresstest.at
tests/testsuite.at

index 6ec9021fea81b27c767c98c48543e11fc2854170..97d668a56e49020f75b57ef6b53ac595b9e03d93 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,23 @@
+2007-01-28  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       Introduce a new test keyword `recursive' for tests that create a
+       modified `libtool' script and run the suite on this script.  All
+       tests with the keyword `libtool' are (by definition) suitable to
+       be used here.
+
+       * tests/cmdline_wrap.at: New test.
+       * Makefile.am: Adjust.
+       * tests/testsuite.at (LT_ESCAPE): New macro: clone of Autoconf
+       AS_ESCAPE that does not escape `$'.
+       (LT_AT_CHECK): New macro: print a command-to-be-run while
+       expanding parameters but nothing else.
+       * tests/stresstest.at: Use LT_AT_CHECK.  Create some files to
+       expose erroneous globbing errors with `-export-symbols-regex',
+       similar to those reported by Charles Wilson.  Use `eval' and
+       adjusted quoting so the expansion doesn't already happen in the
+       testsuite commands.
+       * HACKING: Update.
+
 2007-01-27  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
        Assume C89 for included headers, and throughout the testsuite.
diff --git a/HACKING b/HACKING
index 9fc90707aa53623d4bf4b98868594022a41b0951..e9a6e3c4525960687b90bedc13180f4b3abd7408 100644 (file)
--- a/HACKING
+++ b/HACKING
@@ -57,13 +57,14 @@ and is not part of a release distribution.
   liberally, on as many platforms as you can.  Use as many compilers and
   linkers you can.
 
-* The new Autotest testsuite uses several keywords, to denote that the
-  test
-    - needs Autoconf                   autoconf
-    - needs Automake                   automake
-    - exercises the `libtool' script   libtool
-    - exercises the `libtoolize' script        libtoolize
-    - exercises a language other than C        CXX F77 FC GCJ
+* The new Autotest testsuite uses keywords to denote test features:
+    autoconf           needs Autoconf
+    automake           needs Automake
+    libtool            exercises the `libtool' script
+    libtoolize         exercises the `libtoolize' script
+    recursive          runs the suite recursively, with a modified
+                       `libtool' script and with `-k libtool'
+    CXX F77 FC GCJ     exercises a language other than C
 
 
 4. Naming
@@ -613,7 +614,7 @@ output of any failed test groups, and the output from `./libtool --config.'
 
 
 -- 
-Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc.
+Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
 
 The canonical source of this file is maintained with the
 GNU Libtool package.  Report bugs to bug-libtool@gnu.org.
index 9c2d5d3dfb86bba802642383602aea2d7fd356fc..e8056f7a89402145636f390c04c66d5e3cb143fd 100644 (file)
@@ -418,7 +418,8 @@ TESTSUITE_AT        = tests/testsuite.at \
                  tests/template.at \
                  tests/early-libtool.at \
                  tests/deplibs-ident.at \
-                 tests/stresstest.at
+                 tests/stresstest.at \
+                 tests/cmdline_wrap.at
 
 EXTRA_DIST     += $(srcdir)/$(TESTSUITE) $(TESTSUITE_AT) $(srcdir)/tests/package.m4
 
diff --git a/tests/cmdline_wrap.at b/tests/cmdline_wrap.at
new file mode 100644 (file)
index 0000000..f7fb115
--- /dev/null
@@ -0,0 +1,37 @@
+# Hand crafted tests for GNU Libtool.                         -*- Autotest -*-
+# Copyright 2007 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, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+# 02110-1301, USA.
+
+# cmdline_wrap.test - make sure libtool works when it needs to wrap
+# command lines.  We simulate this by setting max_cmd_len very low.
+
+AT_SETUP([Run tests with low max_cmd_len])
+AT_KEYWORDS([recursive])
+AT_CAPTURE_FILE([testsuite.log])
+
+sed 's,max_cmd_len=.*,max_cmd_len="24",' < $LIBTOOL > libtool
+chmod +x libtool
+LIBTOOL=`pwd`/libtool
+export LIBTOOL
+# run the suite in a subdirectory, otherwise the two suites will compete
+# for the output file `testsuite.log'.
+mkdir tests
+cd tests
+AT_CHECK([$CONFIG_SHELL $abs_srcdir/testsuite -k libtool $INNER_TESTSUITEFLAGS],
+        [], [ignore], [ignore])
+
+AT_CLEANUP
index 19a1cb9022ff6578989f88b6c5ac0eb6b59d9244..587f9532822b3740c337267d34db6cf31714e140 100644 (file)
@@ -1,5 +1,5 @@
 # Hand crafted tests for GNU Libtool.                         -*- Autotest -*-
-# Copyright 2005 Free Software Foundation, Inc.
+# Copyright 2005, 2006, 2007 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
@@ -22,8 +22,8 @@
 # Note: This test is experimental, and might be too strict for some systems.
 
 AT_BANNER([Libtool stress test.])
-AT_KEYWORDS([libtool])
 AT_SETUP([Link option thorough search test])
+AT_KEYWORDS([libtool])
 eval `$LIBTOOL --config | $EGREP '^(CC|objdir|allow_undefined_flag)='`
 
 mkdir sub sub2 sub3 2>/dev/null
@@ -205,25 +205,28 @@ case $allow_undefined_flag in
   *)           undef_opts='"" -no-undefined' ;;
 esac
 
+# expose problems with the regex:
+touch vfoo v.bar
+
 for l1 in $undef_opts
 do
-  for l2 in '' '-export-symbols-regex v.*' '-export-symbols asyms'
+  for l2 in '' '-export-symbols-regex "v.*"' '-export-symbols asyms'
   do
     for l3 in '' '-rpath /nonexistent'
     do
       linkargs="$l1 $l2 $l3"
       for rel in '' ./ `pwd`/
       do
-       AT_CHECK([$LIBTOOL --mode=link $CC $CFLAGS $LDFLAGS -o "$rel"sub2/liba.la "$rel"sub/a.lo $linkargs],
+       LT_AT_CHECK([eval '$LIBTOOL --mode=link $CC $CFLAGS $LDFLAGS -o "$rel"sub2/liba.la "$rel"sub/a.lo' $linkargs],
                 [0],[ignore],[ignore])
        for st in '' '-static'
        do
-         AT_CHECK([$LIBTOOL --mode=link $CC $CFLAGS $LDFLAGS $st -o "$rel"main "$rel"main.lo "$rel"sub2/liba.la],
+         LT_AT_CHECK([$LIBTOOL --mode=link $CC $CFLAGS $LDFLAGS $st -o "$rel"main "$rel"main.lo "$rel"sub2/liba.la],
                   [0],[ignore],[ignore])
          LT_AT_EXEC_CHECK([./main],[0])
          for l10 in '' '-export-symbols dlselfsyms'
          do
-           AT_CHECK([$LIBTOOL --mode=link $CC $CFLAGS $LDFLAGS $st -o "$rel"sub3/dlself "$rel"sub3/dlself.lo "$rel"sub2/liba.la sub/b.lo -dlopen self $l10],
+           LT_AT_CHECK([$LIBTOOL --mode=link $CC $CFLAGS $LDFLAGS $st -o "$rel"sub3/dlself "$rel"sub3/dlself.lo "$rel"sub2/liba.la sub/b.lo -dlopen self $l10],
                     [0],[ignore],[ignore])
            LT_AT_EXEC_CHECK([./sub3/dlself],[0])
          done
index da39d3171782a2ae3beb4720e5d8471f92a1e5c7..0b52f3ed5cb359d4264b733a94fc7a5bc357fda6 100644 (file)
@@ -1,7 +1,7 @@
 # Process with autom4te to create an -*- Autotest -*- test suite.
 
 # Test suite for GNU Libtool.
-# Copyright 2004, 2005, 2006 Free Software Foundation, Inc.
+# Copyright 2004, 2005, 2006, 2007 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
@@ -139,6 +139,22 @@ m4_if([$7], [ignore], [], [LT_AT_MAKE([$7])])
 ])
 
 
+# LT_ESCAPE(ARG)
+# --------------
+# Escape command for output (expand only parameters).
+m4_define([LT_ESCAPE],
+[m4_bpatsubst([$1],
+            m4_dquote(m4_default([$2], [\"`])),
+            [\\\&])])
+
+
+# LT_AT_CHECK
+# -----------
+# Wrapper around AT_CHECK that outputs the command first, with
+# parameters expanded.
+m4_define([LT_AT_CHECK],
+[echo "LT_ESCAPE([$1])"; AT_CHECK($@)])
+
 # LT_AT_EXEC_CHECK(EXECUTABLE, [STATUS = 0], [STDOUT], [STDERR])
 # --------------------------------------------------------------
 m4_define([LT_AT_EXEC_CHECK],