libtool-patches
[Top][All Lists]
Advanced

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

Re: export_symbols_cmds erroneously expanded


From: Ralf Wildenhues
Subject: Re: export_symbols_cmds erroneously expanded
Date: Thu, 14 Dec 2006 20:48:29 +0100
User-agent: Mutt/1.5.13 (2006-08-11)

Let's move this from libtool to -patches; archive diggers, see
<http://lists.gnu.org/archive/html/libtool/2006-12/msg00017.html>.

* Charles Wilson wrote on Tue, Dec 12, 2006 at 01:24:45AM CET:
> 
> Anyway, testing will have to wait a few hours.

That's fine.  Let's get the CVS HEAD testsuite up to gear,
in a way so that it can easily test libtool 1.5.22 as well.
Inside this one new test, part of the whole testsuite is invoked
again with a modified 'libtool' script, to expose issues with
short command lines.

The patch below is merely the first step, and it does not fix
any resulting bugs yet.  It probably doesn't expose the original
reported bug yet unless you have an S: drive on w32.  More testing
to come.

OK to apply?

Cheers,
Ralf

2006-12-14  Ralf Wildenhues  <address@hidden>

        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.

Index: HACKING
===================================================================
RCS file: /cvsroot/libtool/libtool/HACKING,v
retrieving revision 1.31
diff -u -r1.31 HACKING
--- HACKING     26 Oct 2006 20:39:04 -0000      1.31
+++ HACKING     14 Dec 2006 19:13:01 -0000
@@ -57,13 +57,14 @@
   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
Index: Makefile.am
===================================================================
RCS file: /cvsroot/libtool/libtool/Makefile.am,v
retrieving revision 1.202
diff -u -r1.202 Makefile.am
--- Makefile.am 24 Oct 2006 20:30:05 -0000      1.202
+++ Makefile.am 14 Dec 2006 19:13:02 -0000
@@ -418,7 +418,8 @@
                  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
 
Index: tests/stresstest.at
===================================================================
RCS file: /cvsroot/libtool/libtool/tests/stresstest.at,v
retrieving revision 1.10
diff -u -r1.10 stresstest.at
--- tests/stresstest.at 4 Sep 2006 17:27:26 -0000       1.10
+++ tests/stresstest.at 14 Dec 2006 19:13:05 -0000
@@ -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 @@
   *)           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: tests/testsuite.at
===================================================================
RCS file: /cvsroot/libtool/libtool/tests/testsuite.at,v
retrieving revision 1.45
diff -u -r1.45 testsuite.at
--- tests/testsuite.at  4 Sep 2006 17:27:26 -0000       1.45
+++ tests/testsuite.at  14 Dec 2006 19:13:05 -0000
@@ -139,6 +139,22 @@
 ])
 
 
+# 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],
--- /dev/null   2006-12-12 01:34:08.640403500 +0100
+++ tests/cmdline_wrap.at       2006-12-14 20:12:00.000000000 +0100
@@ -0,0 +1,37 @@
+# Hand crafted tests for GNU Libtool.                         -*- Autotest -*-
+# Copyright 2006 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




reply via email to

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