Message ID | OS3P286MB21524BD0F485B6991D4B87E4F01C9@OS3P286MB2152.JPNP286.PROD.OUTLOOK.COM |
---|---|
State | New |
Headers |
Return-Path: <gdb-patches-bounces+patchwork=sourceware.org@sourceware.org> 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 E8DF33831BD7 for <patchwork@sourceware.org>; Fri, 9 Dec 2022 11:57:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E8DF33831BD7 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1670587062; bh=e4E1g05EgqB1bcBoXBTX7eWMmIwf/YFpKbMjY/xe/kk=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=nECFhICYIjZ3NF3IK44hC3j5zQqm/MeoBVSiYgHI6DOTY4ZJjh/Pr4LJI9/5VXcqh gB21tcYbgK04KKn8Tdi/OH4r/xD3Ln+fXshDyFdgbOj6e8AbDHsi6ttXnWQZeZLAgi NFBBSfhibdmo7+R18R37Xpu9yToTPSmhntwN6K0Y= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from JPN01-OS0-obe.outbound.protection.outlook.com (mail-os0jpn01olkn2027.outbound.protection.outlook.com [40.92.98.27]) by sourceware.org (Postfix) with ESMTPS id 76AAF3852C61 for <gdb-patches@sourceware.org>; Fri, 9 Dec 2022 11:57:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 76AAF3852C61 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Qe/4ZfVWR4ohxpvm5U8v8sBtYan877RHOCqFqjh6sQKJVQ7bVnqW8S+QT+iuFKjArAyyTKwr/kYGzgwsx9sqjYHmjG1kDIR2N7yiTrZwglYBph0Lmggait+9U/+mUonXGsdK+Sd8QeSJdeOh3MEJEiM8O4r7WEVT44GaTk5XdifGtzg6cL4sPhktyBz6pAYCge3lqkytU96/zeo5CRocWHMZ4ybpctwt7fyNJqTQps0M8FYn79RaYpNH37vx3dER22KkLgG+DmnjaGcA9ulXqq36cKio2bx9kXStBFAkG0HKUlszPKKV0B8Jw6lm1k1LfNsgdvY5WYOSfjDjiyKjSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=e4E1g05EgqB1bcBoXBTX7eWMmIwf/YFpKbMjY/xe/kk=; b=mfQwoAh78IcDgpXKnL8QEvYciEkze4xtifDrCJ2PjsX+uJTeX0iJ6wHTiNgs9T5rYbAr0tHQdsF+v8aa1i6BdVhrCpZQf9jjCWN6xfZIrKz0GTW85s2Etsh0ZwYV7BDN/kPhTs+37D7kjMAwuV1G46PH9kSd+825VvgqfhY5FvvRlABlgqbUoFihAOjAEvAXkxd8KR/e12EN3S1gvuokb0W7m4vBlsbFt1PdAa8ThjdGOitbDyDI1l6oFj/wAhUPWIW6r+0KYEiih+hC/2Xh+dQrMPXDQzfp/PATVYzrmj8+F1PjPRkhI1+MayJghdwspZT/GGcp/7xtjIsVD/fZOw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none Received: from OS3P286MB2152.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:197::9) by TYCP286MB1705.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:186::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.16; Fri, 9 Dec 2022 11:57:14 +0000 Received: from OS3P286MB2152.JPNP286.PROD.OUTLOOK.COM ([fe80::c90:199b:e178:3fa4]) by OS3P286MB2152.JPNP286.PROD.OUTLOOK.COM ([fe80::c90:199b:e178:3fa4%5]) with mapi id 15.20.5880.016; Fri, 9 Dec 2022 11:57:14 +0000 To: gdb-patches@sourceware.org Cc: enze.li@gmx.com Subject: [PATCH] gdb/testsuite: add untested message to skip_debuginfod_tests Date: Fri, 9 Dec 2022 19:56:24 +0800 Message-ID: <OS3P286MB21524BD0F485B6991D4B87E4F01C9@OS3P286MB2152.JPNP286.PROD.OUTLOOK.COM> X-Mailer: git-send-email 2.30.2 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-TMN: [Ns9qpzkNBiLvXh7rxWVzk9zSXSiHcQRx] X-ClientProxiedBy: SG2P153CA0004.APCP153.PROD.OUTLOOK.COM (2603:1096::14) To OS3P286MB2152.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:197::9) X-Microsoft-Original-Message-ID: <20221209115624.1226-1-enze.li@hotmail.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: OS3P286MB2152:EE_|TYCP286MB1705:EE_ X-MS-Office365-Filtering-Correlation-Id: 13fa5564-27d2-489b-ce83-08dad9dc82c9 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: iUZ8sV1HDTl2ZZQ+yu6IJ4hQeUWAK8dqm8HIO9uO/QHOjkX5Uy/xpkPyy15qA4JfxpkwBu6x0DtE9o2/CDFoQZhIZjNpgHpMcJ7GjICWgIZWt6kR0SiejK/Zrfq1e3aDSIW4zKZh133U2+4LWP8JxXXSZQ+uTqoMXR7Nm1sxSAcL2u3sks04z638MiRyaDIPUlJPURarhIAyPiD8PJnTpXh47V3nFLl5h8djib0gC/mp5yuxXhlrb5qIcDfL1NjlCxphXWp4ZGMQrDwvf3n/vlSkFpY6T//e0RlKdpYA01u/c2NezrV4SxamT6ejL1o3mGQtBTYG7/s6LTrztUhfIY4K0YS3xPjAfGuiAk3rCKNijVM1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ShsJTuSHJYuX4BXOOv9nvYvrVzbh2Xsn34CgPDQAzyOApzQLafDs/+995KQLmU7ehxOnSK5kW2OctD82dGinqrabI/L6ijkIheqxpmzEfY+ciwoCC/qAZNTKESxSuFlEgBOY8pk/QnEPFuKc8UAC0TiFFA/9bC7oOQ/AwopbaGbOvLPMwyZXYPqaQqNYdr5M3KItCsWbQ2ALOUeBDEKpsj9E4VJnB2SVfS77RbgrRFCMMRKf50O9kxbU0WRYFhks9E3/Gl4FAzQEjf+Vz+hK+k/+KAWIUhrSHQ2AQDafVtPG6sDy3aMU/H6T104ewhiF79d6uKscUqMW1CBOWRrFfFzjfHtSq07vMMEcsI8Tv1CASkHJnG6TzWoX4wztynRTwug2gCkqpTUQRDtSISFbf6uTe2ZHnK000Hcy/ACXJ5BD2bVJygGV12RTFBwAf8pbTBpCYdmpm1muasOYPK7FAH1SWKd38u4s6DsidtZaWnWEwE5PvHvY/uRQPzPMtGSQY/cCuEQ8FCk3UtPTCqNVag== X-OriginatorOrg: sct-15-20-4755-11-msonline-outlook-05f45.templateTenant X-MS-Exchange-CrossTenant-Network-Message-Id: 13fa5564-27d2-489b-ce83-08dad9dc82c9 X-MS-Exchange-CrossTenant-AuthSource: OS3P286MB2152.JPNP286.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Dec 2022 11:57:13.9843 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCP286MB1705 X-Spam-Status: No, score=-11.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, 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 <gdb-patches.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/gdb-patches>, <mailto:gdb-patches-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/gdb-patches/> List-Post: <mailto:gdb-patches@sourceware.org> List-Help: <mailto:gdb-patches-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/gdb-patches>, <mailto:gdb-patches-request@sourceware.org?subject=subscribe> From: Enze Li via Gdb-patches <gdb-patches@sourceware.org> Reply-To: Enze Li <enze.li@hotmail.com> Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" <gdb-patches-bounces+patchwork=sourceware.org@sourceware.org> |
Series |
gdb/testsuite: add untested message to skip_debuginfod_tests
|
|
Commit Message
Enze Li
Dec. 9, 2022, 11:56 a.m. UTC
When running the fetch_src_and_symbols.exp, I see the following output which looks weird. I even don't know whether the execution was successful. ====== Running /home/lee/dev/binutils-gdb/gdb/testsuite/gdb.debuginfod/fetch_src_and_symbols.exp ... testcase /home/lee/dev/binutils-gdb/gdb/testsuite/gdb.debuginfod/fetch_src_and_symbols.exp completed in 0 seconds === gdb Summary === ====== It is the fact that there's not enough feedback provided during the skip_debuginfod_tests procedure. Fix this by adding some untested messages to the skip_debuginfod_tests procedure to clarify the output. With this patch applied, I get: ====== Running /home/lee/dev/binutils-gdb/gdb/testsuite/gdb.debuginfod/fetch_src_and_symbols.exp ... UNTESTED: gdb.debuginfod/fetch_src_and_symbols.exp: cannot find debuginfo testcase /home/lee/dev/binutils-gdb/gdb/testsuite/gdb.debuginfod/fetch_src_and_symbols.exp completed in 0 seconds === gdb Summary === # of untested testcases 1 ====== I also modernized the form of 'if' with 'if {} {}' in skip_debuginfod_tests. Tested on x86_64-linux. --- gdb/testsuite/lib/debuginfod-support.exp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) base-commit: cd3866b6d07b37258eb840443537baa163877e24
Comments
On 09/12/2022 12:56, Enze Li via Gdb-patches wrote: > When running the fetch_src_and_symbols.exp, I see the following output > which looks weird. I even don't know whether the execution was successful. > ====== > Running /home/lee/dev/binutils-gdb/gdb/testsuite/gdb.debuginfod/fetch_src_and_symbols.exp ... > testcase /home/lee/dev/binutils-gdb/gdb/testsuite/gdb.debuginfod/fetch_src_and_symbols.exp > completed in 0 seconds > > === gdb Summary === > > ====== > > It is the fact that there's not enough feedback provided during the > skip_debuginfod_tests procedure. Fix this by adding some untested > messages to the skip_debuginfod_tests procedure to clarify the output. > > With this patch applied, I get: > ====== > Running /home/lee/dev/binutils-gdb/gdb/testsuite/gdb.debuginfod/fetch_src_and_symbols.exp ... > UNTESTED: gdb.debuginfod/fetch_src_and_symbols.exp: cannot find debuginfo > testcase /home/lee/dev/binutils-gdb/gdb/testsuite/gdb.debuginfod/fetch_src_and_symbols.exp > completed in 0 seconds > > === gdb Summary === > > # of untested testcases 1 > ====== > > I also modernized the form of 'if' with 'if {} {}' in > skip_debuginfod_tests. Good catch! Reviewed-By: Bruno Larsen <blarsen@redhat.com>
>>>>> "Enze" == Enze Li via Gdb-patches <gdb-patches@sourceware.org> writes:
Enze> proc skip_debuginfod_tests {} {
Enze> - if [is_remote host] {
Enze> + if { [is_remote host] } {
Enze> + untested "does not work on remote host"
Enze> return true
Enze> }
Do any of the other skip_ procs call untested?
I suspect this should be done somewhere else, and/or it's a pervasive
problem when a prerequisite is not met.
Tom
On Tue, Dec 13 2022 at 09:14:47 AM -0700, Tom Tromey wrote: >>>>>> "Enze" == Enze Li via Gdb-patches <gdb-patches@sourceware.org> writes: > > Enze> proc skip_debuginfod_tests {} { > Enze> - if [is_remote host] { > Enze> + if { [is_remote host] } { > Enze> + untested "does not work on remote host" > Enze> return true > Enze> } Thanks for your swift replay. :) > > Do any of the other skip_ procs call untested? Hmmm...Not many. Actually, from the skip_debuginfod_tests, I see an untested message "cannot find curl". It provides detailed information when running the testcase. Then I thought other spots in the same procedure may benifit from it. lib/debuginfod-support.exp:proc skip_debuginfod_tests {} { lib/debuginfod-support.exp- if [is_remote host] { lib/debuginfod-support.exp- return true lib/debuginfod-support.exp- } lib/debuginfod-support.exp- lib/debuginfod-support.exp- if { [which debuginfod] == 0 } { lib/debuginfod-support.exp- return true lib/debuginfod-support.exp- } lib/debuginfod-support.exp- lib/debuginfod-support.exp- if { [which curl] == 0 } { lib/debuginfod-support.exp- untested "cannot find curl" lib/debuginfod-support.exp- return true lib/debuginfod-support.exp- } Except this, three unsupported messages were found in skip_* procedure. > I suspect this should be done somewhere else, and/or it's a pervasive > problem when a prerequisite is not met. > > Tom If the way of my previous patch is unconventional, how about this? ================================================================= --- a/gdb/testsuite/gdb.debuginfod/fetch_src_and_symbols.exp +++ b/gdb/testsuite/gdb.debuginfod/fetch_src_and_symbols.exp @@ -20,7 +20,24 @@ standard_testfile main.c load_lib dwarf.exp load_lib debuginfod-support.exp -if { [skip_debuginfod_tests] } { return -1 } +set skip_ret [skip_debuginfod_tests] +if { $skip_ret < 0 } { + switch $skip_ret { + -1 { + untested "does not work on remote host" + } + -2 { + untested "cannot find debuginfo" + } + -3 { + untested "cannot find curl" + } + -4 { + untested "GDB was not configured with debuginfod" + } + } + return -1 +} set sourcetmp [standard_output_file tmp-${srcfile}] set outputdir [standard_output_file {}] --- a/gdb/testsuite/lib/debuginfod-support.exp +++ b/gdb/testsuite/lib/debuginfod-support.exp @@ -18,17 +18,16 @@ # Return true if the debuginfod tests should be skipped, otherwise, return # false. proc skip_debuginfod_tests {} { - if [is_remote host] { - return true + if { [is_remote host] } { + return -1 } if { [which debuginfod] == 0 } { - return true + return -2 } if { [which curl] == 0 } { - untested "cannot find curl" - return true + return -3 } # Skip testing if gdb was not configured with debuginfod. @@ -39,10 +38,10 @@ proc skip_debuginfod_tests {} { if { [string first "with-debuginfod" \ [eval exec $::GDB --quiet $::INTERNAL_GDBFLAGS \ --configuration]] == -1 } { - return true + return -4 } - return false + return 0 } # Create two directories within the current output directory. One directory ================================================================= Best Regards, Enze
>>>>> "Enze" == Enze Li via Gdb-patches <gdb-patches@sourceware.org> writes:
Enze> Hmmm...Not many. Actually, from the skip_debuginfod_tests, I see an
Enze> untested message "cannot find curl". It provides detailed information
Enze> when running the testcase. Then I thought other spots in the same
Enze> procedure may benifit from it.
Personally I think these predicates should just return the result. If
a message would be helpful, they can use 'verbose'.
Enze> If the way of my previous patch is unconventional, how about this?
I think it's kind of overkill. "verbose" in the proc would work just as
well, and I suppose my feeling (unsupported by fact really) is that
normally an "untested" is just ignored anyway, and if you want to find
out what's happening you would have to dig a bit anyway.
Also I question if "untested" is correct due to what the dejagnu manual
says:
UNTESTED
A test was not run. This is a placeholder used when there is no
real test case yet.
I think "unsupported" is what we ought to be using.
If you want to see how I think it should generally work, look at my
branch "rewrite-require". This changes "require" to be simpler and then
tests can express their static requirements very simply:
require dwarf2 !isnative mumble bleah
Then the main difficulty is converting all the code to use this.
I made a stab at it there.
Tom
diff --git a/gdb/testsuite/lib/debuginfod-support.exp b/gdb/testsuite/lib/debuginfod-support.exp index ceecf9071110..c1a2bb900dce 100644 --- a/gdb/testsuite/lib/debuginfod-support.exp +++ b/gdb/testsuite/lib/debuginfod-support.exp @@ -18,11 +18,13 @@ # Return true if the debuginfod tests should be skipped, otherwise, return # false. proc skip_debuginfod_tests {} { - if [is_remote host] { + if { [is_remote host] } { + untested "does not work on remote host" return true } if { [which debuginfod] == 0 } { + untested "cannot find debuginfo" return true } @@ -39,6 +41,7 @@ proc skip_debuginfod_tests {} { if { [string first "with-debuginfod" \ [eval exec $::GDB --quiet $::INTERNAL_GDBFLAGS \ --configuration]] == -1 } { + untested "GDB was not configured with debuginfod" return true }