From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id avHFAf1kUWPkwQ4AWB0awg (envelope-from ) for ; Thu, 20 Oct 2022 11:10:53 -0400 Received: by simark.ca (Postfix, from userid 112) id ECB481E112; Thu, 20 Oct 2022 11:10:52 -0400 (EDT) Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=AKqxNco5; dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 8AAB81E0D5 for ; Thu, 20 Oct 2022 11:10:52 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 306A93850206 for ; Thu, 20 Oct 2022 15:10:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 306A93850206 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1666278652; 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=AKqxNco5vXGXz2f1EckuqTX++uGC1d536a3bHqjV/pozLFBPdPTtK3h7+Iko9nW15 HB/+AbZOPPXQowSH68c/NwvLYG5D7whV17fVoCjbFkV1NUxG10DvP0NYgxiDnak2Az Ungi3EOwzzMTKzNqwcx5bNdr7TVkjYNDqJCDY/AY= 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-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Tom de Vries via Gdb-patches Reply-To: Tom de Vries Cc: binutils@sourceware.org Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" 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