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: 59198 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 2AC34384D1A9 for ; Thu, 20 Oct 2022 15:10:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2AC34384D1A9 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1666278656; 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=m2pq2eRR/KneyCV1q8lgMBTTcoEGS2esSytBSD3P4HDorPWzVnnslVf7KcJO6j6my S7F+mUeKNQ5vvqqumiIQCzZ+iBShqeHKovWpS818CGQXJ7oC2ugKmcU4G1V/luvPJm TCtdiL57+iObd11x8b0vU2qEhTK5kmg/MHAU9is0= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@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: 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: , X-Patchwork-Original-From: Tom de Vries via Gdb-patches From: Tom de Vries Reply-To: Tom de Vries Cc: binutils@sourceware.org Errors-To: gdb-patches-bounces+patchwork=sourceware.org@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