Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Andrew Burgess <andrew.burgess@embecosm.com>
To: Keith Seitz <keiths@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH 2/4] gdb/testsuite: Detect and warn if paths are used in test names
Date: Mon, 27 Apr 2020 20:06:03 +0100	[thread overview]
Message-ID: <20200427190603.GH3522@embecosm.com> (raw)
In-Reply-To: <856efd0a-243d-e366-eb48-85fc65349706@redhat.com>

* Keith Seitz <keiths@redhat.com> [2020-04-27 09:42:30 -0700]:

> On 4/27/20 8:58 AM, Andrew Burgess wrote:
> > * Keith Seitz <keiths@redhat.com> [2020-04-23 13:26:30 -0700]:
> >>> +set local_record_procs(pass) "check_test_names"
> >>> +set local_record_procs(fail) "check_test_names"
> >>> +set local_record_procs(xfail) "check_test_names"
> >>> +set local_record_procs(kfail) "check_test_names"
> >>> +set local_record_procs(xpass) "check_test_names"
> >>> +set local_record_procs(kpass) "check_test_names"
> >>> +set local_record_procs(unresolved) "check_test_names"
> >>> +set local_record_procs(untested) "check_test_names"
> >>> +set local_record_procs(unsupported) "check_test_names"
> >>
> >> Since I failed to contain the Tcl pedantic in me, the above
> >> can be more Tcl-ishly written with `array set', but I am not
> >> requesting that you change anything. Just FYI.
> > 
> > Thanks for your feedback, I'm making a few changes to the patch, but I
> > wanted to follow up on the 'array set' issue, I'd like to get things
> > right where I can, however, in this case....
> > 
> >   $ tclsh
> >   % array set foo {}
> >   % array set foo(bar) 1
> >   list must have an even number of elements
> > 
> > This is inline with what I see when I try to use 'array set ....'
> > within the Dejagnu script, I get the error 'list must have an even
> > number of elements'.
> > 
> > Is there something I'm doing wrong here? Or is 'array set' not
> > actually needed in this case?
> 
> To be clear -- I apologize if I wasn't earlier -- you do not /need/
> to use array set. As I mentioned, the more Tcl-ish way to write large
> array initializations is
> 
> array set local_record_procs {
>   pass check_test_names
>   fail check_test_names
>   # ...
> }
> 
> "array set" takes a list of key-value pairs, so there must be
> an even number of elements in the list.
> 
> However, in hindsight, since all these are being set to the same
> value, an even more Tcl-ish way:
> 
> foreach nm {pass fail xfail kfail xpass kpass unresolved untested unsupported} {
>   set local_record_procs($nm) check_test_names
> }
> 
> [While tempting to use "[array names local_record_procs]", reading framework.exp
> shows that this array is not actually expected to exist, so we have to
> explicitly list out all test result outcomes.]
> 
> Okay, that was probably way more hassle than necessary... I promise to
> backburner my [counterproductive] Tcl pedantic-ness[sic]!

No, it's not a problem.  Dejagnu / TCL isn't likely to go anywhere
anytime soon, so it's always good to learn more.

I'll incorporate your suggested foreach loop improvement.

Thanks,
Andrew


  reply	other threads:[~2020-04-27 19:06 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-23 17:53 [PATCH 0/4] Automatic detection of test name problems Andrew Burgess
2020-04-23 17:53 ` [PATCH 1/4] gdb/testsuite: Remove build paths from test names Andrew Burgess
2020-04-24 14:00   ` Simon Marchi
2020-04-23 17:53 ` [PATCH 2/4] gdb/testsuite: Detect and warn if paths are used in " Andrew Burgess
2020-04-23 20:26   ` Keith Seitz
2020-04-27 15:58     ` Andrew Burgess
2020-04-27 16:42       ` Keith Seitz
2020-04-27 19:06         ` Andrew Burgess [this message]
2020-04-23 17:53 ` [PATCH 3/4] gdb/testsuite: Detect and warn about duplicate " Andrew Burgess
2020-04-23 20:28   ` Keith Seitz
2020-04-23 17:53 ` [PATCH 4/4] contrib: Handle GDB specific test result types Andrew Burgess
2020-04-23 20:25 ` [PATCH 0/4] Automatic detection of test name problems Keith Seitz
2020-04-27 22:01 ` [PATCHv2 0/3] " Andrew Burgess
2020-04-27 22:01   ` [PATCHv2 1/3] gdb/testsuite: Detect and warn if paths are used in test names Andrew Burgess
2020-04-27 22:01   ` [PATCHv2 2/3] gdb/testsuite: Detect and warn about duplicate " Andrew Burgess
2020-04-27 22:01   ` [PATCHv2 3/3] contrib: Handle GDB specific test result types Andrew Burgess
2020-04-28 19:08   ` [PATCHv2 0/3] Automatic detection of test name problems Keith Seitz
2020-04-29  9:02     ` Andrew Burgess
2020-04-29 15:04       ` Simon Marchi
2020-04-29 15:38         ` Andrew Burgess
2020-04-29 16:03           ` Keith Seitz
2020-04-29 18:22             ` Simon Marchi
2020-04-30 11:20   ` [PATCHv3 " Andrew Burgess
2020-04-30 11:20     ` [PATCHv3 1/3] gdb/testsuite: Detect and warn if paths are used in test names Andrew Burgess
2020-04-30 11:20     ` [PATCHv3 2/3] gdb/testsuite: Detect and warn about duplicate " Andrew Burgess
2020-07-31 21:34       ` Simon Marchi
2020-08-03 10:02         ` Andrew Burgess
2020-08-03 12:18           ` Simon Marchi
2020-04-30 11:20     ` [PATCHv3 3/3] contrib: Handle GDB specific test result types Andrew Burgess
2020-04-30 18:01     ` [PATCHv3 0/3] Automatic detection of test name problems Tom Tromey
2020-05-11 21:30     ` Andrew Burgess
2020-05-12 16:48       ` Andrew Burgess

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=20200427190603.GH3522@embecosm.com \
    --to=andrew.burgess@embecosm.com \
    --cc=gdb-patches@sourceware.org \
    --cc=keiths@redhat.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