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.8 required=3.0 tests=AWL,BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,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 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 75FF11F453 for ; Fri, 15 Feb 2019 20:32:36 +0000 (UTC) Received: from localhost ([127.0.0.1]:45925 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1guk9y-0007Pk-4Q for normalperson@yhbt.net; Fri, 15 Feb 2019 15:32:34 -0500 Received: from eggs.gnu.org ([209.51.188.92]:45094) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1guk9t-0007PS-PG for bug-gnulib@gnu.org; Fri, 15 Feb 2019 15:32:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1guk9o-0000iQ-RO for bug-gnulib@gnu.org; Fri, 15 Feb 2019 15:32:27 -0500 Received: from mo6-p00-ob.smtp.rzone.de ([2a01:238:20a:202:5300::6]:16255) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1guk9n-0000df-U7 for bug-gnulib@gnu.org; Fri, 15 Feb 2019 15:32:24 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1550262739; s=strato-dkim-0002; d=clisp.org; h=Message-ID:Date:Subject:To:From:X-RZG-CLASS-ID:X-RZG-AUTH:From: Subject:Sender; bh=hYbTSB3l7p/insb3IiyGiZWUMn2CyiuwrjQJGoY5wYc=; b=ntl79ZJbzmlStC0a9dhfxqfHAui/kgVuWUo/VhxGuirSf2tQVZxPTQSvoTAQiGDR8e oVQJd0wmETRKPkDuK/89DXdJfy2Tt5gntYl0JOxhG9MiD+RnX6sPa5VV4KbTbJor5876 dhS353XRhZVbLOkBGTdNPygQG/9fP4knucsYu22mhGZUMPdGqt4VyzWBxROTN1oGnplj /8u2Nf34l9D8Y9+vbWR16c2HPCJCGdZAer3I17/QSa+WlRongRJ0yMTZtrBWqvAkZwdC W9yxkzfUaxUu6Tlh0EDObzLrdirAGWEigaLueMCK72lono4Ec9ErHd5E4xFDoHiGwFTK L+4g== X-RZG-AUTH: ":Ln4Re0+Ic/6oZXR1YgKryK8brlshOcZlIWs+iCP5vnk6shH+AHjwLuWOGaf3zJZW" X-RZG-CLASS-ID: mo00 Received: from bruno.haible.de by smtp.strato.de (RZmta 44.9 DYNA|AUTH) with ESMTPSA id v0a34ev1FKWIXLL (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (curve secp521r1 with 521 ECDH bits, eq. 15360 bits RSA)) (Client did not present a certificate); Fri, 15 Feb 2019 21:32:18 +0100 (CET) From: Bruno Haible To: bug-gnulib@gnu.org Subject: gnulib-tool: Support --import with just a few tests, not --with-tests Date: Fri, 15 Feb 2019 21:32:17 +0100 Message-ID: <3290377.oc7OflZSJH@omega> User-Agent: KMail/5.1.3 (Linux/4.4.0-141-generic; KDE/5.18.0; x86_64; ; ) MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a01:238:20a:202:5300::6 X-BeenThere: bug-gnulib@gnu.org X-Mailman-Version: 2.1.21 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" Sometimes it is useful to have, in your package, only a few hand-picked tests, not all tests in the transitive closure of the imported gnulib modules. For example, when the package creates a library with a limited set of exported symbols, most gnulib tests would access symbols that are not exported from the library. Using --avoid would be too unmaintainable, since the set of tests computed by the transitive closure algorithm is subject to change without notice. This patch implements this possibility. 2019-02-15 Bruno Haible gnulib-tool: Support --import with just a few tests, not --with-tests. * gnulib-tool (func_import): New variable 'gentests'. Use it instead of 'inctests' when generating files; use 'inctests' only for computing the transitive closure. diff --git a/gnulib-tool b/gnulib-tool index 3dc9a1d..34d198f 100755 --- a/gnulib-tool +++ b/gnulib-tool @@ -5107,6 +5107,14 @@ s,^\(.................................................[^ ]*\) *, s,^top/,$rewritten, s,^$rewritten,," + # Determine whether to put anything into $testsbase. + testsfiles=`echo "$files" | sed -n -e 's,^tests/,,p' -e 's,^tests=lib/,,p'` + if test -n "$testsfiles"; then + gentests=true + else + gentests=false + fi + # Create directories. { echo "$sourcebase" echo "$m4base" @@ -5117,7 +5125,7 @@ s,^\(.................................................[^ ]*\) *, if test -n "$docfiles"; then echo "$docbase" fi - if $inctests; then + if $gentests; then echo "$testsbase" fi echo "$auxdir" @@ -5412,7 +5420,7 @@ s,//*$,/,' && ! { test -f "${destdir}/${dir1}Makefile.am" \ || test "${dir1}Makefile.am" = "$sourcebase/$makefile_am" \ || test "./${dir1}Makefile.am" = "$sourcebase/$makefile_am" \ - || { $inctests \ + || { $gentests \ && { test "${dir1}Makefile.am" = "$testsbase/$makefile_am" \ || test "./${dir1}Makefile.am" = "$testsbase/$makefile_am"; }; }; }; do dir2=`echo "$dir1" | sed -e "$sed_last"`"$dir2" @@ -5833,7 +5841,7 @@ s,//*$,/,' fi fi - if $inctests; then + if $gentests; then # Create tests makefile. func_dest_tmpfilename $testsbase/$makefile_am destfile="$testsbase/$makefile_am" @@ -6021,7 +6029,7 @@ s,//*$,/,' if test -n "$pobase"; then echo " - add \"$pobase/Makefile.in\" to AC_CONFIG_FILES in $configure_ac," fi - if $inctests; then + if $gentests; then if test "$makefile_am" = Makefile.am; then echo " - add \"$testsbase/Makefile\" to AC_CONFIG_FILES in $configure_ac," else