Message ID | 20220923120331.4136741-1-torbjorn.svensson@foss.st.com |
---|---|
State | Committed |
Commit | 20d2a8c24f3ca487ffd35fefcc9b1562bb10b609 |
Headers |
Return-Path: <gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.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 5F2A13857427 for <patchwork@sourceware.org>; Fri, 23 Sep 2022 12:04:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5F2A13857427 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1663934673; bh=PFdGL7ccrUZ06M3bgEDuTPxwuml6rb7wGCjHdw05qGQ=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=fwesgFe3l0NLHSoXGw8xFca8DSP2VVWpxtclYsUWs+fuebPOY25DqAWm9F4EeMa3L WgsEdtjxbxWWbkB1OBg5uC1qn4syMY/1Pi2gZCkmckE4T+QMiFu35FtZOnCn3CYd8R ip0VhgTtPN9DEFgaX0M8EFuS92G0yVL0ef7AtMtU= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mx07-00178001.pphosted.com (mx08-00178001.pphosted.com [91.207.212.93]) by sourceware.org (Postfix) with ESMTPS id 175F43858C52 for <gcc-patches@gcc.gnu.org>; Fri, 23 Sep 2022 12:04:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 175F43858C52 Received: from pps.filterd (m0046661.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 28N9rsXW007404; Fri, 23 Sep 2022 14:03:58 +0200 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 3jrkmx91dx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 23 Sep 2022 14:03:58 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 879D910002A; Fri, 23 Sep 2022 14:03:56 +0200 (CEST) Received: from Webmail-eu.st.com (shfdag1node3.st.com [10.75.129.71]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 83962228A33; Fri, 23 Sep 2022 14:03:56 +0200 (CEST) Received: from jkgcxl0002.jkg.st.com (10.75.127.47) by SHFDAG1NODE3.st.com (10.75.129.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2375.31; Fri, 23 Sep 2022 14:03:54 +0200 To: <gcc-patches@gcc.gnu.org> Subject: [PATCH] testsuite: Verify that module-mapper is avialable Date: Fri, 23 Sep 2022 14:03:32 +0200 Message-ID: <20220923120331.4136741-1-torbjorn.svensson@foss.st.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [10.75.127.47] X-ClientProxiedBy: SFHDAG2NODE3.st.com (10.75.127.6) 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.528,FMLib:17.11.122.1 definitions=2022-09-23_04,2022-09-22_02,2022-06-22_01 X-Spam-Status: No, score=-11.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, GIT_PATCH_0, 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 X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> From: =?utf-8?q?Torbj=C3=B6rn_SVENSSON_via_Gcc-patches?= <gcc-patches@gcc.gnu.org> Reply-To: =?utf-8?q?Torbj=C3=B6rn_SVENSSON?= <torbjorn.svensson@foss.st.com> Cc: =?utf-8?q?Torbj=C3=B6rn_SVENSSON?= <torbjorn.svensson@foss.st.com> Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" <gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org> |
Series |
testsuite: Verify that module-mapper is avialable
|
|
Commit Message
Torbjorn SVENSSON
Sept. 23, 2022, 12:03 p.m. UTC
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 <torbjorn.svensson@foss.st.com>
---
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(+)
Comments
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 <torbjorn.svensson@foss.st.com> > --- > 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 > +}
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 <torbjorn.svensson@foss.st.com> >>> --- >>> 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 >>> +}
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 <torbjorn.svensson@foss.st.com> >>>> --- >>>> 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 >>>> +}
Hi, Ping, https://gcc.gnu.org/pipermail/gcc-patches/2022-November/604895.html Ok for trunk? Kind regards, Torbjörn On 2022-11-02 19:13, Torbjorn SVENSSON wrote: > 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 <torbjorn.svensson@foss.st.com> >>>>> --- >>>>> 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 >>>>> +}
On Thu, Nov 17, 2022 at 6:09 PM Torbjorn SVENSSON via Gcc-patches <gcc-patches@gcc.gnu.org> wrote: > > Hi, > > Ping, https://gcc.gnu.org/pipermail/gcc-patches/2022-November/604895.html > > Ok for trunk? OK. > Kind regards, > Torbjörn > > On 2022-11-02 19:13, Torbjorn SVENSSON wrote: > > 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 <torbjorn.svensson@foss.st.com> > >>>>> --- > >>>>> 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 > >>>>> +}
On 2022-11-18 09:14, Richard Biener wrote: > On Thu, Nov 17, 2022 at 6:09 PM Torbjorn SVENSSON via Gcc-patches > <gcc-patches@gcc.gnu.org> wrote: >> >> Hi, >> >> Ping, https://gcc.gnu.org/pipermail/gcc-patches/2022-November/604895.html >> >> Ok for trunk? > > OK. Pushed. > >> Kind regards, >> Torbjörn >> >> On 2022-11-02 19:13, Torbjorn SVENSSON wrote: >>> 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 <torbjorn.svensson@foss.st.com> >>>>>>> --- >>>>>>> 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 >>>>>>> +}
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 +}