Re: [rfc] Revamp logical.exp

Andrew Cagney
2004-07-14T19:15:30Z

> The basic idea and the implementation are good.
>
> I hand-checked all the data in the tables for correctness.
> It all looks fine to me.
>
> In the test name, could you include something grep'able.
> So that if someone gets:
>
> FAIL: logical.exp: evaluation of x == y, {x = 1, y = 0}
>
> They can find the right gdb_test by grepping on the wordage
> ("evalation of").
>
> Yes, I see that there are only two gdb_test's in the whole file,
> but I like the test names to have searchable parts. This has
> been essential to me when finding things in structs.exp.
>
> Also please consider adding $val into the test name:
>
> FAIL: logical.exp: evaluation of x == y; {x = 1, y = 0}; expected 0

Like:

variables x=1,y=0; initialize
variables x=1,y=0; evaluate x == y; expecting 0

It reflects how the loop is implemented.

However, I could change the test to something like:

gdb_test "print x=1,y=0,x == y" " = 0" "evaluate x = y; variables
x=1,y=0; expecting 0"

If you want spaces, I'll need to tweak the tables.

> I think that makes it easier to see whether the test is written
> correctly or not, especially when someone goes to add 50 new tests.
>
> And, as always ... did you run it somewhere?

My favorite, amd64 GNU/Linux.

> 2004-07-14 Andrew Cagney <cagney@gnu.org>
>
> * gdb.base/logical.exp: Update copyright.
> (evaluate): New procedure. Use to re-implement tests using
> several tables.

Andrew