libtool
[Top][All Lists]
Advanced

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

Re: bindir.at takes forever.


From: Ralf Wildenhues
Subject: Re: bindir.at takes forever.
Date: Tue, 28 Sep 2010 22:36:16 +0200
User-agent: Mutt/1.5.20 (2010-08-04)

Hi Peter,

* Peter Rosin wrote on Tue, Sep 28, 2010 at 02:28:48PM CEST:
> I have been looking at the loops in tests/bindir.at and I see
> this:

bindir.at has several problems.  First, the first
AT_SETUP/.../AT_CLEANUP is completely redundant, it can just be removed.

Then, the actual tests are broken, in that they fail on AIX, and they
don't test quite the right thing practically everywhere, but in
different variations, i.e., they are sometimes too strict and sometimes
too lax.  I didn't get a half-patch finished and tested before 2.4,
and haven't gone back to it since.  I'm not actually sure whether my
changes are too lax.

>   for bindir in \
>       $curdir/usr/lib/gcc/i686-pc-cygwin/4.5.0/bin/ \
[...]
>       $curdir/bin \
>       /tmp/foo/bar ;
>   do
> 
>      ...
> 
>   done
> 
> Is it really necessary to check *all* components with the trailing slash?
> And do we really need to test so many levels?

I would think not.  The overhead comes from the double loop with lots
of iterations (like stresstest).  Let's cut down the list to something
manageable, just be sure the cases documented in the test comments are
still executed.

For reference, I've copied the unfinished patches below.  Feel free to
try them out/fixup the second one; it still needs testing on AIX, too.

I just realize there is an 'exit 77' in an unneeded subshell and another
one outside of AT_CHECK which needs fixing, too.

Thanks,
Ralf

    tests: remove unneeded 'bindir compile check' test.
    
    * tests/bindir.at (bindir compile check): Remove.

diff --git a/tests/bindir.at b/tests/bindir.at
index 40e67cc..ebe1baa 100644
--- a/tests/bindir.at
+++ b/tests/bindir.at
@@ -1,6 +1,6 @@
 # bindir.at -  Test the -bindir option
 #
-#   Copyright (C) 2009 Free Software Foundation, Inc.
+#   Copyright (C) 2009, 2010 Free Software Foundation, Inc.
 #   Written by Dave Korn, 2009
 #
 #   This file is part of GNU Libtool.
@@ -58,25 +58,8 @@
 # statement in libtool.m4sh around where the 'tdlname' variable is set.
 
 ####
-# Verify compiling works, and skip remaining tests if not.
-#
-
-AT_SETUP([bindir compile check])
-
-AT_DATA([simple.c] ,[[
-int main() { return 0;}
-]])
-
-$CC $CPPFLAGS $CFLAGS -o simple simple.c || noskip=false
-rm -f simple
-
-AT_CHECK([$noskip || (exit 77)])
-
-AT_CLEANUP
-
-####
-# Now run the tests themselves.  First a simple test that we can
-# build and run an executable with a couple of tiny libraries.
+# First a simple test that we can build and run an executable with a couple of
+# tiny libraries.
 
 AT_SETUP([bindir basic lib test])
 



    Fix bindir check logic, and relax non-bindir case for AIX.
    
    * tests/bindir.at (bindir install tests): Rewrite checks for
    place of the installed shared library in two separate tests,
    depending on whether -bindir is supposed to have an effect or
    not.  In the positive case, make the test stricter so that we
    reject libraries in $libdir.  In the negative case, do not
    require a major version number in the $libdir file name, for
    AIX without runtimelinking.

diff --git a/tests/bindir.at b/tests/bindir.at
index ebe1baa..5e4c534 100644
--- a/tests/bindir.at
+++ b/tests/bindir.at
@@ -138,14 +138,14 @@ AT_CHECK([$LIBTOOL --mode=link --tag=CC $CC -o 
main$EXEEXT $CPPFLAGS $CFLAGS $LD
 # here, that will be covered by the later tests; we've rpath'd things
 # so that they can all be run in situ.
 
-LT_AT_NOINST_EXEC_CHECK([$LIBTOOL], [], [0], [ignore], [ignore], 
[--mode=execute ./main$EXEEXT])
+LT_AT_NOINST_EXEC_CHECK([./main])
 
 # Ensure libraries can be found on PATH, if we are on one
 # of the affected platforms, before testing the shared version.
 
 func_save_and_prepend_path $curdir/$objdir
 $bindirneeded && {
-  LT_AT_NOINST_EXEC_CHECK([$LIBTOOL], [], [0], [ignore], [ignore], 
[--mode=execute $objdir/main$EXEEXT])
+  LT_AT_NOINST_EXEC_CHECK([$objdir/main])
 }
 
 #  In fact, prepending the PATH as above is superfluous on the windows
@@ -275,7 +275,11 @@ do
   # 'libfoo-0.dll', or 'libfoo.so.0'.  We'll simplify this check by taking 
advantage
   # of the fact that if it's a DLL, it has to go in bindir, so we'll not check 
for
   # both forms in libdir.
-  AT_CHECK([$bindirneeded && { test -f $libdir/../bin/???foo-0.dll || ls 
$libdir/../bin/*foo*0* 2>/dev/null ; } || ls $libdir/*foo*0* 2>/dev/null], [], 
[ignore], [ignore])
+  if $bindirneeded; then
+    AT_CHECK([test -f $libdir/../bin/???foo-0.dll || ls 
$libdir/../bin/*foo*0*], [], [ignore], [ignore])
+  else
+    AT_CHECK([ls $libdir/*foo*], [], [ignore], [ignore])
+  fi
 
   # And that it can be executed.
   extrapath=
@@ -343,7 +347,11 @@ do
     AT_CHECK([$LIBTOOL --mode=install $lt_INSTALL main$EXEEXT 
$curdir/sbin/main$EXEEXT], [], [ignore], [ignore])
 
     # Ensure it went to bindir rather than default dir this time.
-    AT_CHECK([$bindirneeded && { test -f $bindir/???foo-0.dll || ls 
$bindir/*foo*0* 2>/dev/null ; } || ls $libdir/*foo*0* 2>/dev/null], [], 
[ignore], [ignore])
+    if $bindirneeded; then
+      AT_CHECK([test -f $bindir/???foo-0.dll || ls $bindir/*foo*0*], [], 
[ignore], [ignore])
+    else
+      AT_CHECK([ls $libdir/*foo*], [], [ignore], [ignore])
+    fi
 
     # And that it can be executed.
     extrapath=





reply via email to

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