[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
FYI: subdir-object compatibility Autotests [libtool--devo--1.0--patch-26
From: |
Gary V. Vaughan |
Subject: |
FYI: subdir-object compatibility Autotests [libtool--devo--1.0--patch-262] |
Date: |
Sat, 16 Oct 2004 15:45:42 +0100 (BST) |
User-agent: |
mailnotify/0.4 |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Applied to HEAD under the 72 hour rule (original proposal was patch-260).
* looking for address@hidden/libtool--devo--1.0--patch-261 to compare with
* comparing to address@hidden/libtool--devo--1.0--patch-261
A tests/.arch-ids/am-subdir.at.id
A tests/.arch-ids/testsuite.at.id
A tests/am-subdir.at
A tests/testsuite.at
M ChangeLog
M Makefile.am
M NEWS
M TODO
M bootstrap
M configure.ac
M tests/Makefile.am
* modified files
Index: Changelog
from Gary V. Vaughan <address@hidden>
Add some new tests for Libtool's support of Automake
subdir-objects builds. This marks the beginning of a move to an
Autotest driven test framework, which will eventually allow us to
trim away many of the generated files in the current test demo
subdirectories:
* configure.ac (AC_CONFIG_TESTDIR): Re-enable commented out
Autotest macros.
(AUTOTEST, M4SH): Use --language long hand.
* bootstrap: Generate tests/testsuite, and by implication
tests/package.m4.
* Makefile.am (edit): Add substitutions needed to generate
tests/package.m4 from bootstrap.
(check-recursive): Add tests/testsuite.
(TESTSUITE): The new Autotest testsuite target.
(TESTSUITE_AT): The Autotest sources.
(EXTRA_DIST): Distribute the generated testsuite and sources.
(tests/package.m4): Use $(edit) to propagate package metadata to
the new tests.
(tests/testsuite): Build the testsuite.
(tests/atconfig): How to regenerate the file.
(check-local): Hook Autotest into `make check'.
(installcheck-local): Run the testsuite on the installed tree.
(clean-local): Tidy our file droppings.
* tests/Makefile.am: Remove bitrotted code from Autotest
experiments in Autoconf 2.52 era. Updated the rest and moved into
Makefile.am.
* tests/testsuite.at: New container for Autotest test groups.
* tests/am-subdir.at: New test group for compatibility with
Automake's subdir-objects builds. Currently holds two tests, one
for a C project and another similar project in C++.
* TODO: Add an entry to remind us that these new tests expose a
bug in libtool.
* NEWS: Updated.
* config/ltmain.m4sh: add foo/bin for every foo/lib
--- orig/Makefile.am
+++ mod/Makefile.am
@@ -26,6 +26,11 @@
-e 's,@LN_S\@,$(LN_S),g' \
-e 's,@MACRO_VERSION\@,$(VERSION),g' \
-e 's,@PACKAGE\@,$(PACKAGE),g' \
+ -e 's,@PACKAGE_BUGREPORT\@,$(PACKAGE_BUGREPORT),g' \
+ -e 's,@PACKAGE_NAME\@,$(PACKAGE),g' \
+ -e 's,@PACKAGE_STRING\@,$(PACKAGE) $(VERSION),g' \
+ -e 's,@PACKAGE_TARNAME\@,$(PACKAGE),g' \
+ -e 's,@PACKAGE_VERSION\@,$(VERSION),g' \
-e 's,@SED\@,$(SED),g' \
-e 's,@VERSION\@,$(VERSION),g' \
-e 's,@prefix\@,$(prefix),g' \
@@ -151,7 +156,7 @@
# The defs script shouldn't be recreated whenever the Makefile is
# regenerated since the source tree can be read-only.
-check-recursive: tests/defs
+check-recursive: tests/defs tests/testsuite
tests/defs: tests/defs.in
rm -f tests/defs.tmp tests/defs; \
input="defs.m4sh"; \
@@ -178,6 +183,65 @@
test -d $$dir || mkdir $$dir || exit 1; \
abs_srcdir=`cd $(top_srcdir) && pwd`; \
(cd $$dir && $$abs_srcdir/$$dir/configure) || exit 1
+
+## ------------ ##
+## Test suite. ##
+## ------------ ##
+
+## Although the Autotest suite is generated by make, we want to distribute
+## a precompiled `$(top_srcdir)/tests/testsuite' so the rules are in this
+## top-level Makefile.am in order that `bootstrap' can compile everything
+## in the source tree; ready for distribution.
+
+TESTSUITE = tests/testsuite
+TESTSUITE_AT = tests/testsuite.at tests/am-subdir.at
+
+EXTRA_DIST += $(TESTSUITE) $(TESTSUITE_AT) tests/package.m4
+
+# Be sure to reexport important environment variables.
+# This is a copy of tests/Makefile.am (TESTS_ENVIRONMENT), be sure to
+# keep them is sync if you change them before those tests are migrated!
+TESTS_ENVIRONMENT = MAKE="$(MAKE)" CC="$(CC)" CFLAGS="$(CFLAGS)" \
+ CPPFLAGS="$(CPPFLAGS)" LD="$(LD)" LDFLAGS="$(LDFLAGS)" \
+ LIBS="$(LIBS)" LN_S="$(LN_S)" NM="$(NM)" RANLIB="$(RANLIB)" \
+ OBJEXT="$(OBJEXT)" EXEEXT="$(EXEEXT)" F77="$(F77)" \
+ FFLAGS="$(FFLAGS)" CXX="$(CXX)" CXXFLAGS="$(CXXFLAGS)" CPP="$(CPP)"
+
+## This is the beginning of the end of the defs.m4sh based tests. For
+## now we run the diminutive new Autotest testsuite first, followed by
+## our legacy tests. The legacy tests will be migrated to Autotest and
+## the majority of the contents of the test subdir will not be needed!
+
+$(top_srcdir)/tests/package.m4: configure.ac
+ cd $(top_srcdir); \
+ { \
+ echo '# Signature of the current package.'; \
+ echo 'm4_define([AT_PACKAGE_NAME], address@hidden@])'; \
+ echo 'm4_define([AT_PACKAGE_TARNAME], address@hidden@])'; \
+ echo 'm4_define([AT_PACKAGE_VERSION], address@hidden@])'; \
+ echo 'm4_define([AT_PACKAGE_STRING], address@hidden@])'; \
+ echo 'm4_define([AT_PACKAGE_BUGREPORT], address@hidden@])'; \
+ } | $(edit) > tests/package.m4
+
+$(top_srcdir)/$(TESTSUITE): tests/package.m4 $(TESTSUITE_AT)
+ cd $(top_srcdir); \
+ $(AUTOTEST) -I ./tests tests/testsuite.at -o $(TESTSUITE)
+
+tests/atconfig: config.status
+ ./config.status tests/atconfig
+
+# Hook the test suite into the check rule
+check-local: tests/atconfig $(TESTSUITE)
+ $(TESTS_ENVIRONMENT) $(SHELL) $(srcdir)/$(TESTSUITE) $(TESTSUITE_FLAGS)
+
+# Run the test suite on the *installed* tree.
+installcheck-local:
+ $(TESTS_ENVIRONMENT) $(SHELL) $(srcdir)/$(TESTSUITE) $(TESTSUITE_FLAGS)
AUTOTEST_PATH=$(exec_prefix)/bin
+
+# We need to remove any file droppings left behind by testsuite
+clean-local: legacy-clean-local
+ $(SHELL) $(srcdir)/$(TESTSUITE) --clean
+
install-data-local:
## Don't install over the top of an old pkgdatadir
--- orig/NEWS
+++ mod/NEWS
@@ -1,5 +1,8 @@
NEWS - list of user-visible changes between releases of GNU Libtool
+New in 2.1b: 2005-??-??; CVS version 2.1a, Libtool team:
+* New tests for support of Automake subdir-objects.
+
New in 1.9f: 2004-??-??; CVS version 1.9e, Libtool team:
* Fix a regression in 1.9d, where ECHO was always set to 'echo' and the
backslash quoting tests were never run.
--- orig/TODO
+++ mod/TODO
@@ -7,6 +7,8 @@
1.1. libtool
------------
+* Fix the bug exposed by am-subdir.at tests.
+
* Rather than looking up the linker's hardcode characteristics in a
table of shell code, use objdump or equivalent to probe a test program
at configure time.
--- orig/bootstrap
+++ mod/bootstrap
@@ -59,7 +59,10 @@
rm -f ./config/ltmain.sh ./m4/ltversion.m4
test -f Makefile || { makefile=Makefile; cp Makefile.am $makefile; }
make ./config/ltmain.sh ./m4/ltversion.m4 ./libtoolize.in ./tests/defs.in \
- top_srcdir=. PACKAGE="$2" VERSION="$3" M4SH="autom4te -l m4sh"
+ top_srcdir=. PACKAGE="$2" VERSION="$3" M4SH="autom4te --language=m4sh"
+
+make ./tests/testsuite AUTOTEST="autom4te --language=autotest" \
+ top_srcdir=. PACKAGE="$2" VERSION="$3" PACKAGE_BUGREPORT="address@hidden"
test -f clcommit.m4sh && make -f Makefile.maint commit \
top_srcdir=. PACKAGE="$2" VERSION="$3" M4SH="autom4te -l m4sh" \
--- orig/configure.ac
+++ mod/configure.ac
@@ -34,8 +34,9 @@
## Autotest initialisation. ##
## ------------------------ ##
-dnl AC_CONFIG_TESTDIR([tests])
-dnl AC_CONFIG_FILES([tests/atlocal])
+AC_CONFIG_TESTDIR([tests])
+AC_SUBST([AUTOM4TE], [autom4te])
+AC_SUBST([AUTOTEST], ['$(AUTOM4TE) --language=autotest'])
## ---------------------------------------- ##
@@ -115,7 +116,7 @@
AM_INIT_AUTOMAKE([1.8 gnits dist-bzip2]) ## We use auto-m4_including
dnl We use m4sh to generate libtool's portable shell scripts
-AC_SUBST([M4SH], ['autom4te -l m4sh'])
+AC_SUBST([M4SH], ['$(AUTOM4TE) --language=m4sh'])
dnl Make sure config.status is regenerated when the version timestamp changes
AC_SUBST([CONFIG_STATUS_DEPENDENCIES], ['$(top_builddir)/stamp-vcl'])
--- orig/tests/Makefile.am
+++ mod/tests/Makefile.am
@@ -86,6 +86,8 @@
cd $(top_builddir) && $(MAKE) all
# Be sure to reexport important environment variables.
+# This is a copy of ../Makefile.am (TESTS_ENVIRONMENT), be sure to
+# keep them is sync if you change them before these tests are migrated!
TESTS_ENVIRONMENT = MAKE="$(MAKE)" CC="$(CC)" CFLAGS="$(CFLAGS)" \
CPPFLAGS="$(CPPFLAGS)" LD="$(LD)" LDFLAGS="$(LDFLAGS)" \
LIBS="$(LIBS)" LN_S="$(LN_S)" NM="$(NM)" RANLIB="$(RANLIB)" \
@@ -107,50 +109,7 @@
done
rm -rf _inst
-## ------------ ##
-## package.m4. ##
-## ------------ ##
-
-$(srcdir)/package.m4: $(top_srcdir)/configure.ac
- { \
- echo '# Signature of the current package.'; \
- echo 'm4_define([AT_PACKAGE_NAME], address@hidden@])'; \
- echo 'm4_define([AT_PACKAGE_TARNAME], address@hidden@])'; \
- echo 'm4_define([AT_PACKAGE_VERSION], address@hidden@])'; \
- echo 'm4_define([AT_PACKAGE_STRING], address@hidden@])'; \
- echo 'm4_define([AT_PACKAGE_BUGREPORT], address@hidden@])'; \
- } >$(srcdir)/package.m4
-
-## ------------ ##
-## Test suite. ##
-## ------------ ##
-
$(TESTS): defs
defs: defs.in ../Makefile.am
cd .. && $(MAKE) $(AM_MAKEFLAGS) tests/defs
DISTCLEANFILES += defs
-
-TESTSUITE_AT = \
- testsuite.at \
- demo.at fortran.at tools.at
-TESTSUITE = testsuite
-
-#EXTRA_DIST = $(TESTSUITE_AT) local.at atlocal.in package.m4
-
-#check-local: atconfig $(TESTSUITE)
-# $(SHELL) $(srcdir)/$(TESTSUITE)
-
-#clean-local:
-# $(srcdir)/testsuite --clean
-
-AUTOM4TE = autom4te
-AUTOTEST = $(AUTOM4TE) --language=autotest
-$(srcdir)/$(TESTSUITE): $(srcdir)/package.m4 local.at $(TESTSUITE_AT)
- $(AUTOTEST) -I $(srcdir) testsuite.at -o $@
-
-atconfig: $(top_builddir)/config.status
- cd $(top_builddir) && ./config.status tests/$@
-
-# Run the test suite on the *installed* tree.
-#installcheck-local:
- $(SHELL) $(srcdir)/$(TESTSUITE) AUTOTEST_PATH=$(exec_prefix)/bin
* added files
--- /dev/null
+++
/Users/gary/devel/savannah/libtool--devo--1.0/,,address@hidden/new-files-archive/./tests/.arch-ids/am-subdir.at.id
@@ -0,0 +1 @@
+Gary V. Vaughan <address@hidden> Wed Oct 13 10:43:30 2004 21102.0
--- /dev/null
+++
/Users/gary/devel/savannah/libtool--devo--1.0/,,address@hidden/new-files-archive/./tests/.arch-ids/testsuite.at.id
@@ -0,0 +1 @@
+Gary V. Vaughan <address@hidden> Wed Oct 13 10:43:30 2004 21102.1
--- /dev/null
+++
/Users/gary/devel/savannah/libtool--devo--1.0/,,address@hidden/new-files-archive/./tests/am-subdir.at
@@ -0,0 +1,160 @@
+# Hand crafted tests for GNU Libtool. -*- Autotest
-*-
+# Copyright 2004 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., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+
+
+AT_BANNER([Libtool's subdir-objects support.])
+
+
+## ----------- ##
+## C Language. ##
+## ----------- ##
+
+AT_SETUP([C subdir-objects])
+
+AT_DATA([[configure.ac]],
+[[AC_INIT([subdir-demo], ]]AT_PACKAGE_VERSION[[, ]]AT_PACKAGE_BUGREPORT[[)
+AM_INIT_AUTOMAKE([subdir-objects foreign])
+LT_INIT([win32-dll])
+AM_PROG_CC_C_O
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
+]])
+
+AT_DATA([[Makefile.am]],
+[[AC_LOCAL_AMFLAGS = -I ../../m4
+AM_CPPFLAGS = -I$(top_srcdir)/../..
+
+lib_LTLIBRARIES = subdir/libsub.la
+subdir_libsub_la_SOURCES= subdir/sub.c
+
+bin_PROGRAMS = subdir/subdemo
+subdir_subdemo_SOURCES = subdir/main.c
+subdir_subdemo_LDADD = subdir/libsub.la
+]])
+
+test -d subdir || { rm -f subdir && mkdir subdir; }
+
+AT_DATA([[subdir/main.c]],
+[[#include <stdio.h>
+
+extern void sub (void);
+
+int main (int argc, char **argv)
+{
+ printf ("Welcome to GNU Libtool subdir-objects test!\n");
+ sub();
+ return 0;
+}
+]])
+
+AT_DATA([[subdir/sub.c]],
+[[#include <stdio.h>
+void sub (void) { printf ("** This is libsub **\n"); }
+]])
+
+AT_DATA(expout,
+[[Welcome to GNU Libtool subdir-objects test!
+** This is libsub **
+]])
+
+AT_BOOTSTRAP
+AT_CHECK([subdir/subdemo], 0, expout)
+
+AT_CLEANUP
+
+
+## ------------- ##
+## C++ Language. ##
+## ------------- ##
+
+AT_SETUP([C++ subdir-objects])
+
+AT_DATA([[configure.ac]],
+[[AC_INIT([subdir-demo], ]]AT_PACKAGE_VERSION[[, ]]AT_PACKAGE_BUGREPORT[[)
+AM_INIT_AUTOMAKE([subdir-objects foreign])
+AM_PROG_CC_C_O
+AC_PROG_CXX
+AC_PROG_CXXCPP
+
+# As of the writing of this demo, GNU Autoconf's AC_OBJEXT and
+# AC_EXEEXT macros only works for C compilers!
+# Libtool's setup macro calls AC_OBJEXT and AC_EXEEXT without setting
+# the test language to C. We do it before any libtool setup macros are
+# called so that the proper values are cached beforehand. We also do
+# it before any linker flags (LDFLAGS) are set so that C++ specific
+# ones don't break the tests.
+AC_LANG_PUSH([C])
+AC_OBJEXT
+AC_EXEEXT
+AC_LANG_POP
+
+AC_LANG([C++])
+LT_INIT([win32-dll])
+
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
+]])
+
+AT_DATA([[Makefile.am]],
+[[AC_LOCAL_AMFLAGS = -I ../../m4
+AM_CPPFLAGS = -I$(top_srcdir)/../..
+
+lib_LTLIBRARIES = subdir/libsub.la
+subdir_libsub_la_SOURCES= subdir/sub.cxx subdir/sub.hxx
+
+bin_PROGRAMS = subdir/subdemo
+subdir_subdemo_SOURCES = subdir/main.cxx
+subdir_subdemo_LDADD = subdir/libsub.la
+]])
+
+test -d subdir || { rm -f subdir && mkdir subdir; }
+
+AT_DATA([[subdir/sub.hxx]],
+[[class libsub { public: void sub (void); };
+]])
+
+AT_DATA([[subdir/main.cxx]],
+[[#include <iostream.h>
+#include "sub.hxx"
+
+int main (int, char *[])
+{
+ libsub SUB;
+
+ cout << "Welcome to GNU Libtool subdir-objects C++ test!" << endl;
+ SUB.sub();
+ return 0;
+}
+]])
+
+AT_DATA([[subdir/sub.cxx]],
+[[#include <iostream.h>
+#include "sub.hxx"
+
+void libsub::sub (void) { cout << "** This is libsub::sub **" << endl; }
+]])
+
+AT_DATA(expout,
+[[Welcome to GNU Libtool subdir-objects C++ test!
+** This is libsub::sub **
+]])
+
+AT_BOOTSTRAP
+AT_CHECK([subdir/subdemo], 0, expout)
+
+AT_CLEANUP
--- /dev/null
+++
/Users/gary/devel/savannah/libtool--devo--1.0/,,address@hidden/new-files-archive/./tests/testsuite.at
@@ -0,0 +1,47 @@
+# Process with autom4te to create an -*- Autotest -*- test suite.
+
+# Test suite for GNU Libtool.
+# Copyright 2004 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., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+
+# AT_BOOTSTRAP
+# ------------
+m4_define([AT_BOOTSTRAP],
+[[LIBTOOLIZE=${abs_top_builddir}/libtoolize
+export LIBTOOLIZE
+
+test -f ./ltmain.sh || $LIBTOOLIZE --copy
+test -f ./configure || autoreconf --force --verbose --install
+test -f ./configure || exit 1
+./configure
+${MAKE-make}
+]])
+
+# We use `dnl' in zillions of places...
+m4_pattern_allow([^dnl$])
+
+# We exercise libtool.
+AT_TESTED([grep autoreconf autom4te automake])
+
+## ----------- ##
+## The suite. ##
+## ----------- ##
+
+AT_INIT
+
+# Torturing subdir-objects builds
+m4_include([am-subdir.at])
- --
Gary V. Vaughan ())_. address@hidden,gnu.org}
Research Scientist ( '/ http://tkd.kicks-ass.net
GNU Hacker / )= http://www.gnu.org/software/libtool
Technical Author `(_~)_ http://sources.redhat.com/autobook
_________________________________________________________
This patch notification generated by tlaapply version 0.7
http://tkd.kicks-ass.net/arch/address@hidden/cvs-utils--tla--1.0
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (Darwin)
iD8DBQFBcTQVFRMICSmD1gYRAg96AJ0fiKVn6u1lCBdHzORyx6FQLd9PqgCgo+P8
NKkOWEaLyBR1nIVxQ6tj0uM=
=qVjK
-----END PGP SIGNATURE-----
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- FYI: subdir-object compatibility Autotests [libtool--devo--1.0--patch-262],
Gary V. Vaughan <=