From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx07-00178001.pphosted.com (mx07-00178001.pphosted.com [185.132.182.106]) by sourceware.org (Postfix) with ESMTPS id B31833858C60 for ; Wed, 2 Nov 2022 18:14:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B31833858C60 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=foss.st.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=foss.st.com Received: from pps.filterd (m0241204.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2A2FWLL8028696; Wed, 2 Nov 2022 19:14:02 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foss.st.com; h=message-id : date : mime-version : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding; s=selector1; bh=/iCIuKx3b+a0K95imz7Kup9r34nlzOwKNTkyvUM44Ok=; b=ThhIOEo6gt06s7LFbZEjWelRKzW4vHKwvxkaJHPM9RJcYZJfpCwn42fa4/NKtd0O2Au4 LoY5WTuP51pdtPFkZBCS6iMseBZjIQlMWive4FA04yTbS8lj9zq7rt2KSR4zFB/yy/5p xa+CtOsSbVcUpSY7fICFofsP/30I9LPEc1gmW3hAAzO7Ea9vN8q+Qyjd8yYb6Qt8ZWtX mnIF+CvfkOaa8lkalZmM3FKi1ExGrOEwHZXBc7qVgp17yCTgPqUNaUN9731PjEVyShLN hZ2NWOQaejLuSQ9zudVQXFlCVd6c5ovXl00SOeZMWD3K0tsIq5d/xQjG195viFpHvLQP 2A== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com (PPS) with ESMTPS id 3kkqfhafv3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 02 Nov 2022 19:14:02 +0100 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 67A49100038; Wed, 2 Nov 2022 19:13:57 +0100 (CET) Received: from Webmail-eu.st.com (shfdag1node3.st.com [10.75.129.71]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 6373A232FF9; Wed, 2 Nov 2022 19:13:57 +0100 (CET) Received: from [10.252.13.210] (10.252.13.210) by SHFDAG1NODE3.st.com (10.75.129.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Wed, 2 Nov 2022 19:13:56 +0100 Message-ID: <854beb3d-7553-af23-cd38-819cabf21896@foss.st.com> Date: Wed, 2 Nov 2022 19:13:55 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.4.1 Subject: Re: PING^4 [PATCH] testsuite: Verify that module-mapper is available To: CC: , References: <20220923120331.4136741-1-torbjorn.svensson@foss.st.com> <7e6bb5c3-3fae-6cfd-e0e1-8e295045f4b7@foss.st.com> Content-Language: en-US From: Torbjorn SVENSSON In-Reply-To: <7e6bb5c3-3fae-6cfd-e0e1-8e295045f4b7@foss.st.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.252.13.210] X-ClientProxiedBy: EQNCAS1NODE4.st.com (10.75.129.82) To SHFDAG1NODE3.st.com (10.75.129.71) X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-11-02_14,2022-11-02_01,2022-06-22_01 X-Spam-Status: No, score=-10.3 required=5.0 tests=BAYES_00,BODY_8BITS,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,GIT_PATCH_0,KAM_SHORT,NICE_REPLY_A,RCVD_IN_DNSWL_LOW,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 List-Id: Hi, Ping, https://gcc.gnu.org/pipermail/gcc-patches/2022-October/602844.html Ok for trunk? Kind regards, Torbjörn On 2022-10-25 16:24, Torbjorn SVENSSON via Gcc-patches wrote: > Hi, > > Ping, https://gcc.gnu.org/pipermail/gcc-patches/2022-October/603544.html > > Kind regards, > Torbjörn > > On 2022-10-14 09:42, Torbjorn SVENSSON wrote: >> Hi, >> >> Ping, https://gcc.gnu.org/pipermail/gcc-patches/2022-October/602843.html >> >> Kind regards, >> Torbjörn >> >> On 2022-10-05 11:17, Torbjorn SVENSSON wrote: >>> Hi, >>> >>> Ping, >>> https://gcc.gnu.org/pipermail/gcc-patches/2022-September/602111.html >>> >>> Kind regards, >>> Torbjörn >>> >>> On 2022-09-23 14:03, Torbjörn SVENSSON wrote: >>>> For some test cases, it's required that the optional module mapper >>>> "g++-mapper-server" is built. As the server is not required, the >>>> test cases will fail if it can't be found. >>>> >>>> gcc/testsuite/ChangeLog: >>>> >>>>     * lib/target-supports.exp (check_is_prog_name_available): >>>>     New. >>>>     * lib/target-supports-dg.exp >>>>     (dg-require-prog-name-available): New. >>>>     * g++.dg/modules/modules.exp: Verify avilability of module >>>>     mapper. >>>> >>>> Signed-off-by: Torbjörn SVENSSON  >>>> --- >>>>   gcc/testsuite/g++.dg/modules/modules.exp | 31 >>>> ++++++++++++++++++++++++ >>>>   gcc/testsuite/lib/target-supports-dg.exp | 15 ++++++++++++ >>>>   gcc/testsuite/lib/target-supports.exp    | 15 ++++++++++++ >>>>   3 files changed, 61 insertions(+) >>>> >>>> diff --git a/gcc/testsuite/g++.dg/modules/modules.exp >>>> b/gcc/testsuite/g++.dg/modules/modules.exp >>>> index afb323d0efd..4784803742a 100644 >>>> --- a/gcc/testsuite/g++.dg/modules/modules.exp >>>> +++ b/gcc/testsuite/g++.dg/modules/modules.exp >>>> @@ -279,6 +279,29 @@ proc module-init { src } { >>>>       return $option_list >>>>   } >>>> +# Return 1 if requirements are met >>>> +proc module-check-requirements { tests } { >>>> +    foreach test $tests { >>>> +    set tmp [dg-get-options $test] >>>> +    foreach op $tmp { >>>> +        switch [lindex $op 0] { >>>> +        "dg-additional-options" { >>>> +            # Example strings to match: >>>> +            # -fmodules-ts -fmodule-mapper=|@g++-mapper-server\\ >>>> -t\\ [srcdir]/inc-xlate-1.map >>>> +            # -fmodules-ts -fmodule-mapper=|@g++-mapper-server >>>> +            if [regexp -- {(^| )-fmodule-mapper=\|@([^\\ ]*)} >>>> [lindex $op 2] dummy dummy2 prog] { >>>> +            verbose "Checking that mapper exist: $prog" >>>> +            if { ![ check_is_prog_name_available $prog ] } { >>>> +                return 0 >>>> +            } >>>> +            } >>>> +        } >>>> +        } >>>> +    } >>>> +    } >>>> +    return 1 >>>> +} >>>> + >>>>   # cleanup any detritus from previous run >>>>   cleanup_module_files [find $DEFAULT_REPO *.gcm] >>>> @@ -307,6 +330,14 @@ foreach src [lsort [find $srcdir/$subdir >>>> {*_a.[CHX}]] { >>>>       set tests [lsort [find [file dirname $src] \ >>>>                     [regsub {_a.[CHX]$} [file tail $src] >>>> {_[a-z].[CHX]}]]] >>>> +    if { ![module-check-requirements $tests] } { >>>> +        set testcase [regsub {_a.[CH]} $src {}] >>>> +        set testcase \ >>>> +        [string range $testcase [string length "$srcdir/"] end] >>>> +        unsupported $testcase >>>> +        continue >>>> +    } >>>> + >>>>       set std_list [module-init $src] >>>>       foreach std $std_list { >>>>           set mod_files {} >>>> diff --git a/gcc/testsuite/lib/target-supports-dg.exp >>>> b/gcc/testsuite/lib/target-supports-dg.exp >>>> index aa2164bc789..6ce3b2b1a1b 100644 >>>> --- a/gcc/testsuite/lib/target-supports-dg.exp >>>> +++ b/gcc/testsuite/lib/target-supports-dg.exp >>>> @@ -683,3 +683,18 @@ proc dg-require-symver { args } { >>>>       set dg-do-what [list [lindex ${dg-do-what} 0] "N" "P"] >>>>       } >>>>   } >>>> + >>>> +# If this target does not provide prog named "$args", skip this test. >>>> + >>>> +proc dg-require-prog-name-available { args } { >>>> +    # The args are within another list; pull them out. >>>> +    set args [lindex $args 0] >>>> + >>>> +    set prog [lindex $args 1] >>>> + >>>> +    if { ![ check_is_prog_name_available $prog ] } { >>>> +        upvar dg-do-what dg-do-what >>>> +        set dg-do-what [list [lindex ${dg-do-what} 0] "N" "P"] >>>> +    } >>>> +} >>>> + >>>> diff --git a/gcc/testsuite/lib/target-supports.exp >>>> b/gcc/testsuite/lib/target-supports.exp >>>> index 703aba412a6..c3b7a6c17b3 100644 >>>> --- a/gcc/testsuite/lib/target-supports.exp >>>> +++ b/gcc/testsuite/lib/target-supports.exp >>>> @@ -11928,3 +11928,18 @@ main: >>>>       .byte 0 >>>>     } ""] >>>>   } >>>> + >>>> +# Return 1 if this target has prog named "$prog", 0 otherwise. >>>> + >>>> +proc check_is_prog_name_available { prog } { >>>> +    global tool >>>> + >>>> +    set options [list "additional_flags=-print-prog-name=$prog"] >>>> +    set output [lindex [${tool}_target_compile "" "" "none" >>>> $options] 0] >>>> + >>>> +    if { $output == $prog } { >>>> +        return 0 >>>> +    } >>>> + >>>> +    return 1 >>>> +}