public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Thomas Schwinge <thomas@codesourcery.com>
To: Alexandre Oliva <oliva@adacore.com>
Cc: <gcc-patches@gcc.gnu.org>
Subject: Re: 'g++.dg/modules/modules.exp': don't leak local 'unsupported' proc [PR108899]
Date: Wed, 5 Apr 2023 09:47:13 +0200	[thread overview]
Message-ID: <87y1n6ojni.fsf@euler.schwinge.homeip.net> (raw)
In-Reply-To: <or1ql6mjob.fsf@lxoliva.fsfla.org>

Hi Alexandre!

On 2023-03-30T10:51:32-0300, Alexandre Oliva via Gcc-patches <gcc-patches@gcc.gnu.org> wrote:
> On Mar 30, 2023, Alexandre Oliva <oliva@adacore.com> wrote:
>
>> If we're dropping the renaming, I suppose we could also revert Jakub's
>> change.  I suppose this patch will take care of it, pending testing...
>
> Regstrapped on x86_64-linux-gnu and also tested on arm-vx7r2 (with
> gcc-12), where I used to get fails after an unsupported modules.exp
> test, but there are no curly braces in the log files after the patch.
> Ok to install?

Given the two "OK"s that you got end of last week, are you going to push
that anytime soon, please?

With...

    Co-authored-by: Thomas Schwinge <thomas@codesourcery.com>

... added, I suppose.


Grüße
 Thomas


> [PR108899] testsuite: fix proc unsupported overriding in modules.exp
>
> The overrider of proc unsupported in modules.exp had two problems
> reported by Thomas Schwinge, even after Jakub Jelínek's fix:
>
> - it remained in effect while running other dejagnu testsets
>
> - it didn't quote correctly the argument list passed to it, which
>   caused test names to be surrounded by curly braces, as in:
>
> UNSUPPORTED: {...}
>
> This patch fixes both issues, obsoleting and reverting Jakub's change,
> by dropping the overrider and renaming the saved proc back, and by
> using uplevel's argument list splicing.
>
>
> for  gcc/testsuite/ChangeLog
>
>       PR testsuite/108899
>       * g++.dg/modules/modules.exp (unsupported): Drop renaming.
>       Fix quoting.
> ---
>  gcc/testsuite/g++.dg/modules/modules.exp |   20 +++++++++++---------
>  1 file changed, 11 insertions(+), 9 deletions(-)
>
> diff --git a/gcc/testsuite/g++.dg/modules/modules.exp b/gcc/testsuite/g++.dg/modules/modules.exp
> index 80aa392bc7f3b..dc302d3d0af48 100644
> --- a/gcc/testsuite/g++.dg/modules/modules.exp
> +++ b/gcc/testsuite/g++.dg/modules/modules.exp
> @@ -319,15 +319,11 @@ cleanup_module_files [find $DEFAULT_REPO *.gcm]
>  # so that, after an unsupported result in dg-test, we can skip rather
>  # than fail subsequent related tests.
>  set module_do {"compile" "P"}
> -if { [info procs unsupported] != [list] \
> -      && [info procs saved-unsupported] == [list] } {
> -    rename unsupported saved-unsupported
> -
> -    proc unsupported { args } {
> -     global module_do
> -     lset module_do 1 "N"
> -     return [saved-unsupported $args]
> -    }
> +rename unsupported modules-saved-unsupported
> +proc unsupported { args } {
> +    global module_do
> +    lset module_do 1 "N"
> +    return [uplevel 1 modules-saved-unsupported $args]
>  }
>
>  # not grouped tests, sadly tcl doesn't have negated glob
> @@ -412,4 +408,10 @@ foreach src [lsort [find $srcdir/$subdir {*_a.[CHX}]] {
>      }
>  }
>
> +# Restore the original unsupported proc, lest it will affect
> +# subsequent test runs, or even fail renaming if we run modules.exp
> +# for multiple targets/multilibs/options.
> +rename unsupported {}
> +rename modules-saved-unsupported unsupported
> +
>  dg-finish
>
>
-----------------
Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955

  parent reply	other threads:[~2023-04-05  7:47 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-17  6:55 [PATCH] Skip module_cmi_p and related unsupported module test Alexandre Oliva
2023-02-20  4:27 ` Jason Merrill
2023-02-22 17:33   ` Alexandre Oliva
2023-02-23 14:18     ` [PATCH] testsuite: Fix up modules.exp [PR108899] Jakub Jelinek
2023-02-23 15:02       ` Richard Biener
2023-03-29 19:59       ` 'g++.dg/modules/modules.exp': don't leak local 'unsupported' proc [PR108899] (was: [PATCH] testsuite: Fix up modules.exp [PR108899]) Thomas Schwinge
2023-03-30  7:00         ` 'g++.dg/modules/modules.exp': don't leak local 'unsupported' proc [PR108899] Alexandre Oliva
2023-03-30  9:39           ` Thomas Schwinge
2023-03-30 13:51           ` Alexandre Oliva
2023-03-31 18:52             ` Jason Merrill
2023-04-01 18:06             ` Mike Stump
2023-04-05  7:47             ` Thomas Schwinge [this message]
2023-04-06  2:38               ` Alexandre Oliva
2023-04-06 20:11                 ` Thomas Schwinge
2023-04-06 23:40                   ` Alexandre Oliva

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87y1n6ojni.fsf@euler.schwinge.homeip.net \
    --to=thomas@codesourcery.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=oliva@adacore.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).