From patchwork Tue Mar 29 12:43:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Wakely X-Patchwork-Id: 1610617 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=okO32qot; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Received: from sourceware.org (ip-8-43-85-97.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 (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4KSTm80d1dz9sCq for ; Tue, 29 Mar 2022 23:44:39 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id E36F03888821 for ; Tue, 29 Mar 2022 12:44:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E36F03888821 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1648557876; bh=OnXh8NOJj+YuoB+imr6OXN0+6rlKXSJh6y/7PSZQ7hY=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=okO32qot836PDxp2wPtdPlGG82WUlxhYC7xHwCSXWd7M6IQLVJVHODt8j69Sz87DW GHTcYaeea4JM9MCKT8+1D0wanaWv8pyy7NGGYTHbSCep5BipxuJRxGK8xsxopSoVC2 O9R1aUWyGRnyWB9kC4GKSguUkPfmztcasQQg2zKU= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id A64793858C50 for ; Tue, 29 Mar 2022 12:43:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A64793858C50 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-578-tA4Wn61QNrCVu49OqOUBog-1; Tue, 29 Mar 2022 08:43:33 -0400 X-MC-Unique: tA4Wn61QNrCVu49OqOUBog-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8EE99811E75 for ; Tue, 29 Mar 2022 12:43:33 +0000 (UTC) Received: from localhost (unknown [10.33.36.3]) by smtp.corp.redhat.com (Postfix) with ESMTP id 55F30400E42D; Tue, 29 Mar 2022 12:43:33 +0000 (UTC) To: gcc-patches@gcc.gnu.org Subject: [PATCH] testsuite: Allow setting gpp_std_list in configuration files Date: Tue, 29 Mar 2022 13:43:32 +0100 Message-Id: <20220329124332.1623194-1-jwakely@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.11.54.2 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-12.6 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Jonathan Wakely via Gcc-patches From: Jonathan Wakely Reply-To: Jonathan Wakely Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" Tested powerpc64le-linux, OK for trunk? -- >8 -- This allows the gpp_std_list variable to be set in ~/.dejagnurc instead of using the GXX_TESTSUITE_STDS environment variable. This is consistent with how other defaults such as tool_timeout can be set. The environment variable can still be used to override the default. gcc/testsuite/ChangeLog: * lib/g++-dg.exp: Update comments. * lib/g++.exp (gpp_std_list): Check for an existing value before setting it to an empty list. --- gcc/testsuite/lib/g++-dg.exp | 7 ++++--- gcc/testsuite/lib/g++.exp | 6 +++++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/gcc/testsuite/lib/g++-dg.exp b/gcc/testsuite/lib/g++-dg.exp index a1bc37074b5..59e8081a29d 100644 --- a/gcc/testsuite/lib/g++-dg.exp +++ b/gcc/testsuite/lib/g++-dg.exp @@ -27,8 +27,8 @@ proc g++-dg-prune { system text } { return [gcc-dg-prune $system $text] } -# Modified dg-runtest that runs tests in both C++98 and C++11 modes -# unless they specifically specify one or the other. +# Modified dg-runtest that runs tests in multiple standard modes, +# unless they specifically specify one standard. proc g++-dg-runtest { testcases flags default-extra-flags } { global runtests @@ -39,7 +39,7 @@ proc g++-dg-runtest { testcases flags default-extra-flags } { } # If the testcase specifies a standard, use that one. - # If not, run it under both standards, allowing GNU extensions + # If not, run it under several standards, allowing GNU extensions # if there's a dg-options line. if ![search_for $test "-std=*++"] { if [search_for $test "dg-options"] { @@ -48,6 +48,7 @@ proc g++-dg-runtest { testcases flags default-extra-flags } { set std_prefix "-std=c++" } + # See g++.exp for the initial value of this list. global gpp_std_list if { [llength $gpp_std_list] > 0 } { set std_list $gpp_std_list diff --git a/gcc/testsuite/lib/g++.exp b/gcc/testsuite/lib/g++.exp index 3744ebe4b44..24ef068b239 100644 --- a/gcc/testsuite/lib/g++.exp +++ b/gcc/testsuite/lib/g++.exp @@ -32,7 +32,11 @@ load_lib target-libpath.exp set gpp_compile_options "" -set gpp_std_list { } +# Allow gpp_std_list to be set in configuration files, e.g., ~/.dejagnurc +if ![info exists gpp_std_list] { + set gpp_std_list { } +} +# Allow gpp_std_list to be set from the environment. if [info exists env(GXX_TESTSUITE_STDS)] { set gpp_std_list [split $env(GXX_TESTSUITE_STDS) ","] }