* Stefano Lattarini wrote on Tue, Sep 21, 2010 at 12:57:10PM CEST: > The macro `AM_WITH_DMALLOC' is not checked by the testsuite. > The attached pach should provide at least a minimal coverage. > OK for maint?
OK with nits addressed. Thanks. > Subject: [PATCH] Add test for `AM_WITH_DMALLOC' macro. > > * tests/dmalloc.test: New test. > * tests/Makefile.am (TESTS): Update. > --- /dev/null > +++ b/tests/dmalloc.test > +# Simple checks on the `AM_WITH_DMALLOC' macro. > + > +. ./defs || Exit 1 > + > +set -e > + > +cat >> configure.in << 'END' > +AC_CONFIG_HEADERS([config.h]) > +AM_WITH_DMALLOC > +AC_SUBST([LIBS]) Not needed. Autoconf AC_SUBST's LIBS. > +dnl Let's show some good practices ;-) > +AC_SUBST([AM_LDFLAGS], [$LDFLAGS]) This is not needed, nor would I recommend it. LDFLAGS is AC_SUBSTed by Autoconf already, and used in link flags already anyway. You can just grep that below. > +AC_OUTPUT > +END > + > +cat > config.h.in <<'END' > +#undef WITH_DMALLOC > +END > + > +cat > Makefile.am <<'END' > +check-with-dmalloc: > +## The AM_WITH_DMALLOC assumes that the user is a developer, so that > +## he is expected to install and make available the `dmalloc' library > +## by his own. > + echo ' ' $(AM_LDFLAGS) ' ' | grep ' -g ' > + echo ' ' $(LIBS) ' ' | grep ' -ldmalloc ' > +END > + > +$ACLOCAL > +$AUTOMAKE > +$AUTOCONF > + > +./configure > +cat config.h # debug info > +grep '^ */\* *# *undef *WITH_DMALLOC *\*/ *$' config.h > + > +./configure --without-dmalloc > +cat config.h # debug info > +grep '^ */\* *# *undef *WITH_DMALLOC *\*/ *$' config.h > + > +./configure --with-dmalloc > +cat config.h # debug info > +grep '^# *define *WITH_DMALLOC *1 *$' config.h > +$MAKE check-with-dmalloc > + > +: