From: Ralf Wildenhues Date: Wed, 27 Apr 2005 18:18:10 +0000 (+0000) Subject: * tests/convenience.at: New. Test convenience archives. X-Git-Tag: release-2-1b~649 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1e579accc08101151c4a7fe0e15cd7f5a645d682;p=thirdparty%2Flibtool.git * tests/convenience.at: New. Test convenience archives. * Makefile.am, tests/testsuite.at: Adjust. * tests/testsuite.at: Reorder tests. Suspend AT_TESTED. (PREPARE_TESTS): Define EGREP, host, build, LIBTOOL. (LT_AT_BOOTSTRAP): Fail if autoreconf fails. (LT_AT_EXEC_CHECK): New macro for execution of $build binaries. (LT_AT_TAG): New macro to test tag availability or skip test. * tests/am-subdir.at, tests/duplicate_members.at, tests/inherited_flags.at, tests/link-order.at, tests/stresstest.at, tests/template.at: Adjust. Use LT_AT_TAG, LT_AT_EXEC_CHECK, AT_KEYWORDS. Use compiler/linker flags consistently. * tests/link-order.at: Fix use of AT_DATA, bogus redirection inside AT_CHECK. * tests/stresstest.at: Do not use wildcards/regex in symbol files, they are not portable. Use -no-undefined on win32. Fix to ignore compile/link warnings. --- diff --git a/ChangeLog b/ChangeLog index 4a69a5a31..8434f3532 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,22 @@ 2005-04-27 Ralf Wildenhues + * tests/convenience.at: New. Test convenience archives. + * Makefile.am, tests/testsuite.at: Adjust. + * tests/testsuite.at: Reorder tests. Suspend AT_TESTED. + (PREPARE_TESTS): Define EGREP, host, build, LIBTOOL. + (LT_AT_BOOTSTRAP): Fail if autoreconf fails. + (LT_AT_EXEC_CHECK): New macro for execution of $build binaries. + (LT_AT_TAG): New macro to test tag availability or skip test. + * tests/am-subdir.at, tests/duplicate_members.at, tests/inherited_flags.at, + tests/link-order.at, tests/stresstest.at, tests/template.at: + Adjust. Use LT_AT_TAG, LT_AT_EXEC_CHECK, AT_KEYWORDS. + Use compiler/linker flags consistently. + * tests/link-order.at: Fix use of AT_DATA, bogus redirection + inside AT_CHECK. + * tests/stresstest.at: Do not use wildcards/regex in symbol files, + they are not portable. Use -no-undefined on win32. Fix to ignore + compile/link warnings. + * tests/f77demo/foo.h, tests/f77demo/fooc.c, tests/f77demo/cprogram.c, tests/mdemo2/main.c, tests/pdemo/foo.h: Make declarations available. diff --git a/Makefile.am b/Makefile.am index d57e4f9b6..213fcfbba 100644 --- a/Makefile.am +++ b/Makefile.am @@ -309,6 +309,7 @@ TESTSUITE_AT = tests/testsuite.at \ tests/libtoolize.at \ tests/stresstest.at \ tests/link-order.at \ + tests/convenience.at \ tests/template.at EXTRA_DIST += $(TESTSUITE) $(TESTSUITE_AT) tests/package.m4 @@ -319,7 +320,8 @@ TESTS_ENVIRONMENT = MAKE="$(MAKE)" CC="$(CC)" CFLAGS="$(CFLAGS)" \ LIBS="$(LIBS)" LN_S="$(LN_S)" NM="$(NM)" RANLIB="$(RANLIB)" \ OBJEXT="$(OBJEXT)" EXEEXT="$(EXEEXT)" CONFIG_SHELL="$(SHELL)" \ CXX="$(CXX)" CXXFLAGS="$(CXXFLAGS)" CXXCPP="$(CXXCPP)" \ - F77="$(F77)" FFLAGS="$(FFLAGS)" + F77="$(F77)" FFLAGS="$(FFLAGS)" \ + GCJ="$(GCJ)" GCJFLAGS="$(GCJFLAGS)" check-recursive: $(srcdir)/$(TESTSUITE) diff --git a/tests/am-subdir.at b/tests/am-subdir.at index 39388cd79..8c9062728 100644 --- a/tests/am-subdir.at +++ b/tests/am-subdir.at @@ -25,6 +25,7 @@ AT_BANNER([Libtool's subdir-objects support.]) ## ----------- ## AT_SETUP([C subdir-objects]) +AT_KEYWORDS([autoconf automake]) AT_DATA([[configure.ac]], [[AC_INIT([subdir-demo], ]]AT_PACKAGE_VERSION[[, ]]AT_PACKAGE_BUGREPORT[[) @@ -74,7 +75,7 @@ AT_DATA(expout, LT_AT_BOOTSTRAP "${MAKE-make}" -AT_CHECK([subdir/subdemo], 0, expout) +LT_AT_EXEC_CHECK([subdir/subdemo], 0, expout) AT_CLEANUP @@ -84,6 +85,8 @@ AT_CLEANUP ## ------------- ## 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[[) @@ -157,6 +160,6 @@ AT_DATA(expout, LT_AT_BOOTSTRAP "${MAKE-make}" -AT_CHECK([subdir/subdemo], 0, expout) +LT_AT_EXEC_CHECK([subdir/subdemo], 0, expout) AT_CLEANUP diff --git a/tests/duplicate_members.at b/tests/duplicate_members.at index 8c35b3d80..bd1917453 100755 --- a/tests/duplicate_members.at +++ b/tests/duplicate_members.at @@ -19,18 +19,12 @@ AT_BANNER([Testing libtool functions]) AT_SETUP([duplicate members in archive tests]) - -LIBTOOL=${abs_top_builddir}/libtool - # we don't want to use whole_archive_flag_spec, even if available sed -e 's|^whole_archive_flag_spec=.*|whole_archive_flag_spec=|g' < $LIBTOOL > libtool chmod +x ./libtool LIBTOOL=./libtool -eval `$LIBTOOL --config | grep ^EGREP=` -eval `$LIBTOOL --config | $EGREP '(host|build)='` - AT_DATA(bar.c, [[int bar() { int result=foo1() +foo2() +foo3() +foo4() +foo5() +foo6(); @@ -68,8 +62,6 @@ $LIBTOOL --mode=link --tag=CC $CC $CFLAGS $LDFLAGS -o libbar.la bar.lo libconv.l $LIBTOOL --mode=compile --tag=CC $CC -c $CFLAGS -o main.lo main.c $LIBTOOL --mode=link --tag=CC $CC $CFLAGS $LDFLAGS -o main main.lo ./libbar.la -AT_CHECK([./main],[0],[ignore],[ignore],[AT_CHECK(if - ((test "X$host" != "X$build") && - ( test -x ./main)); then exit 77; fi)]) +LT_AT_EXEC_CHECK([./main],[0],[ignore],[ignore]) AT_CLEANUP diff --git a/tests/inherited_flags.at b/tests/inherited_flags.at index 3127a637a..7581a492b 100644 --- a/tests/inherited_flags.at +++ b/tests/inherited_flags.at @@ -19,8 +19,6 @@ AT_SETUP([inherited_linker_flags]) -: ${LIBTOOL=$abs_top_builddir/libtool} - AT_DATA([foo.c], [ int foo() { return 1;} @@ -41,14 +39,12 @@ AT_DATA([main.c], int main() { return 0;} ]) -eval `$LIBTOOL --config | grep ^CC` - -${LIBTOOL} --mode=compile --tag=CC $CC -c -o foo.lo foo.c -${LIBTOOL} --mode=compile --tag=CC $CC -c -o bar.lo bar.c -${LIBTOOL} --mode=compile --tag=CC $CC -c -o baz.lo baz.c -${LIBTOOL} --mode=compile --tag=CC $CC -c -o main.lo main.c -${LIBTOOL} --mode=link --tag=CC $CC -o libfoo.la foo.lo -rpath /usr/local/lib -${LIBTOOL} --mode=link --tag=CC $CC -o libbar.la bar.lo -rpath /usr/local/lib +${LIBTOOL} --mode=compile --tag=CC $CC $CFLAGS -c -o foo.lo foo.c +${LIBTOOL} --mode=compile --tag=CC $CC $CFLAGS -c -o bar.lo bar.c +${LIBTOOL} --mode=compile --tag=CC $CC $CFLAGS -c -o baz.lo baz.c +${LIBTOOL} --mode=compile --tag=CC $CC $CFLAGS -c -o main.lo main.c +${LIBTOOL} --mode=link --tag=CC $CC $CFLAGS $LDFLAGS -o libfoo.la foo.lo -rpath /usr/local/lib +${LIBTOOL} --mode=link --tag=CC $CC $CFLAGS $LDFLAGS -o libbar.la bar.lo -rpath /usr/local/lib mv libfoo.la libfoo.la.bak @@ -59,7 +55,7 @@ mv libbar.la libbar.la.bak sed -e 's/^inherited_linker_flags.*/inherited_linker_flags=-llt_unlikely_existing_lib/g' < libbar.la.bak > libbar.la rm libbar.la.bak -AT_CHECK([${LIBTOOL} --mode=link --tag=CC $CC -o libbaz.la baz.lo -rpath /usr/local/lib ./libfoo.la ./libbar.la | grep 'llt_[[ui]]nlikely_existing_lib.*llt_[[ui]]nlikely_existing_lib'],[0],[ignore],[ignore]) -AT_CHECK([${LIBTOOL} --mode=link --tag=CC $CC -o main main.lo -rpath /usr/local/lib ./libfoo.la ./libbar.la | grep 'llt_[[ui]]nlikely_existing_lib.*llt_[[ui]]nlikely_existing_lib'],[0],[ignore],[ignore]) +AT_CHECK([${LIBTOOL} --mode=link --tag=CC $CC $CFLAGS $LDFLAGS -o libbaz.la baz.lo -rpath /usr/local/lib ./libfoo.la ./libbar.la | grep 'llt_[[ui]]nlikely_existing_lib.*llt_[[ui]]nlikely_existing_lib'],[0],[ignore],[ignore]) +AT_CHECK([${LIBTOOL} --mode=link --tag=CC $CC $CFLAGS $LDFLAGS -o main main.lo -rpath /usr/local/lib ./libfoo.la ./libbar.la | grep 'llt_[[ui]]nlikely_existing_lib.*llt_[[ui]]nlikely_existing_lib'],[0],[ignore],[ignore]) AT_CLEANUP diff --git a/tests/link-order.at b/tests/link-order.at index 798b1c03d..acec8ab38 100644 --- a/tests/link-order.at +++ b/tests/link-order.at @@ -18,10 +18,7 @@ # link-order.test - make sure that library linking order matches -AT_BANNER([Libtool link order test.]) AT_SETUP([Link order test.]) -: ${LIBTOOL=${abs_top_builddir}/libtool} -: ${EGREP='grep -E'} eval `$LIBTOOL --config | grep ECHO=` prefix_old=`pwd`/old @@ -40,16 +37,16 @@ for i in old new; do rm -rf src mkdir src - AT_DATA(src/a_$i.c, -[[extern int c; + cat >src/a_$i.c <src/b_$i.c <mylog 2>&1; - if $EGREP relinking mylog; then - $EGREP ' -L.*\/new\/lib -lb -L.*\/old\/lib -lcee' mylog - else :; - fi], [0], [ignore], [ignore], [echo "wrong link order"]) - +AT_CHECK([if $EGREP relinking stderr; then + $EGREP ' -L.*\/new\/lib -lb -L.*\/old\/lib -lcee' stdout + else :; fi], [0], [ignore], [], [echo "wrong link order"]) for i in old new; do - AT_DATA(src/main_$i.c, -[[extern int a_$i(); + cat >src/main_$i.c <