automake-patches
[Top][All Lists]
Advanced

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

[PATCH] {master} depcomp tests: avoid redundant runs for libtool tests


From: Stefano Lattarini
Subject: [PATCH] {master} depcomp tests: avoid redundant runs for libtool tests
Date: Wed, 8 Feb 2012 22:16:12 +0100

When running libtool-oriented tests, our 'depcomp.sh' script used
to run the same checks thrice: once after having run configure
with the '--disable-shared' option, once after having run it with
the '--enable-shared' option, and once by allowing configure to
automatically select which kind of library (or libraries) to build.

This was done to offer extra coverage for the less-common depmodes
that run through slightly different code paths in the libtool and
non-libtool cases (see for example commit 'Release-1-10-24-ge89ec38'
of 28-03-2007, "* lib/depcomp (aix): Rewrite depmode in the spirit
of the tru64 one").

But this coverage come at the price of slowing down considerably the
depcomp libtool-oriented tests, since for each of them the tested
source tree was configured and built *twelve* times (rather than
"just" four as it is for the non-libtool case).

So, to strike a balance between coverage and speed, we now run the
libtool-oriented tests with the three different configuration modes
only for those

* tests/depcomp.sh: Adjust to only run the threefold libtool tests
when the depmode is one of 'sgi', 'aix', 'hp2', 'tru64' or 'msvc7'.
---
 tests/depcomp.sh |   42 +++++++++++++++++++++++++++++++++---------
 1 files changed, 33 insertions(+), 9 deletions(-)

-*-*-*-

This is the first of the promised optimizations for the depcomp
tests.  I will push in 48 hours if there is no objection.

Regards,
  Stefano

-*-*-*-

diff --git a/tests/depcomp.sh b/tests/depcomp.sh
index 67db770..24ecc0b 100755
--- a/tests/depcomp.sh
+++ b/tests/depcomp.sh
@@ -148,7 +148,6 @@ mkdir build-aux sub src src/sub2
 
 case $depcomp_with_libtool in
   yes)
-    plan_ 84
     po=Plo objext=lo a=la
     normalized_target=libfoo_la
     LIBPRIMARY=LTLIBRARIES LINKADD=LIBADD
@@ -166,7 +165,6 @@ case $depcomp_with_libtool in
     }
     ;;
   no)
-    plan_ 28
     po=Po objext='$(OBJEXT)' a=a
     normalized_target=foo
     LIBPRIMARY=LIBRARIES LINKADD=LDADD
@@ -260,6 +258,38 @@ $ACLOCAL && $AUTOCONF && $AUTOMAKE -a \
 test -f build-aux/depcomp \
   || fatal_ "depcomp script not installed"
 
+# To offer extra coverage for the less-common depmodes that use slightly
+# different code paths in the libtool and non-libtool cases, we want to
+# run the libtool-oriented tests thrice: once after having run configure
+# with the '--disable-shared' option, once after having run it with the
+# '--enable-shared' options, and once by leaving it to configure to
+# automatically select which kind of library (or libraries) to build.
+#
+# But doing such three-fold checks unconditionally for all the depmodes
+# would slow down the already too slow libtool tests even more (up to a
+# 150-200% factor), for only a very little gain in coverage.  So we only
+# tests few selected depmodes this way.
+#
+# Keep this in sync with the contents of 'lib/depcomp'.  We could
+# probably extract this information automatically, but that looks
+# like overkill ATM.
+
+case $depcomp_with_libtool,$depmode in
+  yes,sgi|yes,aix|yes,hp2|yes,tru64|yes,msvc7)
+    plan_ 84
+    do_all_tests ()
+    {
+      do_test default
+      do_test noshared --disable-shared
+      do_test nostatic --disable-static
+    }
+    ;;
+  *)
+    plan_ 28
+    do_all_tests() { do_test; }
+    ;;
+esac
+
 case $depmode in
   auto)
     displayed_depmode='..*' # At least one character long.
@@ -378,13 +408,7 @@ do_test ()
 }
 
 for vpath in no simple long absolute; do
-  if test $depcomp_with_libtool = no; then
-    do_test
-  else
-    do_test default
-    do_test noshared --disable-shared
-    do_test nostatic --disable-static
-  fi
+  do_all_tests
 done
 
 :
-- 
1.7.7.3




reply via email to

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