From debbugs-submit-bounces@debbugs.gnu.org Thu Jan 20 12:06:26 2011 Received: (at submit) by debbugs.gnu.org; 20 Jan 2011 17:06:26 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Pfxxq-0005de-4u for submit@debbugs.gnu.org; Thu, 20 Jan 2011 12:06:26 -0500 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Pfxxk-0005dO-Vv for submit@debbugs.gnu.org; Thu, 20 Jan 2011 12:06:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Pfy5L-00046S-Rh for submit@debbugs.gnu.org; Thu, 20 Jan 2011 12:14:12 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_RP_MATCHES_RCVD autolearn=unavailable version=3.3.1 Received: from lists.gnu.org ([199.232.76.165]:53707) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Pfy5L-000466-EX for submit@debbugs.gnu.org; Thu, 20 Jan 2011 12:14:11 -0500 Received: from [140.186.70.92] (port=35959 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pfy5H-0006LG-Sm for bug-automake@gnu.org; Thu, 20 Jan 2011 12:14:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Pfy56-00043w-KO for bug-automake@gnu.org; Thu, 20 Jan 2011 12:14:01 -0500 Received: from snape.cebitec.uni-bielefeld.de ([129.70.160.84]:46682 helo=smtp-relay.CeBiTec.Uni-Bielefeld.DE) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Pfy56-00043c-F5 for bug-automake@gnu.org; Thu, 20 Jan 2011 12:13:56 -0500 Received: from localhost (localhost.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) by smtp-relay.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTP id 088A392E for ; Thu, 20 Jan 2011 18:13:55 +0100 (CET) X-Virus-Scanned: amavisd-new at cebitec.uni-bielefeld.de Received: from smtp-relay.CeBiTec.Uni-Bielefeld.DE ([127.0.0.1]) by localhost (malfoy.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) (amavisd-new, port 10024) with LMTP id eC3thwOhu6VT for ; Thu, 20 Jan 2011 18:13:53 +0100 (CET) Received: from manam.CeBiTec.Uni-Bielefeld.DE (manam.CeBiTec.Uni-Bielefeld.DE [129.70.161.120]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp-relay.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTPS id AC43592D for ; Thu, 20 Jan 2011 18:13:53 +0100 (CET) Received: (from ro@localhost) by manam.CeBiTec.Uni-Bielefeld.DE (8.14.4+Sun/8.14.4/Submit) id p0KHDr7V006176; Thu, 20 Jan 2011 18:13:53 +0100 (MET) X-Authentication-Warning: manam.CeBiTec.Uni-Bielefeld.DE: ro set sender to ro@CeBiTec.Uni-Bielefeld.DE using -f From: Rainer Orth To: bug-automake@gnu.org Subject: Automake should support adding to DejaGnu site.exp Date: Thu, 20 Jan 2011 18:13:53 +0100 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (usg-unix-v) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Spam-Score: -5.1 (-----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.1 (-----) Currently, Automake doesn't support adding package-specific content to the site.exp file generated for DejaGnu testsuites. In GCC alone, three testsuites need that facility and have to override the Automake-generated target wholesale to achieve what they need: boehm-gc/testsuite/Makefile.am libjava/testsuite/Makefile.am libstdc++-v3/testsuite/Makefile.am These Makefile.am's carry the following comment: # We need more things in site.exp, but automake completely controls the # creation of that file; there's no way to append to it without messing up # the dependancy chains. So we overrule automake. This rule is exactly # what it would have generated, plus our own additions. Since in the future it is easily possible that the target/commands generated by Automake deviate from what is currently emitted there, there should be a Automake facility to directly support adding to the generated site.exp. Thanks. Rainer -- ----------------------------------------------------------------------------- Rainer Orth, Center for Biotechnology, Bielefeld University From debbugs-submit-bounces@debbugs.gnu.org Tue Feb 01 03:50:51 2011 Received: (at 7873) by debbugs.gnu.org; 1 Feb 2011 08:50:51 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PkBwp-0005QS-0t for submit@debbugs.gnu.org; Tue, 01 Feb 2011 03:50:51 -0500 Received: from mail-ww0-f46.google.com ([74.125.82.46]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PkBwm-0005Q7-Ty for 7873@debbugs.gnu.org; Tue, 01 Feb 2011 03:50:50 -0500 Received: by wwj40 with SMTP id 40so7008213wwj.15 for <7873@debbugs.gnu.org>; Tue, 01 Feb 2011 00:59:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:subject:date:user-agent:cc:references :in-reply-to:mime-version:content-type:message-id; bh=P1IK4SLnGPaa/SQdIX7cbAobeFbaxj7BOOBhBCUywBA=; b=kKUnompUOHgOLjtYFkd1CzsQJwfHHxvqAIHfQNDThJNEiSO5mhf2hKzZuBYUeej8AN Dc5V2BOmH4xjCvIpyEumn5u2wLkeQ2qqC6imMOKvccqQMHd9a1gbnpF9KDubkzLx3f+o PXMM17DKNRdq1psKCXQQ28jZ1O33iMVYd2U98= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:subject:date:user-agent:cc:references:in-reply-to :mime-version:content-type:message-id; b=ZK3VBOHbg2VprBJxlKJrh1K4R4tE9yDzaE+hE9NyihIxZ6M4ZbAFrrZb7rlkm4eZg2 TrvPbaGNyFVIoFmH1SWi8PA4yzzzMocZdb14z3g2EJaIPLcGQT1yEZ+JbHE1/8x9LmyE EtMPxqT966SWCP+zYFJhnmsSrBuTv9tooBL5s= Received: by 10.227.195.79 with SMTP id eb15mr7246069wbb.192.1296550750930; Tue, 01 Feb 2011 00:59:10 -0800 (PST) Received: from bigio.localnet (host173-92-dynamic.54-82-r.retail.telecomitalia.it [82.54.92.173]) by mx.google.com with ESMTPS id f27sm5017651wbf.1.2011.02.01.00.59.08 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 01 Feb 2011 00:59:09 -0800 (PST) From: Stefano Lattarini To: Rainer Orth Subject: Re: bug#7873: Automake should support adding to DejaGnu site.exp Date: Tue, 1 Feb 2011 09:58:35 +0100 User-Agent: KMail/1.13.3 (Linux/2.6.30-2-686; KDE/4.4.4; i686; ; ) References: In-Reply-To: MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_8s8RNV1kZgctSrs" Message-Id: <201102010958.36706.stefano.lattarini@gmail.com> X-Spam-Score: -4.2 (----) X-Debbugs-Envelope-To: 7873 Cc: 7873@debbugs.gnu.org, automake-patches@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -4.1 (----) --Boundary-00=_8s8RNV1kZgctSrs Content-Type: Text/Plain; charset="us-ascii" Content-Transfer-Encoding: 7bit On Thursday 20 January 2011, Rainer Orth wrote: > Currently, Automake doesn't support adding package-specific content to > the site.exp file generated for DejaGnu testsuites. In GCC alone, three > testsuites need that facility and have to override the > Automake-generated target wholesale to achieve what they need: > > boehm-gc/testsuite/Makefile.am > libjava/testsuite/Makefile.am > libstdc++-v3/testsuite/Makefile.am > > These Makefile.am's carry the following comment: > > # We need more things in site.exp, but automake completely controls the > # creation of that file; there's no way to append to it without messing up > # the dependancy chains. So we overrule automake. This rule is exactly > # what it would have generated, plus our own additions. > > Since in the future it is easily possible that the target/commands > generated by Automake deviate from what is currently emitted there, > there should be a Automake facility to directly support adding to the > generated site.exp. > > Thanks. > Rainer > What about the attached patch? It should be applied to a temporary branch based off of the commit v1.11-249-g253c2e7 "Extend and improve tests on DejaGnu support", and could be merged to either maint or master. Regards, Stefano --Boundary-00=_8s8RNV1kZgctSrs Content-Type: text/x-patch; charset="us-ascii"; name="dejagnu-allow-the-package-developer-to-extend-site.exp.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline; filename="dejagnu-allow-the-package-developer-to-extend-site.exp.patch" =46rom 41c9eaaae6792b5fde2e8fcbb6591ee27a7a1a5a Mon Sep 17 00:00:00 2001 =46rom: Stefano Lattarini Date: Tue, 1 Feb 2011 09:52:43 +0100 Subject: [PATCH 2/2] dejagnu: allow the package developer to extend site.exp * lib/am/dejagnu.am (site.exp): Depend from the files listed in $(EXTRA_DEJAGNU_SITE_CONFIG), if any. Append their contents to the generated site.exp (still preserving user edits). * doc/automake.texi (Dejagnu Tests): Update. * tests/dejagnu-siteexp-append.test: New test. * tests/dejagnu-siteexp-extend.test: Likewise. * tests/dejagnu-siteexp-useredit.test: Likewise. * tests/Makefile.am (TESTS): Update. Suggestion by Rainer Orth. =2D-- ChangeLog | 13 +++ doc/automake.texi | 8 ++ lib/am/dejagnu.am | 16 +++- tests/Makefile.am | 3 + tests/Makefile.in | 3 + tests/dejagnu-siteexp-append.test | 72 ++++++++++++++++ tests/dejagnu-siteexp-extend.test | 161 +++++++++++++++++++++++++++++++= ++++ tests/dejagnu-siteexp-useredit.test | 69 +++++++++++++++ 8 files changed, 341 insertions(+), 4 deletions(-) create mode 100755 tests/dejagnu-siteexp-append.test create mode 100755 tests/dejagnu-siteexp-extend.test create mode 100755 tests/dejagnu-siteexp-useredit.test diff --git a/ChangeLog b/ChangeLog index f17c01f..0b66757 100644 =2D-- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2011-02-01 Stefano Lattarini + + dejagnu: allow the package developer to extend site.exp + * lib/am/dejagnu.am (site.exp): Depend from the files listed in + $(EXTRA_DEJAGNU_SITE_CONFIG), if any. Append their contents to + the generated site.exp (still preserving user edits). + * doc/automake.texi (Dejagnu Tests): Update. + * tests/dejagnu-siteexp-append.test: New test. + * tests/dejagnu-siteexp-extend.test: Likewise. + * tests/dejagnu-siteexp-useredit.test: Likewise. + * tests/Makefile.am (TESTS): Update. + Suggestion by Rainer Orth. + 2010-12-10 Stefano Lattarini =20 Extend and improve tests on DejaGnu support. diff --git a/doc/automake.texi b/doc/automake.texi index 5a805b3..63ddaf0 100644 =2D-- a/doc/automake.texi +++ b/doc/automake.texi @@ -8828,6 +8828,14 @@ not the place where the test suite author should def= ine new variables: this should be done elsewhere in the real test suite code. Especially, @file{site.exp} should not be distributed. =20 +Still, if the package author has legitimate reasons to extend +@file{site.exp} at make time, he can do so by defining the variable +@code{EXTRA_DEJAGNU_SITE_CONFIG}; the files listed there will be +considered @file{site.exp} prerequisites, and their content will +be appended to it (in the same order in which they appear in +@code{EXTRA_DEJAGNU_SITE_CONFIG}). Note that files are @emph{not} +distributed by default. + For more information regarding DejaGnu test suites, see @ref{Top, , , dejagnu, The DejaGnu Manual}. =20 diff --git a/lib/am/dejagnu.am b/lib/am/dejagnu.am index 08de45c..8cfb4f0 100644 =2D-- a/lib/am/dejagnu.am +++ b/lib/am/dejagnu.am @@ -72,7 +72,7 @@ check-DEJAGNU: site.exp ## Note that in the rule we don't directly generate site.exp to avoid ## the possibility of a corrupted site.exp if make is interrupted. ## Jim Meyering has some useful text on this topic. =2Dsite.exp: Makefile +site.exp: Makefile $(EXTRA_DEJAGNU_SITE_CONFIG) @echo 'Making a new site.exp file...' @echo '## these variables are automatically generated by make ##' >site.t= mp @echo '# Do not edit here. If you wish to override these values' >>site.= tmp @@ -86,9 +86,17 @@ site.exp: Makefile ?HOST? @echo 'set host_triplet $(host_triplet)' >>site.tmp ?TARGET? @echo 'set target_alias "$(target_alias)"' >>site.tmp ?TARGET? @echo 'set target_triplet $(target_triplet)' >>site.tmp =2D @echo '## All variables above are generated by configure. Do Not Edit #= #' >>site.tmp =2D @test ! -f site.exp || \ =2D sed '1,/^## All variables above are.*##/ d' site.exp >> site.tmp +## Allow the package author to extend site.exp. + @list=3D'$(EXTRA_DEJAGNU_SITE_CONFIG)'; for f in $$list; do \ + echo "## Begin content included from file $$f. Do not modify. ##" \ + && cat `test -f "$$f" || echo '$(srcdir)/'`$$f \ + && echo "## End content included from file $$f. ##" \ + || exit 1; \ + done >> site.tmp + @echo "## End of auto-generated content; you can edit from here. ##" >> s= ite.tmp + @if test -f site.exp; then \ + sed -e '1,/^## End of auto-generated content.*##/d' site.exp >> site.t= mp; \ + fi @-rm -f site.bak @test ! -f site.exp || mv site.exp site.bak @mv site.tmp site.exp diff --git a/tests/Makefile.am b/tests/Makefile.am index 3f40361..d947cb4 100644 =2D-- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -255,6 +255,9 @@ dejagnu4.test \ dejagnu5.test \ dejagnu6.test \ dejagnu7.test \ +dejagnu-siteexp-extend.test \ +dejagnu-siteexp-append.test \ +dejagnu-siteexp-useredit.test \ depacl2.test \ depcomp.test \ depcomp2.test \ diff --git a/tests/Makefile.in b/tests/Makefile.in index 40b4697..323d4db 100644 =2D-- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -523,6 +523,9 @@ dejagnu4.test \ dejagnu5.test \ dejagnu6.test \ dejagnu7.test \ +dejagnu-siteexp-extend.test \ +dejagnu-siteexp-append.test \ +dejagnu-siteexp-useredit.test \ depacl2.test \ depcomp.test \ depcomp2.test \ diff --git a/tests/dejagnu-siteexp-append.test b/tests/dejagnu-siteexp-appe= nd.test new file mode 100755 index 0000000..7bd34ed =2D-- /dev/null +++ b/tests/dejagnu-siteexp-append.test @@ -0,0 +1,72 @@ +#! /bin/sh +# Copyright (C) 2011 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 . + +# Check that the files in $(EXTRA_DEJAGNU_SITE_CONFIG) get appended to +# site.exp in the same order in which they're listed in that variable. + +. ./defs || Exit 1 + +set -e + +cat >> configure.in << 'END' +AC_OUTPUT +END + +cat > Makefile.am << 'END' +AUTOMAKE_OPTIONS =3D dejagnu +DEJATOOL =3D tool +END + +$ACLOCAL +$AUTOCONF +$AUTOMAKE --add-missing + +./configure + +$MAKE site.exp +sed '/^##.*##$/d' site.exp > expected + +cat > foo.exp << 'END' +foo1 +foo2 +foo3 +END + +cat foo.exp - >> expected << 'END' +BAR 1 +# foo +BAR 2 +END + +cat >> Makefile.am << 'END' +EXTRA_DEJAGNU_SITE_CONFIG =3D foo.exp bar.exp +bar.exp: + @(echo 'BAR 1' && echo '# foo' && echo 'BAR 2') > $@ +END + +$AUTOMAKE Makefile +./config.status Makefile + +rm -f site.exp +$MAKE site.exp +sed '/^##.*##$/d' site.exp > obtained + +cat expected +cat site.exp + +diff expected obtained + +: diff --git a/tests/dejagnu-siteexp-extend.test b/tests/dejagnu-siteexp-exte= nd.test new file mode 100755 index 0000000..591267e =2D-- /dev/null +++ b/tests/dejagnu-siteexp-extend.test @@ -0,0 +1,161 @@ +#! /bin/sh +# Copyright (C) 2011 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 . + +# Check that the developer can extend the site.exp generated by the +# automake-generated Makefile. + +required=3Druntest +. ./defs || Exit 1 + +set -e + +write_check_for () +{ + echo "send_user \"$1: \$$1\\n\"" + cat << END +if { \$$1 =3D=3D "/$1/" } { + pass "test_$1" +} else { + fail "test_$1" +} +END +} + +cat >> configure.in << 'END' +AC_OUTPUT +END + +cat > Makefile.am << 'END' +AUTOMAKE_OPTIONS =3D dejagnu +DEJATOOL =3D tool + +EXTRA_DIST =3D tool.test/tool.exp + +EXTRA_DEJAGNU_SITE_CONFIG =3D foo.exp +EXTRA_DIST +=3D foo.exp +END + +echo 'set foo "/foo/"' > foo.exp + +mkdir tool.test +write_check_for foo > tool.test/tool.exp +cat tool.test/tool.exp + +$ACLOCAL +$AUTOCONF +$AUTOMAKE --add-missing + +./configure + +$MAKE check +cat foo.exp +cat site.exp +grep 'PASS: test_foo' tool.sum + +write_check_for bar >> tool.test/tool.exp +write_check_for baz >> tool.test/tool.exp +cat tool.test/tool.exp + +# Ensure that foo.exp will be newer than site.exp, which will +# thus have to be remade. +$sleep +# With this, below we'll also check that settings in files coming later in +# $(EXTRA_DEJAGNU_SITE_CONFIG) override those in files coming earlier. +cat >> foo.exp <<'END' +set bar "/foo/" +set baz "/foo/" +set qux "/foo/" +END + +$MAKE check && { cat site.exp; Exit 1; } +grep 'PASS: test_foo' tool.sum +grep 'FAIL: test_bar' tool.sum +grep 'FAIL: test_baz' tool.sum + +cat >> Makefile.am << 'END' +EXTRA_DEJAGNU_SITE_CONFIG +=3D bar bar.dir/bar +EXTRA_DIST +=3D bar +DISTCLEANFILES =3D bar.dir/bar +bar.dir/bar: + test -d bar.dir || mkdir bar.dir + echo 'set baz "/baz/"' > $@ +END + +echo 'set bar "/bar/"' > bar +# This will allow us to check one more time that settings in files +# coming later in $(EXTRA_DEJAGNU_SITE_CONFIG) override those in +# files coming earlier. +echo 'set baz "/xyz/"' >> bar + +# Ensure that the Makefile will be newer than site.exp, which will +# thus have to be remade. +$sleep +$AUTOMAKE Makefile +./config.status Makefile + +$MAKE check || { cat site.exp; Exit 1; } +cat site.exp +cat bar.dir/bar +$FGREP '/bar/' site.exp +$FGREP '/baz/' site.exp +grep 'PASS: test_foo' tool.sum +grep 'PASS: test_bar' tool.sum +grep 'PASS: test_baz' tool.sum + +# Check that the features we're testing behave well in VPATH builds. +$MAKE distcheck + +# Check that the user can edit the site.exp file, and that his edits +# are retained. +write_check_for zardoz >> tool.test/tool.exp +cat tool.test/tool.exp +echo 'set zardoz "/zardoz/"' >> site.exp + +$MAKE check +cat site.exp +grep 'PASS: test_zardoz' tool.sum + +cat >> Makefile.am << 'END' +EXTRA_DEJAGNU_SITE_CONFIG +=3D quux.exp +quux.exp: + echo 'set zardoz "/quux/"' > $@ +END + +# Ensure that the Makefile will be newer than on site.exp, which will +# thus have to be remade. +$sleep +$AUTOMAKE Makefile +./config.status Makefile +grep 'zardoz.*/quux/' Makefile + +$MAKE site.exp +cat site.exp +cat quux.exp +grep 'zardoz.*/quux/' site.exp + +$MAKE check +grep 'PASS: test_zardoz' tool.sum +grep 'zardoz: /zardoz/' tool.log +grep 'zardoz.*quux' tool.log && Exit 1 + +# Check that files in $(EXTRA_DEJAGNU_SITE_CONFIG) are not distributed +# by default. +$MAKE distdir +ls -l $me-1.0 +test ! -r $me-1.0/bar.dir/bar +test ! -r $me-1.0/quux.exp + +: diff --git a/tests/dejagnu-siteexp-useredit.test b/tests/dejagnu-siteexp-us= eredit.test new file mode 100755 index 0000000..a51bc40 =2D-- /dev/null +++ b/tests/dejagnu-siteexp-useredit.test @@ -0,0 +1,69 @@ +#! /bin/sh +# Copyright (C) 2011 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 . + +# Check that the user can edit the Makefile-generated site.exp, and +# have its edits survive to the remaking of that file. + +. ./defs || Exit 1 + +set -e + +cat >> configure.in << 'END' +AC_OUTPUT +END + +cat > Makefile.am << 'END' +AUTOMAKE_OPTIONS =3D dejagnu +DEJATOOL =3D foo +END + +# Deliberately select a variable defined automatically by +# the Makefile-generated site.exp. +mkdir foo.test +cat > foo.test/foo.exp << 'END' +send_user "objdir: $objdir\n" +set pipe "|" +if { $objdir =3D=3D "${pipe}objdir${pipe}" } { + pass "test_obj" +} else { + fail "test_obj" +} +END + +$ACLOCAL +$AUTOCONF +$AUTOMAKE --add-missing + +./configure + +$MAKE site.exp +echo 'set objdir "|objdir|"' >> site.exp +cat site.exp +$sleep +touch Makefile +$MAKE site.exp +cat site.exp +is_newest site.exp Makefile # Sanity check. +grep '|objdir|' site.exp +test `grep -c '|objdir|' site.exp` -eq 1 + +# We can done a "more semantic" check if DejaGnu is available. +if runtest SOMEPROGRAM=3Dsomeprogram --version; then + $MAKE check + grep 'PASS: test_obj' foo.sum +fi + +: =2D-=20 1.7.2.3 --Boundary-00=_8s8RNV1kZgctSrs-- From debbugs-submit-bounces@debbugs.gnu.org Tue Feb 01 03:59:53 2011 Received: (at control) by debbugs.gnu.org; 1 Feb 2011 08:59:53 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PkC5Y-0005mL-NX for submit@debbugs.gnu.org; Tue, 01 Feb 2011 03:59:52 -0500 Received: from mail-wy0-f172.google.com ([74.125.82.172]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PkC5W-0005lz-MX for control@debbugs.gnu.org; Tue, 01 Feb 2011 03:59:51 -0500 Received: by wyf23 with SMTP id 23so6813809wyf.3 for ; Tue, 01 Feb 2011 01:08:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:subject:date:user-agent:mime-version :content-type:content-transfer-encoding:message-id; bh=zHDgBx6MYFbJyrD05+yJWN7fdFoHhac092bW7HXBEks=; b=Aee9kKX+MJ4n6ecXa9WtKQyG5WzJNqjvVC2xmDVzpOekd8gWHD9vE5V7e1De8PgbDG eKytzzbX42DuNGW5U+e5jNlgF0ScChG2Q4z0AsjQTH9TKgulx32BnP0DRRWDplk9kzuU O+izNPusFiLKqK8ZXnswdujdcKW8yksCqD9YA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:subject:date:user-agent:mime-version:content-type :content-transfer-encoding:message-id; b=t8O2y5mkqrV/LZa+IKedSAkQ3Xyn2hpSjQ7ap+iLIR1Mrci/OF0lVJAQHafzYi/JMW w5Rb86T5kRa0gyWeOPao6ZB68rQIvt4+E4ZLDlv6ZupCQSXSna7vhPTzoivTOjFnuRp9 Z2eCSRExa3eVQtAmy60ZxV19CqQlJYjkUSUzM= Received: by 10.227.128.75 with SMTP id j11mr7314314wbs.60.1296551292907; Tue, 01 Feb 2011 01:08:12 -0800 (PST) Received: from bigio.localnet (host173-92-dynamic.54-82-r.retail.telecomitalia.it [82.54.92.173]) by mx.google.com with ESMTPS id u2sm8698090weh.12.2011.02.01.01.08.11 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 01 Feb 2011 01:08:12 -0800 (PST) From: Stefano Lattarini To: control@debbugs.gnu.org Subject: patches for automake bugs Date: Tue, 1 Feb 2011 10:07:41 +0100 User-Agent: KMail/1.13.3 (Linux/2.6.30-2-686; KDE/4.4.4; i686; ; ) MIME-Version: 1.0 Content-Type: Text/Plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Message-Id: <201102011007.42053.stefano.lattarini@gmail.com> X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.9 (---) tags 7944 patch tags 7873 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Wed Mar 30 04:55:01 2011 Received: (at 7873) by debbugs.gnu.org; 30 Mar 2011 08:55:01 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Q4rB7-000064-53 for submit@debbugs.gnu.org; Wed, 30 Mar 2011 04:55:01 -0400 Received: from mail-ww0-f42.google.com ([74.125.82.42]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Q4rB5-00005s-WF for 7873@debbugs.gnu.org; Wed, 30 Mar 2011 04:55:00 -0400 Received: by wwk4 with SMTP id 4so4145086wwk.3 for <7873@debbugs.gnu.org>; Wed, 30 Mar 2011 01:54:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:subject:date:user-agent:cc:references :in-reply-to:mime-version:content-type:content-transfer-encoding :message-id; bh=ZoUEm10i/zF81dq3RCsACm00QMfLyiVuDeyIX9A+Si4=; b=rT1NK4ytveiyEdHVF4xQICPA6r8/Ho2ZAh9+kq3IQexfpRXKGB+87+EcTbnmPoYFAE qBs+qinylkrDKAEWyNi21iWfpzcOlr5m2FZFvhvg9a9dVriAlY5kdcAKAZnPCpVbDRN5 SXvy/DZAOzH4c5Y1u4bsNsHZtTblGFUuf7OAg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:subject:date:user-agent:cc:references:in-reply-to :mime-version:content-type:content-transfer-encoding:message-id; b=ul7pgzpGhxY6a1rgjvH0gLoA0NZ6uCGAbf3M5Gp91cefnkyKw8YQZukrZ68uWSJWIg YFdG93ZfPtYMhD0RnB5GMB5auTMZyiudtHUrUNYfmRRn+Zb+6O+s6zWbaJa9FPJbczba H+exFMXKLsa6BdD+Xp76WjW2kVMGYaFKMXWYY= Received: by 10.227.160.11 with SMTP id l11mr962931wbx.1.1301475294132; Wed, 30 Mar 2011 01:54:54 -0700 (PDT) Received: from bigio.localnet (host112-90-dynamic.14-87-r.retail.telecomitalia.it [87.14.90.112]) by mx.google.com with ESMTPS id b20sm2890144wbb.33.2011.03.30.01.54.50 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 30 Mar 2011 01:54:51 -0700 (PDT) From: Stefano Lattarini To: Rainer Orth Subject: Re: bug#7873: Automake should support adding to DejaGnu site.exp Date: Wed, 30 Mar 2011 10:54:40 +0200 User-Agent: KMail/1.13.3 (Linux/2.6.30-2-686; KDE/4.4.4; i686; ; ) References: <201102010958.36706.stefano.lattarini@gmail.com> In-Reply-To: <201102010958.36706.stefano.lattarini@gmail.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201103301054.40845.stefano.lattarini@gmail.com> X-Spam-Score: -3.6 (---) X-Debbugs-Envelope-To: 7873 Cc: 7873@debbugs.gnu.org, automake-patches@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.6 (---) Reference: Hello Rainer and all automakers. On Tuesday 01 February 2011, Stefano Lattarini wrote: > On Thursday 20 January 2011, Rainer Orth wrote: > > Currently, Automake doesn't support adding package-specific content to > > the site.exp file generated for DejaGnu testsuites. In GCC alone, three > > testsuites need that facility and have to override the > > Automake-generated target wholesale to achieve what they need: > > > > boehm-gc/testsuite/Makefile.am > > libjava/testsuite/Makefile.am > > libstdc++-v3/testsuite/Makefile.am > > > > These Makefile.am's carry the following comment: > > > > # We need more things in site.exp, but automake completely controls the > > # creation of that file; there's no way to append to it without messing up > > # the dependancy chains. So we overrule automake. This rule is exactly > > # what it would have generated, plus our own additions. > > > > Since in the future it is easily possible that the target/commands > > generated by Automake deviate from what is currently emitted there, > > there should be a Automake facility to directly support adding to the > > generated site.exp. > > > > Thanks. > > Rainer > > > > What about the attached patch? It should be applied to a temporary branch > based off of the commit v1.11-249-g253c2e7 "Extend and improve tests on > DejaGnu support", and could be merged to either maint or master. > -*-*- dejagnu: allow the package developer to extend site.exp * lib/am/dejagnu.am (site.exp): Depend from the files listed in $(EXTRA_DEJAGNU_SITE_CONFIG), if any. Append their contents to the generated site.exp (still preserving user edits). * doc/automake.texi (Dejagnu Tests): Update. * tests/dejagnu-siteexp-append.test: New test. * tests/dejagnu-siteexp-extend.test: Likewise. * tests/dejagnu-siteexp-useredit.test: Likewise. * tests/Makefile.am (TESTS): Update. Suggestion by Rainer Orth. -*-*- Ping on this? Rainer, does this patch really help to solve your problem? If not, why? If yes, do you have enhancements to suggest, or is the patch good enough already? Ralf, do you have objections to the patch? I'll push in 72 hours barring further objections. Regards, Stefano From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 19 04:16:15 2011 Received: (at 7873) by debbugs.gnu.org; 19 Oct 2011 08:16:15 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RGRJu-0000JF-U7 for submit@debbugs.gnu.org; Wed, 19 Oct 2011 04:16:15 -0400 Received: from mail-ww0-f46.google.com ([74.125.82.46]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RGRJr-0000J1-J9 for 7873@debbugs.gnu.org; Wed, 19 Oct 2011 04:16:13 -0400 Received: by wwp14 with SMTP id 14so2077163wwp.15 for <7873@debbugs.gnu.org>; Wed, 19 Oct 2011 01:15:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:subject:date:user-agent:cc:references:in-reply-to :mime-version:content-type:message-id; bh=i3Zq8W3np34320eK/PGRZhhvobP+3IO0dw+qoWEvy04=; b=hE3KKLDRRvZv9EHfMheLU8mCpS0jzsbK1YqGH4CbKh5KyQBuyJAEFTkdcFcklgHr3l J+StVKhiSLQV/QOG0w86f7B+wAPBZ+VUuzI9mvuPM1Ugu2YfFiqPxkiIaT0Eoey6WVcH vrrpMiJPl5exKzDIXHtWHOoJ9BaqSOKhruxSw= Received: by 10.216.0.2 with SMTP id 2mr6580110wea.82.1319012104267; Wed, 19 Oct 2011 01:15:04 -0700 (PDT) Received: from bigio.localnet (host144-99-dynamic.5-87-r.retail.telecomitalia.it. [87.5.99.144]) by mx.google.com with ESMTPS id fy13sm8316164wbb.18.2011.10.19.01.14.59 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 19 Oct 2011 01:15:00 -0700 (PDT) From: Stefano Lattarini To: Rainer Orth Subject: Re: bug#7873: Automake should support adding to DejaGnu site.exp Date: Wed, 19 Oct 2011 10:14:50 +0200 User-Agent: KMail/1.13.7 (Linux/2.6.30-2-686; KDE/4.6.5; i686; ; ) References: <201102010958.36706.stefano.lattarini@gmail.com> In-Reply-To: <201102010958.36706.stefano.lattarini@gmail.com> MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_7bonOMbBm/7VbGt" Message-Id: <201110191014.51773.stefano.lattarini@gmail.com> X-Spam-Score: -4.1 (----) X-Debbugs-Envelope-To: 7873 Cc: 7873@debbugs.gnu.org, automake-patches@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -4.1 (----) --Boundary-00=_7bonOMbBm/7VbGt Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Reference: I've rebased the branch on the "fixup" commit `v1.11-250-g0c0b402', and I will merge it to maint (and push) in a couple of days if there is no objection by then. The updated patch is attached, for reference. Regards, Stefano --Boundary-00=_7bonOMbBm/7VbGt Content-Type: text/x-patch; charset="utf-8"; name="0001-dejagnu-allow-the-package-developer-to-extend-site.e.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline; filename="0001-dejagnu-allow-the-package-developer-to-extend-site.e.patch" =46rom 515850a177bb2effd5d3fdb3de8b4b0f64f78dbb Mon Sep 17 00:00:00 2001 Message-Id: <515850a177bb2effd5d3fdb3de8b4b0f64f78dbb.1319012048.git.stefan= o.lattarini@gmail.com> =46rom: Stefano Lattarini Date: Tue, 1 Feb 2011 09:52:43 +0100 Subject: [PATCH] dejagnu: allow the package developer to extend site.exp =46ixes automake bug#7873. * lib/am/dejagnu.am (site.exp): Depend from the files listed in $(EXTRA_DEJAGNU_SITE_CONFIG), if any. Append their contents to the generated site.exp (still preserving user edits). * doc/automake.texi (Dejagnu Tests): Update. * tests/dejagnu-siteexp-append.test: New test. * tests/dejagnu-siteexp-extend.test: Likewise. * tests/dejagnu-siteexp-useredit.test: Likewise. * tests/Makefile.am (TESTS): Update. Suggestion by Rainer Orth. =2D-- ChangeLog | 14 +++ doc/automake.texi | 8 ++ lib/am/dejagnu.am | 16 +++- tests/Makefile.am | 3 + tests/Makefile.in | 3 + tests/dejagnu-siteexp-append.test | 72 ++++++++++++++++ tests/dejagnu-siteexp-extend.test | 161 +++++++++++++++++++++++++++++++= ++++ tests/dejagnu-siteexp-useredit.test | 69 +++++++++++++++ 8 files changed, 342 insertions(+), 4 deletions(-) create mode 100755 tests/dejagnu-siteexp-append.test create mode 100755 tests/dejagnu-siteexp-extend.test create mode 100755 tests/dejagnu-siteexp-useredit.test diff --git a/ChangeLog b/ChangeLog index 8884b59..154c11f 100644 =2D-- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,17 @@ +2011-10-19 Stefano Lattarini + + dejagnu: allow the package developer to extend site.exp + Fixes automake bug#7873. + * lib/am/dejagnu.am (site.exp): Depend from the files listed in + $(EXTRA_DEJAGNU_SITE_CONFIG), if any. Append their contents to + the generated site.exp (still preserving user edits). + * doc/automake.texi (Dejagnu Tests): Update. + * tests/dejagnu-siteexp-append.test: New test. + * tests/dejagnu-siteexp-extend.test: Likewise. + * tests/dejagnu-siteexp-useredit.test: Likewise. + * tests/Makefile.am (TESTS): Update. + Suggestion by Rainer Orth. + 2010-12-13 Ralf Wildenhues =20 Fix testsuite failure of check12.test without DejaGNU. diff --git a/doc/automake.texi b/doc/automake.texi index 5a805b3..c1af165 100644 =2D-- a/doc/automake.texi +++ b/doc/automake.texi @@ -8828,6 +8828,14 @@ not the place where the test suite author should def= ine new variables: this should be done elsewhere in the real test suite code. Especially, @file{site.exp} should not be distributed. =20 +Still, if the package author has legitimate reasons to extend +@file{site.exp} at @command{make} time, he can do so by defining +the variable @code{EXTRA_DEJAGNU_SITE_CONFIG}; the files listed +there will be considered @file{site.exp} prerequisites, and their +content will be appended to it (in the same order in which they +appear in @code{EXTRA_DEJAGNU_SITE_CONFIG}). Note that files are +@emph{not} distributed by default. + For more information regarding DejaGnu test suites, see @ref{Top, , , dejagnu, The DejaGnu Manual}. =20 diff --git a/lib/am/dejagnu.am b/lib/am/dejagnu.am index 08de45c..8cfb4f0 100644 =2D-- a/lib/am/dejagnu.am +++ b/lib/am/dejagnu.am @@ -72,7 +72,7 @@ check-DEJAGNU: site.exp ## Note that in the rule we don't directly generate site.exp to avoid ## the possibility of a corrupted site.exp if make is interrupted. ## Jim Meyering has some useful text on this topic. =2Dsite.exp: Makefile +site.exp: Makefile $(EXTRA_DEJAGNU_SITE_CONFIG) @echo 'Making a new site.exp file...' @echo '## these variables are automatically generated by make ##' >site.t= mp @echo '# Do not edit here. If you wish to override these values' >>site.= tmp @@ -86,9 +86,17 @@ site.exp: Makefile ?HOST? @echo 'set host_triplet $(host_triplet)' >>site.tmp ?TARGET? @echo 'set target_alias "$(target_alias)"' >>site.tmp ?TARGET? @echo 'set target_triplet $(target_triplet)' >>site.tmp =2D @echo '## All variables above are generated by configure. Do Not Edit #= #' >>site.tmp =2D @test ! -f site.exp || \ =2D sed '1,/^## All variables above are.*##/ d' site.exp >> site.tmp +## Allow the package author to extend site.exp. + @list=3D'$(EXTRA_DEJAGNU_SITE_CONFIG)'; for f in $$list; do \ + echo "## Begin content included from file $$f. Do not modify. ##" \ + && cat `test -f "$$f" || echo '$(srcdir)/'`$$f \ + && echo "## End content included from file $$f. ##" \ + || exit 1; \ + done >> site.tmp + @echo "## End of auto-generated content; you can edit from here. ##" >> s= ite.tmp + @if test -f site.exp; then \ + sed -e '1,/^## End of auto-generated content.*##/d' site.exp >> site.t= mp; \ + fi @-rm -f site.bak @test ! -f site.exp || mv site.exp site.bak @mv site.tmp site.exp diff --git a/tests/Makefile.am b/tests/Makefile.am index 3f40361..d947cb4 100644 =2D-- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -255,6 +255,9 @@ dejagnu4.test \ dejagnu5.test \ dejagnu6.test \ dejagnu7.test \ +dejagnu-siteexp-extend.test \ +dejagnu-siteexp-append.test \ +dejagnu-siteexp-useredit.test \ depacl2.test \ depcomp.test \ depcomp2.test \ diff --git a/tests/Makefile.in b/tests/Makefile.in index 40b4697..323d4db 100644 =2D-- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -523,6 +523,9 @@ dejagnu4.test \ dejagnu5.test \ dejagnu6.test \ dejagnu7.test \ +dejagnu-siteexp-extend.test \ +dejagnu-siteexp-append.test \ +dejagnu-siteexp-useredit.test \ depacl2.test \ depcomp.test \ depcomp2.test \ diff --git a/tests/dejagnu-siteexp-append.test b/tests/dejagnu-siteexp-appe= nd.test new file mode 100755 index 0000000..7bd34ed =2D-- /dev/null +++ b/tests/dejagnu-siteexp-append.test @@ -0,0 +1,72 @@ +#! /bin/sh +# Copyright (C) 2011 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 . + +# Check that the files in $(EXTRA_DEJAGNU_SITE_CONFIG) get appended to +# site.exp in the same order in which they're listed in that variable. + +. ./defs || Exit 1 + +set -e + +cat >> configure.in << 'END' +AC_OUTPUT +END + +cat > Makefile.am << 'END' +AUTOMAKE_OPTIONS =3D dejagnu +DEJATOOL =3D tool +END + +$ACLOCAL +$AUTOCONF +$AUTOMAKE --add-missing + +./configure + +$MAKE site.exp +sed '/^##.*##$/d' site.exp > expected + +cat > foo.exp << 'END' +foo1 +foo2 +foo3 +END + +cat foo.exp - >> expected << 'END' +BAR 1 +# foo +BAR 2 +END + +cat >> Makefile.am << 'END' +EXTRA_DEJAGNU_SITE_CONFIG =3D foo.exp bar.exp +bar.exp: + @(echo 'BAR 1' && echo '# foo' && echo 'BAR 2') > $@ +END + +$AUTOMAKE Makefile +./config.status Makefile + +rm -f site.exp +$MAKE site.exp +sed '/^##.*##$/d' site.exp > obtained + +cat expected +cat site.exp + +diff expected obtained + +: diff --git a/tests/dejagnu-siteexp-extend.test b/tests/dejagnu-siteexp-exte= nd.test new file mode 100755 index 0000000..591267e =2D-- /dev/null +++ b/tests/dejagnu-siteexp-extend.test @@ -0,0 +1,161 @@ +#! /bin/sh +# Copyright (C) 2011 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 . + +# Check that the developer can extend the site.exp generated by the +# automake-generated Makefile. + +required=3Druntest +. ./defs || Exit 1 + +set -e + +write_check_for () +{ + echo "send_user \"$1: \$$1\\n\"" + cat << END +if { \$$1 =3D=3D "/$1/" } { + pass "test_$1" +} else { + fail "test_$1" +} +END +} + +cat >> configure.in << 'END' +AC_OUTPUT +END + +cat > Makefile.am << 'END' +AUTOMAKE_OPTIONS =3D dejagnu +DEJATOOL =3D tool + +EXTRA_DIST =3D tool.test/tool.exp + +EXTRA_DEJAGNU_SITE_CONFIG =3D foo.exp +EXTRA_DIST +=3D foo.exp +END + +echo 'set foo "/foo/"' > foo.exp + +mkdir tool.test +write_check_for foo > tool.test/tool.exp +cat tool.test/tool.exp + +$ACLOCAL +$AUTOCONF +$AUTOMAKE --add-missing + +./configure + +$MAKE check +cat foo.exp +cat site.exp +grep 'PASS: test_foo' tool.sum + +write_check_for bar >> tool.test/tool.exp +write_check_for baz >> tool.test/tool.exp +cat tool.test/tool.exp + +# Ensure that foo.exp will be newer than site.exp, which will +# thus have to be remade. +$sleep +# With this, below we'll also check that settings in files coming later in +# $(EXTRA_DEJAGNU_SITE_CONFIG) override those in files coming earlier. +cat >> foo.exp <<'END' +set bar "/foo/" +set baz "/foo/" +set qux "/foo/" +END + +$MAKE check && { cat site.exp; Exit 1; } +grep 'PASS: test_foo' tool.sum +grep 'FAIL: test_bar' tool.sum +grep 'FAIL: test_baz' tool.sum + +cat >> Makefile.am << 'END' +EXTRA_DEJAGNU_SITE_CONFIG +=3D bar bar.dir/bar +EXTRA_DIST +=3D bar +DISTCLEANFILES =3D bar.dir/bar +bar.dir/bar: + test -d bar.dir || mkdir bar.dir + echo 'set baz "/baz/"' > $@ +END + +echo 'set bar "/bar/"' > bar +# This will allow us to check one more time that settings in files +# coming later in $(EXTRA_DEJAGNU_SITE_CONFIG) override those in +# files coming earlier. +echo 'set baz "/xyz/"' >> bar + +# Ensure that the Makefile will be newer than site.exp, which will +# thus have to be remade. +$sleep +$AUTOMAKE Makefile +./config.status Makefile + +$MAKE check || { cat site.exp; Exit 1; } +cat site.exp +cat bar.dir/bar +$FGREP '/bar/' site.exp +$FGREP '/baz/' site.exp +grep 'PASS: test_foo' tool.sum +grep 'PASS: test_bar' tool.sum +grep 'PASS: test_baz' tool.sum + +# Check that the features we're testing behave well in VPATH builds. +$MAKE distcheck + +# Check that the user can edit the site.exp file, and that his edits +# are retained. +write_check_for zardoz >> tool.test/tool.exp +cat tool.test/tool.exp +echo 'set zardoz "/zardoz/"' >> site.exp + +$MAKE check +cat site.exp +grep 'PASS: test_zardoz' tool.sum + +cat >> Makefile.am << 'END' +EXTRA_DEJAGNU_SITE_CONFIG +=3D quux.exp +quux.exp: + echo 'set zardoz "/quux/"' > $@ +END + +# Ensure that the Makefile will be newer than on site.exp, which will +# thus have to be remade. +$sleep +$AUTOMAKE Makefile +./config.status Makefile +grep 'zardoz.*/quux/' Makefile + +$MAKE site.exp +cat site.exp +cat quux.exp +grep 'zardoz.*/quux/' site.exp + +$MAKE check +grep 'PASS: test_zardoz' tool.sum +grep 'zardoz: /zardoz/' tool.log +grep 'zardoz.*quux' tool.log && Exit 1 + +# Check that files in $(EXTRA_DEJAGNU_SITE_CONFIG) are not distributed +# by default. +$MAKE distdir +ls -l $me-1.0 +test ! -r $me-1.0/bar.dir/bar +test ! -r $me-1.0/quux.exp + +: diff --git a/tests/dejagnu-siteexp-useredit.test b/tests/dejagnu-siteexp-us= eredit.test new file mode 100755 index 0000000..a51bc40 =2D-- /dev/null +++ b/tests/dejagnu-siteexp-useredit.test @@ -0,0 +1,69 @@ +#! /bin/sh +# Copyright (C) 2011 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 . + +# Check that the user can edit the Makefile-generated site.exp, and +# have its edits survive to the remaking of that file. + +. ./defs || Exit 1 + +set -e + +cat >> configure.in << 'END' +AC_OUTPUT +END + +cat > Makefile.am << 'END' +AUTOMAKE_OPTIONS =3D dejagnu +DEJATOOL =3D foo +END + +# Deliberately select a variable defined automatically by +# the Makefile-generated site.exp. +mkdir foo.test +cat > foo.test/foo.exp << 'END' +send_user "objdir: $objdir\n" +set pipe "|" +if { $objdir =3D=3D "${pipe}objdir${pipe}" } { + pass "test_obj" +} else { + fail "test_obj" +} +END + +$ACLOCAL +$AUTOCONF +$AUTOMAKE --add-missing + +./configure + +$MAKE site.exp +echo 'set objdir "|objdir|"' >> site.exp +cat site.exp +$sleep +touch Makefile +$MAKE site.exp +cat site.exp +is_newest site.exp Makefile # Sanity check. +grep '|objdir|' site.exp +test `grep -c '|objdir|' site.exp` -eq 1 + +# We can done a "more semantic" check if DejaGnu is available. +if runtest SOMEPROGRAM=3Dsomeprogram --version; then + $MAKE check + grep 'PASS: test_obj' foo.sum +fi + +: =2D-=20 1.7.2.3 --Boundary-00=_7bonOMbBm/7VbGt-- From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 22 14:55:05 2011 Received: (at 7873-done) by debbugs.gnu.org; 22 Oct 2011 18:55:05 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RHgin-0005gt-N3 for submit@debbugs.gnu.org; Sat, 22 Oct 2011 14:55:05 -0400 Received: from mail-ww0-f46.google.com ([74.125.82.46]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RHgil-0005fp-TI for 7873-done@debbugs.gnu.org; Sat, 22 Oct 2011 14:55:04 -0400 Received: by wwp14 with SMTP id 14so7109437wwp.15 for <7873-done@debbugs.gnu.org>; Sat, 22 Oct 2011 11:53:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:subject:date:user-agent:cc:references:in-reply-to :mime-version:content-type:content-transfer-encoding:message-id; bh=yI1ZsofkMDqRskQQR1dOb547c6HKasBiiUl/Yo/Xu6U=; b=eJr9f/Q62vBPpnq/I3XWe0YHrn54rnV2ET/wftz1D+Dt/VtofxN0orrvAdJj86tl2f GwIunu6DN/KpGx+G2BiF1tdh36jsrmAo7KpOp003ThreXMowTO39VI9J1FuNRJLhKRC0 GTHwJomKvE66gdYjuNcK0oEluOyEqgV7WXdNE= Received: by 10.227.23.202 with SMTP id s10mr7264276wbb.85.1319309616887; Sat, 22 Oct 2011 11:53:36 -0700 (PDT) Received: from bigio.localnet (host157-90-dynamic.14-87-r.retail.telecomitalia.it. [87.14.90.157]) by mx.google.com with ESMTPS id q30sm29014299wbn.17.2011.10.22.11.53.35 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 22 Oct 2011 11:53:35 -0700 (PDT) From: Stefano Lattarini To: Rainer Orth Subject: Re: bug#7873: Automake should support adding to DejaGnu site.exp Date: Sat, 22 Oct 2011 20:53:25 +0200 User-Agent: KMail/1.13.7 (Linux/2.6.30-2-686; KDE/4.6.5; i686; ; ) References: <201102010958.36706.stefano.lattarini@gmail.com> <201110191014.51773.stefano.lattarini@gmail.com> In-Reply-To: <201110191014.51773.stefano.lattarini@gmail.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201110222053.26290.stefano.lattarini@gmail.com> X-Spam-Score: -3.7 (---) X-Debbugs-Envelope-To: 7873-done Cc: automake-patches@gnu.org, 7873-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.7 (---) On Wednesday 19 October 2011, Stefano Lattarini wrote: > Reference: > > > I've rebased the branch on the "fixup" commit `v1.11-250-g0c0b402', and > I will merge it to maint (and push) in a couple of days if there is no > objection by then. The updated patch is attached, for reference. > I've added the NEWS entry below, and pushed. I'm thus closing this bug report. Regards, Stefano -*-*- diff --git a/NEWS b/NEWS index 6bc0d6f..e42d53c 100644 --- a/NEWS +++ b/NEWS @@ -5,6 +5,10 @@ New in 1.11.0a: - The `lzma' compression scheme and associated automake option `dist-lzma' is obsoleted by `xz' and `dist-xz' due to upstream changes. + - When using DejaGnu-based testsuites, the user can extend the `site.exp' + file generated by automake-provided rules by defining the special make + variable `$(EXTRA_DEJAGNU_SITE_CONFIG)'. + Bugs fixed in 1.11.0a: * Bugs introduced by 1.11: From unknown Thu Jun 19 14:04:35 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 20 Nov 2011 12:24:03 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator