From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-io1-xd2b.google.com (mail-io1-xd2b.google.com [IPv6:2607:f8b0:4864:20::d2b]) by sourceware.org (Postfix) with ESMTPS id 316A23858D35 for ; Wed, 28 Jun 2023 15:57:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 316A23858D35 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com Received: by mail-io1-xd2b.google.com with SMTP id ca18e2360f4ac-77a62a84855so2665839f.1 for ; Wed, 28 Jun 2023 08:57:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1687967846; x=1690559846; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=XhdpzdsP49vBj6DnNKDku91mfaQxiUetkg2b+G8A3Vo=; b=hyuRVayc5MUiA4gbVbjP1dZZ8ofwMT/H9/xEAeX4O1Tbgvp3/CbJBwW1LSjz4UC8ty frZsGys4xQ0ax7VUCl5Cw5sQDrMXhYzwGWxbYzJOU+LAU6H3ZrI0hzMAXuj51k3GtqrD 34zuUOW7T2OgvQYOs1bwgeiamaiiKkOkA9VrX02k/c9CcdvuZdIuSnO2bReAsLvRHl9C IEG1Yh4MUrt42FnLIvMYbnpx+VqLD410G7YOvfU8cx0cZU2kn6SybQCFXjUIe8ggVEY+ WPxiw38gmj/pmUFJM6b7RqIHVXCNLyX9udmn8EtHODWXWEiJuHGwPdKAONxu+5SyhRAg gGTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687967846; x=1690559846; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=XhdpzdsP49vBj6DnNKDku91mfaQxiUetkg2b+G8A3Vo=; b=WgDvzrm2yQzMloWLqnuoQfl+BXAFztyfVXGfPrz/V6mVAks0U/NOJ8q/DDm01c2HKj oCnKlGx0SG5dRtdGcG1WOnX5LKH101aZ8U2B0lJps0niOZ1TItYltejfnBj3DxwcTrlV iXgzrIDO+b0kYkVtoGUPZWgdSWGY6+Cj4nv7lHCX4sn9+CuhaLuIIvw+zuOl+dfveNGE NhMmDPdvhFUbXNKm8GceT8ztG/da0mqa2HcECP3molUF61aDh8u/Yv41hs5ZMmVRCNX4 n30fs7fB+hpVZbiE5DJND4pl08jD18iYUZXVtuKGvBslmO5Gl0csG2+8lHsaFEUhx4lI FNCw== X-Gm-Message-State: AC+VfDwcj2naFqcpx3dLpwztl6dgZ2oD6sy4sRsZ+o8lpp9u9n0QLibo VZvA3uc6bIqAtA1aLA+KxLMxnA== X-Google-Smtp-Source: ACHHUZ7zS3L2XydGIq2/PTTHV/cRpm+733Pzxg36Ax9uh2L+ldxHIGaMtTdZbYHInW6iA7uq2WZuYg== X-Received: by 2002:a6b:6513:0:b0:786:2672:5331 with SMTP id z19-20020a6b6513000000b0078626725331mr1127936iob.2.1687967846086; Wed, 28 Jun 2023 08:57:26 -0700 (PDT) Received: from localhost.localdomain (71-211-136-248.hlrn.qwest.net. [71.211.136.248]) by smtp.gmail.com with ESMTPSA id f25-20020a056638023900b0042887e69e99sm3178159jaq.95.2023.06.28.08.57.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Jun 2023 08:57:25 -0700 (PDT) From: Tom Tromey To: gcc-patches@gcc.gnu.org Cc: libstdc++@gcc.gnu.org, Tom Tromey Subject: [PATCH] Relax type-printer regexp in libstdc++ test suite Date: Wed, 28 Jun 2023 09:57:03 -0600 Message-Id: <20230628155703.2948377-1-tromey@adacore.com> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-13.2 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: The libstdc++ test suite checks whether gdb type printers are available like so: set do_whatis_tests [gdb_batch_check "python print(gdb.type_printers)" \ "\\\[\\\]"] This regexp assumes that the list of printers is empty. However, sometimes it's convenient to ship a gdb that comes with some default printers, causing this to erroneously report that gdb is "too old". I believe the intent of this check is to ensure that gdb.type_printers exists -- not to check its starting value. This patch changes the check to accept any Python list as output. Note that the patch doesn't look for the trailing "]". I tried this but in my case the output was too long for expect. It seemed fine to just check the start, as the point really is to reject the case where the command prints an error message. * testsuite/lib/gdb-test.exp (gdb-test): Relax type-printer regexp. --- libstdc++-v3/testsuite/lib/gdb-test.exp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libstdc++-v3/testsuite/lib/gdb-test.exp b/libstdc++-v3/testsuite/lib/gdb-test.exp index 3728a060aa4..d8e572ef7b3 100644 --- a/libstdc++-v3/testsuite/lib/gdb-test.exp +++ b/libstdc++-v3/testsuite/lib/gdb-test.exp @@ -107,8 +107,12 @@ proc gdb-test { marker {selector {}} {load_xmethods 0} } { } } + # A very old version of gdb will not have the type_printers + # global. Some organizations may ship a gdb that has some default + # type printers, so accept any list output as indication that the + # global exists. set do_whatis_tests [gdb_batch_check "python print(gdb.type_printers)" \ - "\\\[\\\]"] + "\\\[.+"] if {!$do_whatis_tests} { send_log "skipping 'whatis' tests - gdb too old" } -- 2.40.1