The macro `AM_WITH_DMALLOC' is not checked by the testsuite. The attached pach should provide at least a minimal coverage. OK for maint?
Regards, Stefano
From b202a90ad9832bb4a7da6cb37322cd34716e75b4 Mon Sep 17 00:00:00 2001 From: Stefano Lattarini <stefano.lattar...@gmail.com> Date: Tue, 21 Sep 2010 12:54:25 +0200 Subject: [PATCH] Add test for `AM_WITH_DMALLOC' macro. * tests/dmalloc.test: New test. * tests/Makefile.am (TESTS): Update. --- ChangeLog | 4 +++ tests/Makefile.am | 1 + tests/Makefile.in | 1 + tests/dmalloc.test | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 68 insertions(+), 0 deletions(-) create mode 100755 tests/dmalloc.test diff --git a/ChangeLog b/ChangeLog index 4a6c386..9a039ee 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2010-09-21 Stefano Lattarini <stefano.lattar...@gmail.com> + Add test for `AM_WITH_DMALLOC' macro. + * tests/dmalloc.test: New test. + * tests/Makefile.am (TESTS): Update. + * m4/dmalloc.m4: Bump serial number and copyright years. 2010-09-20 Stefano Lattarini <stefano.lattar...@gmail.com> diff --git a/tests/Makefile.am b/tests/Makefile.am index ba695f5..768f917 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -284,6 +284,7 @@ distdir.test \ distlinks.test \ distlinksbrk.test \ distname.test \ +dmalloc.test \ dollar.test \ dollarvar.test \ dollarvar2.test \ diff --git a/tests/Makefile.in b/tests/Makefile.in index 9ea9d74..bccc52f 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -522,6 +522,7 @@ distdir.test \ distlinks.test \ distlinksbrk.test \ distname.test \ +dmalloc.test \ dollar.test \ dollarvar.test \ dollarvar2.test \ diff --git a/tests/dmalloc.test b/tests/dmalloc.test new file mode 100755 index 0000000..66b9609 --- /dev/null +++ b/tests/dmalloc.test @@ -0,0 +1,62 @@ +#! /bin/sh +# Copyright (C) 2010 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, see <http://www.gnu.org/licenses/>. + +# 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]) +dnl Let's show some good practices ;-) +AC_SUBST([AM_LDFLAGS], [$LDFLAGS]) +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 + +: -- 1.7.1