From patchwork Thu Oct 20 15:10:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom de Vries X-Patchwork-Id: 6236 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp164470wrr; Thu, 20 Oct 2022 08:10:42 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4ROJ5w602RcxChr9krYroziaO4KUqGjR2OnkejNeD3hN1MdVda3BZL8LSAvLV7hWZOtQc5 X-Received: by 2002:a17:907:b0b:b0:78d:8877:9f9e with SMTP id h11-20020a1709070b0b00b0078d88779f9emr11272249ejl.693.1666278642628; Thu, 20 Oct 2022 08:10:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666278642; cv=none; d=google.com; s=arc-20160816; b=Y0dLHIdi1uDO2F+X+qP8bRmivXqCQGe+AFQ+OlS+7cZqJhILZh8J4TpO9OkSr/ZxXm /kVJP1rrqWNdZ2Pht/dObGHlXngJVMjXfoPjzaKsHUFtvn/gIoH4y4zoD0NEX6fb/m36 Pa3giuQ/R1yI5C73/O3A5MFBWvryDH5g7IUaRPBWO03m8zKYIuYwQqT5RgJihetGoi2G WnsFBIMReydUTpjkJsb4zzopjqHGk6eq63rSgfzvuSEcXOP1TXZLFl8Y4M48x2LVV+y1 Ntio6/dLfQDRrX178j4XwizeVukBx6JRJ5YvZYvHnffBcxL1hRee7RM4mmeijvpiuVYH bYUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:reply-to:from:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence :user-agent:content-disposition:mime-version:message-id:subject:to :date:dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=JI0wrprx0tVeWiCPdec+khWdLJ68puK6Nvxc73D+yuM=; b=ZLv6Wwr9iodecEYps111ws+spMx0FavQLAjI4QhN/tMYzxezlZ+u69duRbBGzYlflx eVuxxki7UbjvyxNdU3rAnlHTkE9qlwqMnKm1/ltKLGi40d9O1WcGPOZk2z2Tel5bWCen R869qN7zJuMSEGX+hBYt9vI5XRiTOE+ulMZRLoyOzLHaLieWnXxzlE+HqAbxcTfScCtL B/PRDZ/wevt5UfMJYoXbbwsz7dGYYJy4BKclYg7p0zI9yrxqhMpR96h7yMH6kVym+1IH p1ZNYMaGsQSnvNWGV4RodeO6inZyyOvYf1jVqdezNHmMj+GOSectSzl/PN2K1NVLO9Sv 9KFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=mJ2h30az; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sourceware.org Received: from sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id z3-20020a056402274300b0045968aa645dsi20965664edd.30.2022.10.20.08.10.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Oct 2022 08:10:42 -0700 (PDT) Received-SPF: pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=mJ2h30az; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id E3F1B3850860 for ; Thu, 20 Oct 2022 15:10:40 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E3F1B3850860 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1666278640; bh=JI0wrprx0tVeWiCPdec+khWdLJ68puK6Nvxc73D+yuM=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=mJ2h30azmaGyxA+UyKy6DNA8+SU5lqsjU44YUf75kfFKYzdw0l7VI3IPwH4uPi0+P BKh+e1rA/95T3jHfAM+NKssovohoNlh9ZCtPQa9BKMOCTcb2hsmQQh5trzuC+IStP8 MqSUWfA9lS1KUuexOIItb0i/XsGhLNWXYpboqd6Q= X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by sourceware.org (Postfix) with ESMTPS id C58803850859; Thu, 20 Oct 2022 15:10:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C58803850859 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 02CB51FF1D; Thu, 20 Oct 2022 15:10:30 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id DF70E13AF5; Thu, 20 Oct 2022 15:10:29 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id T8R9NeVkUWP0ewAAMHmgww (envelope-from ); Thu, 20 Oct 2022 15:10:29 +0000 Date: Thu, 20 Oct 2022 17:10:28 +0200 To: gdb-patches@sourceware.org Subject: [RFC][top-level] Add configure test-case Message-ID: <20221020151027.GA1300@delia.home> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-12.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Tom de Vries via Binutils From: Tom de Vries Reply-To: Tom de Vries Cc: binutils@sourceware.org Errors-To: binutils-bounces+ouuuleilei=gmail.com@sourceware.org Sender: "Binutils" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747219793698250305?= X-GMAIL-MSGID: =?utf-8?q?1747219793698250305?= Hi, As reported in reopened PR18632, recent commit 228cf97dd3c ("Merge configure.ac from gcc project") dropped commit 69961a84c9b ("Don't build readline/libreadline.a, when --with-system-readline is supplied"), due to the patch only being applied to binutils-gdb repo, and not to gcc repo. I wondered if I could write a test-case that would regress because of this, such that we at least don't silently regress. I came up with a test-case named toplevel.exp, that can be run like this: ... $ cd src $ runtest toplevel.exp ... Running ./toplevel.exp ... === Summary === # of expected passes 1 ... and leaves files $src/testrun.{log,sum}. Tested on x86_64-linux. Any comments? Thanks, - Tom [top-level] Add configure test-case --- toplevel.exp | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/toplevel.exp b/toplevel.exp new file mode 100644 index 00000000000..db224b3f0b1 --- /dev/null +++ b/toplevel.exp @@ -0,0 +1,53 @@ +# Copyright (C) 2022 Free Software Foundation, Inc. +# +# This file 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 3 of the License, 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; see the file COPYING3. If not see +# . + +# We're assuming this is run in the top-level source directory, like so: +# $ cd src +# $ runtest toplevel.exp +set rootdir [pwd] +set srcdir $rootdir + +# We're putting the build dir inside the source dir, that may need to be +# changed at some point. +set builddir $rootdir/build.tmp +exec rm -Rf $builddir +exec mkdir $builddir + +cd $builddir + +set test "configure --with-system-readline" +set res [catch {exec $srcdir/configure --with-system-readline} output] + +set error_info_re \ + [list \ + "This configuration is not supported in the following subdirectories:" \ + "(\[^\n\]+ )?readline( \[^\n\]+)?" \ + ""] +set error_info_re [join $error_info_re "\n"] + +# Note: $res == 1 and $errorCode == "NONE" means that configure succeeded but +# wrote something to stderr, which is available in $errorInfo. +if { $res == 1 + && $errorCode == "NONE" + && [regexp $error_info_re $errorInfo] == 1 } { + pass $test +} else { + verbose -log "configure output: $output" + fail $test +} + +# Cleanup. +exec rm -Rf $builddir