* Ralf Wildenhues wrote on Wed, Nov 09, 2005 at 12:18:01AM CET: > OK to apply this bunch of testsuite trivia (as one patch maybe)?
> - I needed an AT_TESTED emulation that does not fail. This one XFAILs > for the autotools used, rather than SKIPs -- should I change that? Left this alone for now. *snip* > There are probably more bits coming later.. OK, here are a few more bits. I took the liberty to install it all, on the grounds that I'll pick up any fallout as well. Changes to the previous version: - deleted the bits already picked up by Gary's patch - had to loosen the grep for automake-too-old error a bit for 1.6. - inherited_flags test does not make sense on static-only systems. - went ahead and unified the setting of `autoconf' and `automake' AT_KEYWORDS in the LT_AT_ACLOCAL, LT_AT_AUTOCONF etc. macros. (Yes, aclocal gets the keyword automake; it's the package you need). - LT_AT_AUTORECONF needs all other tools installed. - a bunch of workarounds for user-overridden CONFIG_SHELL, `make' that does not set $(SHELL), or $(MAKE). Cheers, Ralf Testsuite portability update round. * tests/inherited_flags: skip when shared libs are disabled. * tests/deplibs-ident.at [ aix ]: No unexpected failure here. * tests/libtoolize.at: Fix for distcheck (readonly sources). * tests/nonrecursive.at, tests/recursive.at, tests/subproject.at (foo.c): Actually export a symbol, for AIX. * tests/old-m4-iface.at: Use AC_LIBTOOL_DLOPEN, for AIX. * tests/nonrecursive.at: Set foo_la_SOURCES, for automake-1.7. * tests/subproject.at: Require automake-1.9, we use indirect subdirs. * tests/am-subdir.at: Move AT_KEYWORDS settings.. * tests/testsuite.at: ..here, in respective macros. (LT_AT_AUTOMAKE): Skip if we detect failure due to old version. (PREPARE_TESTS): Set autotool variables to `no' if not present. (LT_AT_ACLOCAL, LT_AT_AUTOCONF, LT_AT_AUTOMAKE) (LT_AT_AUTOHEADER, LT_AT_AUTORECONF): Use to XFAIL tests. Reported by Tim Rice <[EMAIL PROTECTED]>. (LT_AT_MAKE): Do not use `make -e'. (_LTDL_PROJECT_FILES): Adjust sub-make call. Work around `make' which does not set `MAKE' or `SHELL'. Fix for user-set `CONFIG_SHELL'. Reported by Charles Wilson <[EMAIL PROTECTED]>. Index: tests/am-subdir.at =================================================================== RCS file: /cvsroot/libtool/libtool/tests/am-subdir.at,v retrieving revision 1.9 diff -u -r1.9 am-subdir.at --- tests/am-subdir.at 10 Nov 2005 15:31:32 -0000 1.9 +++ tests/am-subdir.at 14 Nov 2005 22:09:28 -0000 @@ -25,11 +25,10 @@ ## ----------- ## AT_SETUP([C subdir-objects]) -AT_KEYWORDS([autoconf automake]) AT_DATA([[configure.ac]], [[AC_INIT([subdir-demo], ]]AT_PACKAGE_VERSION[[, ]]AT_PACKAGE_BUGREPORT[[) -AM_INIT_AUTOMAKE([subdir-objects foreign]) +AM_INIT_AUTOMAKE([subdir-objects foreign 1.5]) LT_INIT([win32-dll]) AC_PROG_CC AM_PROG_CC_C_O @@ -86,12 +85,11 @@ ## ------------- ## AT_SETUP([C++ subdir-objects]) -AT_KEYWORDS([autoconf automake]) LT_AT_TAG([CXX]) AT_DATA([[configure.ac]], [[AC_INIT([subdir-demo], ]]AT_PACKAGE_VERSION[[, ]]AT_PACKAGE_BUGREPORT[[) -AM_INIT_AUTOMAKE([subdir-objects foreign]) +AM_INIT_AUTOMAKE([subdir-objects foreign 1.5]) AC_PROG_CC AM_PROG_CC_C_O AC_PROG_CXX Index: tests/deplibs-ident.at =================================================================== RCS file: /cvsroot/libtool/libtool/tests/deplibs-ident.at,v retrieving revision 1.1 diff -u -r1.1 deplibs-ident.at --- tests/deplibs-ident.at 30 Sep 2005 16:00:23 -0000 1.1 +++ tests/deplibs-ident.at 14 Nov 2005 22:09:28 -0000 @@ -58,7 +58,8 @@ AT_CHECK([$LIBTOOL --mode=link $CC $CFLAGS $LDFLAGS -o b b.$OBJEXT ../liba1.la ../liba2.la ../liba3.la ../../c/libcee.la -rpath /nowhere], [0],[stdout],[ignore]) AT_CHECK([$EGREP 'cee.*cee' stdout], 1, [ignore], [ignore]) - AT_XFAIL_IF(:) dnl This is currently broken in libtool + AT_XFAIL_IF([case $host_os in aix*) false;; *):;; esac]) + dnl This is currently broken in libtool ) AT_CLEANUP Index: tests/inherited_flags.at =================================================================== RCS file: /cvsroot/libtool/libtool/tests/inherited_flags.at,v retrieving revision 1.6 diff -u -r1.6 inherited_flags.at --- tests/inherited_flags.at 26 Aug 2005 13:48:27 -0000 1.6 +++ tests/inherited_flags.at 14 Nov 2005 22:09:28 -0000 @@ -61,6 +61,7 @@ # 'llt_[[ui]]nlikely_existing_lib.*llt_[[ui]]nlikely_existing_lib' # here. This fails on win32/MSVC because the generated command lines have a # different syntax. So drop the first `l'. +AT_CHECK([${LIBTOOL} --features | grep 'disable shared libraries' && (exit 77)], [1], [ignore]) AT_CHECK([grep 'lt_[[ui]]nlikely_existing_lib.*lt_[[ui]]nlikely_existing_lib' stdout], [0],[ignore],[ignore]) AT_CHECK([${LIBTOOL} --mode=link --tag=CC $CC $CFLAGS $LDFLAGS -o main main.lo -no-undefined -rpath /usr/local/lib ./libfoo.la ./libbar.la], Index: tests/libtoolize.at =================================================================== RCS file: /cvsroot/libtool/libtool/tests/libtoolize.at,v retrieving revision 1.6 diff -u -r1.6 libtoolize.at --- tests/libtoolize.at 10 Nov 2005 17:51:37 -0000 1.6 +++ tests/libtoolize.at 14 Nov 2005 22:09:28 -0000 @@ -38,6 +38,8 @@ test -d m4 || { rm -f m4 && mkdir m4; } +rm -f m4/libtool.m4 m4/ltoptions.m4 config/ltmain.sh + # This file should be upgraded. AT_DATA([m4/libtool.m4], [[ # serial 25 LT_INIT @@ -425,6 +427,8 @@ ## ------------------------------------------- ## LT_AT_ACLOCAL([-I m4]) + +rm -f m4/libtool.m4 m4/ltoptions.m4 # This file should be upgraded. AT_DATA([m4/libtool.m4], [[ Index: tests/nonrecursive.at =================================================================== RCS file: /cvsroot/libtool/libtool/tests/nonrecursive.at,v retrieving revision 1.3 diff -u -r1.3 nonrecursive.at --- tests/nonrecursive.at 14 Nov 2005 20:39:27 -0000 1.3 +++ tests/nonrecursive.at 14 Nov 2005 22:09:28 -0000 @@ -56,9 +56,10 @@ include libltdl/Makefile.inc foo_la_LDFLAGS = -module -avoid-version +foo_la_SOURCES = foo.c ]]) -echo 'static int dummy = 0;' > foo.c +echo 'int dummy = 0;' > foo.c ])# _LTDL_SETUP ## ------------------------ ## Index: tests/old-m4-iface.at =================================================================== RCS file: /cvsroot/libtool/libtool/tests/old-m4-iface.at,v retrieving revision 1.8 diff -u -r1.8 old-m4-iface.at --- tests/old-m4-iface.at 10 Nov 2005 17:51:37 -0000 1.8 +++ tests/old-m4-iface.at 14 Nov 2005 22:09:28 -0000 @@ -93,6 +93,7 @@ AT_DATA([configure.in], [[AC_INIT([main.c]) AC_PROG_MAKE_SET +AC_LIBTOOL_DLOPEN AM_PROG_LIBTOOL AC_WITH_LTDL AC_OUTPUT(Makefile) Index: tests/recursive.at =================================================================== RCS file: /cvsroot/libtool/libtool/tests/recursive.at,v retrieving revision 1.1 diff -u -r1.1 recursive.at --- tests/recursive.at 7 Nov 2005 14:16:15 -0000 1.1 +++ tests/recursive.at 14 Nov 2005 22:09:28 -0000 @@ -39,9 +39,10 @@ SUBDIRS = ltdl lib_LTLIBRARIES = foo.la foo_la_LDFLAGS = -module -avoid-version +foo_la_SOURCES = foo.c ]]) -echo 'static int dummy = 0;' > foo.c +echo 'int dummy = 0;' > foo.c ])# _LTDL_SETUP ## ------------------------ ## Index: tests/subproject.at =================================================================== RCS file: /cvsroot/libtool/libtool/tests/subproject.at,v retrieving revision 1.9 diff -u -r1.9 subproject.at --- tests/subproject.at 10 Nov 2005 14:57:50 -0000 1.9 +++ tests/subproject.at 14 Nov 2005 22:09:28 -0000 @@ -36,12 +36,13 @@ AT_DATA([Makefile.am], [[ACLOCAL_AMFLAGS = -I sub/ltdl/m4 +AUTOMAKE_OPTIONS = 1.9 SUBDIRS = sub/ltdl lib_LTLIBRARIES = foo.la foo_la_LDFLAGS = -module -avoid-version ]]) -echo 'static int dummy = 0;' > foo.c +echo 'int dummy = 0;' > foo.c ])# _LTDL_SETUP ## ------------------------ ## Index: tests/testsuite.at =================================================================== RCS file: /cvsroot/libtool/libtool/tests/testsuite.at,v retrieving revision 1.31 diff -u -r1.31 testsuite.at --- tests/testsuite.at 10 Nov 2005 17:51:37 -0000 1.31 +++ tests/testsuite.at 14 Nov 2005 22:09:28 -0000 @@ -24,6 +24,9 @@ : ${AUTOCONF=autoconf} : ${AUTOMAKE=automake} : ${AUTORECONF=autoreconf} +for tool in ACLOCAL AUTOHEADER AUTOCONF AUTOMAKE AUTORECONF; do + if eval \$$tool --version >/dev/null 2>&1; then :; else eval $tool=no; fi +done export ACLOCAL AUTOHEADER AUTOCONF AUTOMAKE AUTORECONF eval `$LIBTOOL --config | grep ^EGREP=` eval `$LIBTOOL --config | $EGREP '^(host|host_os|host_alias|build|ECHO)='` @@ -58,6 +61,8 @@ # -------------------------- m4_define([LT_AT_ACLOCAL], [AT_CHECK([$ACLOCAL $1], [0], [ignore], [ignore]) +AT_XFAIL_IF([test "$ACLOCAL" = no]) +AT_KEYWORDS([automake]) ]) @@ -65,13 +70,18 @@ # -------------------------- m4_define([LT_AT_AUTOCONF], [AT_CHECK([$AUTOCONF $1], [0], [ignore], [ignore]) +AT_XFAIL_IF([test "$AUTOCONF" = no]) +AT_KEYWORDS([autoconf]) ]) # LT_AT_AUTOMAKE([OPTIONS]) # -------------------------- m4_define([LT_AT_AUTOMAKE], -[AT_CHECK([$AUTOMAKE $1], [0], [ignore], [ignore]) +[AT_CHECK([$AUTOMAKE $1], [0], [ignore], [stderr], +[AT_CHECK([grep 'require .*but have' stderr && (exit 77)], [1])]) +AT_XFAIL_IF([test "$AUTOMAKE" = no]) +AT_KEYWORDS([automake]) ]) @@ -79,6 +89,8 @@ # --------------------------- m4_define([LT_AT_AUTOHEADER], [AT_CHECK([$AUTOHEADER $1], [0], [ignore], [ignore]) +AT_XFAIL_IF([test "$AUTOHEADER" = no]) +AT_KEYWORDS([autoconf]) ]) @@ -86,13 +98,19 @@ # -------------------------- m4_define([LT_AT_AUTORECONF], [AT_CHECK([$AUTORECONF $1], [0], [ignore], [ignore]) +AT_XFAIL_IF( + [case ,$AUTORECONF,$AUTOCONF,$AUTOHEADER,$ACLOCAL,$AUTOMAKE, in *,no,*) :;; *) false;; esac]) +AT_KEYWORDS([autoconf automake]) ]) # LT_AT_CONFIGURE([OPTIONS]) # -------------------------- m4_define([LT_AT_CONFIGURE], -[AT_CHECK([./configure $configure_options $1], [0], [ignore], [ignore]) +[( SHELL=${CONFIG_SHELL-/bin/sh} + AT_CHECK([CONFIG_SHELL=$SHELL $SHELL ./configure $configure_options $1], + [0], [ignore], [ignore]) + ) ]) @@ -100,7 +118,7 @@ # -------------------------- m4_define([LT_AT_MAKE], [( $unset LIBTOOL LIBTOOLIZE - AT_CHECK([$2 $MAKE -e $1], [0], [ignore], [ignore]) ) + AT_CHECK([$MAKE $1 $2], [0], [ignore], [ignore]) ) ]) @@ -214,10 +232,13 @@ all: $(TARGETS) $(LIBTOOL) ]_ARG_DIR[/libltdlc.la: ]_ARG_DIR[/Makefile - cd ]_ARG_DIR[ && $(MAKE) + MAKE='$(MAKE)'; test -n "$$MAKE" || MAKE=make; \ + cd ]_ARG_DIR[ && $$MAKE CC="$(CC)" LIBTOOLFLAGS="$(LIBTOOLFLAGS)" \ + CPPFLAGS="$(CPPFLAGS)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" \ + CONFIGURE_OPTIONS="$(CONFIGURE_OPTIONS)" ]_ARG_DIR[/Makefile: - cd ]_ARG_DIR[ && ./configure $(CONFIGURE_OPTIONS) + cd ]_ARG_DIR[ && CONFIG_SHELL="$(SHELL)" $(SHELL) ./configure $(CONFIGURE_OPTIONS) ltdldemo$(EXEEXT): $(LIBTOOL) module.la ]_ARG_DIR[/libltdlc.la main.lo $(LTLINK) -o ltdldemo main.lo -dlopen module.la ./]_ARG_DIR[/libltdlc.la @@ -230,7 +251,11 @@ module.lo: $(LIBTOOL) module.c $(LTCOMPILE) -c module.c -]])]) +]]) +cat >> Makefile <<EOF +SHELL = $SHELL +EOF +]) m4_popdef([_ARG_DIR]) ])# _LTDL_PROJECT_FILES