From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS22989 209.51.188.0/24 X-Spam-Status: No, score=-3.9 required=3.0 tests=AWL,BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id A38AF1F5AE for ; Fri, 14 May 2021 17:49:03 +0000 (UTC) Received: from localhost ([::1]:59400 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lhbvq-0004ZC-Ma for normalperson@yhbt.net; Fri, 14 May 2021 13:49:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39174) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lhbmH-0008AU-UT for bug-gnulib@gnu.org; Fri, 14 May 2021 13:39:11 -0400 Received: from uggla.sjd.se ([2001:9b1:8633::107]:43668) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lhbm6-0002pT-MY for bug-gnulib@gnu.org; Fri, 14 May 2021 13:39:05 -0400 DKIM-Signature: v=1; a=ed25519-sha256; q=dns/txt; c=relaxed/relaxed; d=josefsson.org; s=ed2101; h=Content-Type:MIME-Version:Message-ID:In-Reply-To :Date:References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding :Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=Yl688EWvs2SGHw/Kdn3X/RMrOzA9vY3qQjF+4Ygf5/8=; t=1621013929; x=1622223529; b=MEMjKXDn557iE2HY23OB9BWYhCYWFykvyYMshVAmd0H+1N/GWYJggcZRDHOCJyIehZErL7pD2h UackFSVXuRAA==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=josefsson.org; s=rsa2101; h=Content-Type:MIME-Version:Message-ID: In-Reply-To:Date:References:Subject:Cc:To:From:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=Yl688EWvs2SGHw/Kdn3X/RMrOzA9vY3qQjF+4Ygf5/8=; t=1621013929; x=1622223529; b=YxASP/A+7OeLeeINH4Ld8D72PtdwZEe4diuKi4J7apEfbFgkOZh2wJvTFR/m3LACAZEe8/EMPJ jGCJgefDzJCcvVrfDyGOItEYfQa26SbBJ2mEb2NfXTG3bIBWUpcgLv0EAdMSciTMVOH0tqdoWf3ds S8I1kj09TAw9iamVKOnC6ikvjeOqsDXfdKRggAQmqlX4w54z7GcMUBLDQ7V9r/Tq2twIiwRL03xpD zeOmHfJfOdy4yBqwfg8nreFGTTIU11Wm+N82qwbvXFslGvr0ReRBDsrkM6d6E3UlVWzVSRryYRm51 e+gef39J9lvKLGxPR1LhB8srLUyM+WEYVBzBOGY0EEwDmwBRn60SMsZtYyln3XKSiHDRQ/7SgjhOd /hvoQ2PcxWjYdow0im3sqMsUiw/eD3C0d5oYHWIcC3JZ3A0ErE9Rz+P1vzeZtLCna3EYhne0N2 ; Received: from [2001:9b1:41ac:ff00:d573:7565:e01a:ce5b] (port=36278 helo=latte) by uggla.sjd.se with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lhblu-0001Mo-4y; Fri, 14 May 2021 17:38:46 +0000 To: Bruno Haible Cc: bug-gnulib@gnu.org Subject: Re: [PATCH] valgrind-tests: Better option handling. References: <87lf8hxzxx.fsf@latte.josefsson.org> <2293202.2TyCXrTQu3@omega> OpenPGP: id=B1D2BD1375BECB784CF4F8C4D73CF638C53C06BE; url=https://josefsson.org/key-20190320.txt X-Hashcash: 1:22:210514:bruno@clisp.org::rIwyWefM4+q2MrAh:1Xk X-Hashcash: 1:22:210514:bug-gnulib@gnu.org::vxAMIwz30Yd/qZDf:2KKP Date: Fri, 14 May 2021 19:38:45 +0200 In-Reply-To: <2293202.2TyCXrTQu3@omega> (Bruno Haible's message of "Fri, 14 May 2021 15:47:24 +0200") Message-ID: <87o8ddw6ze.fsf@latte.josefsson.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Received-SPF: pass client-ip=2001:9b1:8633::107; envelope-from=simon@josefsson.org; helo=uggla.sjd.se X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: bug-gnulib@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Gnulib discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnulib-bounces+normalperson=yhbt.net@gnu.org Sender: "bug-gnulib" Reply-to: Simon Josefsson From: Simon Josefsson via Gnulib discussion list --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain Bruno Haible writes: > Hi Simon, > >> +Replace @code{LOG_COMPILER} with @code{TESTS_ENVIRONMENT} if you are >> +using the old serial test harness. > > Assuming I am a GNU package maintainer and I read this paragraph. How do > I know whether my package uses the "old serial test harness"? Can I > determine this by looking at configure.ac? Or at the main Makefile.am? I suspect almost everyone is using the parallel test harness now since it is the default since automake 1.11.3, however I clarified the manual, does it look okay? I fixed some more things to make it actual work too. Another read through the manual section would be welcome to make sure it is now correct and complete. Review of the recent changes to valgrind-tests.m4 is also appreciated - I didn't want to break backwards compatibility for the VALGRIND variable so it became a bit complicated. Also I'm not sure what the best names to use for variables are. If we want to fix anything, let's do it relatively soon before people start to use the new version. /Simon --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-valgrind-tests-Doc-fix-and-introduce-AM_VALGRINDFLAG.patch Content-Transfer-Encoding: quoted-printable From=2093be8dd0d91d7e547a83ab3a8c498b2a61a17b75 Mon Sep 17 00:00:00 2001 From: Simon Josefsson Date: Fri, 14 May 2021 19:23:23 +0200 Subject: [PATCH] valgrind-tests: Doc fix and introduce AM_VALGRINDFLAGS. * doc/valgrind-tests.texi (Using valgrind automatically): Clarify when the parallel vs serial test harness is used, suggested by Bruno Haible . * m4/valgrind-tests.m4: Add VALGRIND_PROGRAM and AM_VALGRINDFLAGS. =2D-- ChangeLog | 8 ++++++++ doc/valgrind-tests.texi | 22 +++++++++++++++++----- m4/valgrind-tests.m4 | 25 ++++++++++++++++++------- 3 files changed, 43 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index 191f4549e..136445e8f 100644 =2D-- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2021-05-14 Simon Josefsson + + valgrind-tests: Doc fix and introduce AM_VALGRINDFLAGS. + * doc/valgrind-tests.texi (Using valgrind automatically): Clarify + when the parallel vs serial test harness is used, suggested by + Bruno Haible . + * m4/valgrind-tests.m4: Add VALGRIND_PROGRAM and AM_VALGRINDFLAGS. + 2021-05-14 Bruno Haible =20 malloc-gnu, realloc-gnu, calloc-gnu: Ensure errno gets set to ENOMEM. diff --git a/doc/valgrind-tests.texi b/doc/valgrind-tests.texi index 9f3b30968..96a6bbbee 100644 =2D-- a/doc/valgrind-tests.texi +++ b/doc/valgrind-tests.texi @@ -34,7 +34,11 @@ LOG_COMPILER =3D $(LOG_VALGRIND) This will run all self-checks under valgrind. =20 Replace @code{LOG_COMPILER} with @code{TESTS_ENVIRONMENT} if you are =2Dusing the old serial test harness. +using the old serial test harness. The parallel test harness has been +the default in automake since version 1.11.3, but if you are using an +older automake, or put @samp{serial-tests} in +@samp{AM_INIT_AUTOMAKE}/@samp{AUTOMAKE_OPTIONS} you would still be using +the serial test harness. =20 If you desire a project-wide decision that valgrind is not enabled by default, but still allow users to enable it with @@ -54,13 +58,13 @@ that are passed to valgrind using the @samp{VALGRINDFLA= GS} variable, for example: =20 @smallexample =2D./configure VALGRINDFLAGS=3D"--suppressions=3D/your/local/valgrind/suppr= essions/file.txt" +./configure VALGRINDFLAGS=3D"--suppressions=3D~/local.supp" @end smallexample =20 Alternatively during build phase: =20 @smallexample =2Dmake check VALGRINDFLAGS=3D"--suppressions=3D/your/local/valgrind/suppre= ssions/file.txt" +make check VALGRINDFLAGS=3D"--suppressions=3D~/local.supp" @end smallexample =20 This is useful if you have a valgrind suppression files that are needed @@ -106,6 +110,14 @@ gl_INIT Note that any user-supplied @code{VALGRINDFLAGS} value is preserved, which is usually what you want. =20 +Finally, as a developer you may want to provide additional per-directory +options to valgrind and the @code{AM_VALGRINDFLAGS} variable can be used +for this. For example: + +@smallexample +AM_VALGRINDFLAGS =3D --suppressions=3D$(srcdir)/local-valgrind.supp +LOG_COMPILER =3D $(LOG_VALGRIND) +@end smallexample =20 @node Using valgrind manually @subsection Using valgrind at the developer's discretion @@ -142,8 +154,8 @@ LOG_COMPILER =3D $(LOG_VALGRIND) =20 Then valgrind will only be used for the non-.sh and non-.pl tests. =20 =2DFor old automake, you will need @code{AUTOMAKE_OPTIONS =3D parallel-test= s} =2Dto enable the parallel test harness. +For old automake (before 1.11.3), you will need @code{AUTOMAKE_OPTIONS =3D +parallel-tests} to enable the parallel test harness. =20 @item You can make use of the @code{build-aux/run-test} script from Gnulib. diff --git a/m4/valgrind-tests.m4 b/m4/valgrind-tests.m4 index b6b46a496..772737266 100644 =2D-- a/m4/valgrind-tests.m4 +++ b/m4/valgrind-tests.m4 @@ -13,10 +13,10 @@ dnl From Simon Josefsson # Sets VALGRIND to command line (including options) to invoke valgrind # with, may be used directly in autoconf, makefiles or shell scripts. =20 =2D# Sets LOG_VALGRIND, suitable for use with LOG_COMPILER, that in a =2D# makefile will expand to command line to invoke self-tests with, +# Sets LOG_VALGRIND, suitable for use with LOG_COMPILER, that in +# Makefile will expand to command line to invoke self-tests with, # i.e., LOG_VALGRIND =3D $(VALGRIND) $(DEFAULT_VALGRINDFLAGS) =2D# $(VALGRINDFLAGS). +# $(VALGRINDFLAGS) $(AM_VALGRINDFLAGS). =20 # Whether to look for valgrind and set the variables can be influenced # by calling gl_VALGRIND_TESTS_DEFAULT_NO in configure.ac. @@ -26,7 +26,8 @@ dnl From Simon Josefsson # You may modify the VALGRIND, DEFAULT_VALGRINDFLAGS and VALGRINDFLAGS # variables before calling this function to override defaults. Either # as developer from configure.ac or user on the ./configure command =2D# line. +# line. You may set the AM_VALGRINDFLAGS in Makefile.am to provide a +# per-directory additional flag. =20 AC_DEFUN([gl_VALGRIND_TESTS_DEFAULT_NO], [ @@ -44,6 +45,13 @@ AC_DEFUN_ONCE([gl_VALGRIND_TESTS], if test "$opt_valgrind_tests" =3D "yes" && test "$cross_compiling" =3D n= o; then AC_CHECK_PROGS([VALGRIND], [valgrind]) =20 + # VALGRIND_PROGRAM contains the tool found by AC_CHECK_PROGS. For + # backwards compatibility, the VALGRIND variable is later modified + # to also include all enabled options. However the new variable + # LOG_VALGRIND needs to be able to refer to the valgrind tool + # without options, hence it uses this variable. + AC_SUBST([VALGRIND_PROGRAM], [$VALGRIND]) + AC_SUBST([DEFAULT_VALGRINDFLAGS]) if test -z "$DEFAULT_VALGRINDFLAGS"; then DEFAULT_VALGRINDFLAGS=3D"-q --error-exitcode=3D1 --leak-check=3Dfull" @@ -81,12 +89,15 @@ AC_DEFUN_ONCE([gl_VALGRIND_TESTS], ]) fi =20 + AC_SUBST([AM_VALGRINDFLAGS]) + AC_SUBST([LOG_VALGRIND], ["\$(VALGRIND_PROGRAM) \$(DEFAULT_VALGRINDFLA= GS) \$(VALGRINDFLAGS) \$(AM_VALGRINDFLAGS)"]) + if test "$gl_cv_prog_valgrind_works" !=3D yes; then + DEFAULT_VALGRINDFLAGS=3D + LOG_VALGRIND=3D VALGRIND=3D VALGRINDFLAGS=3D =2D DEFAULT_VALGRINDFLAGS=3D + VALGRIND_PROGRAM=3D fi =2D =2D AC_SUBST([LOG_VALGRIND], ["\$(VALGRIND) \$(DEFAULT_VALGRINDFLAGS) \$(= VALGRINDFLAGS)"]) fi ]) =2D-=20 2.20.1 --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEARYIAB0WIQSjzJyHC50xCrrUzy9RcisI/kdFogUCYJ61pQAKCRBRcisI/kdF orTdAP98QxnJZTDCnkMXaq1+3Sk65jD8GpUe2cRMLhB+OEVxggEArFnCABOQ9uQj zj6rMcTtuvjCOuOvisUTxjknPUxHYAA= =vtgN -----END PGP SIGNATURE----- --==-=-=--