[RFA]: C++ namespace test patch

Kevin Buettner kevinb@cygnus.com
Fri Nov 3 16:01:00 GMT 2000


On Nov 2, 10:08pm, Daniel Berlin wrote:

> This fixes the ordering to be in line with the new result.
> I'm no dejagnu expert, i'd like to actually change it to not depend on
> the ordering at all.
> Is there any way to do this?
> >From what i understand, it only keeps what didn't match after the
> match, so i can't do:
> 
> -re ".*AAA::xyzq"
> {
>         -re ".*BBB::xyz"
>          {
>             etc
> 
> }
> 
> because if BBB::xyz appears before AAA::xyzq, it'll fail.
> Is my understanding incorrect?

Dan,

I'm not an expert on this stuff either, but I think that you're
correct.  Even if you could do something like the above, it
would be insufficient since it doesn't test for output that
shouldn't be there.  (I.e. suppose gdb output all the lines
you were interested in plus a dozen others which were incorrect.)

With regard to making the test not depend on the order of the
output from the list, this is what I suggest:

 1) Retrieve the output from the command.

 2) Strip off leading and trailing junk from the output.

 3) Make sure each line in the remainder is of the correct (generic) form.

 4) Strip off the junk that you don't care about from each line.

 5) Sort the (now canonicalized) lines.

 6) Compare against a presorted list of expected lines in canonical
    form.

This is the sort of thing that I could do in several lines of Perl, but
doing it in tcl / expect is something that I'm not comfortable with...
...but we do have folks on the list who can do this sort of thing
without breaking a sweat.

Kevin


More information about the Gdb-patches mailing list