From: Stefano Lattarini Date: Tue, 21 Sep 2010 10:54:25 +0000 (+0200) Subject: Add test for `AM_WITH_DMALLOC' macro. X-Git-Tag: v1.11.1b~46^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=78e08c867007864ef740936c3af3fdd1238b9792;p=thirdparty%2Fautomake.git Add test for `AM_WITH_DMALLOC' macro. * tests/dmalloc.test: New test. * tests/Makefile.am (TESTS): Update. --- diff --git a/ChangeLog b/ChangeLog index 03187aa91..858f06f91 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2010-10-04 Stefano Lattarini + Add test for `AM_WITH_DMALLOC' macro. + * tests/dmalloc.test: New test. + * tests/Makefile.am (TESTS): Update. + Fix nits and bugs in tests `help*.test'. * tests/help4.test: Fix broken sed commands used to strip `-W...' flags away from "$AUTOMAKE" and "$ACLOCAL". diff --git a/tests/Makefile.am b/tests/Makefile.am index 6c6f24faf..acc764046 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 a9b1cbba5..117f2ba4f 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -551,6 +551,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 000000000..629c9494e --- /dev/null +++ b/tests/dmalloc.test @@ -0,0 +1,61 @@ +#! /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 . + +# 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([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. So we just check that proper linker and libs flags get +## added. + echo ' ' $(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 + +: