Re: [PATCHv3 2/3] gdb/testsuite: Detect and warn about duplicate test names

Simon Marchi
2020-07-31T21:34:08Z

On 2020-04-30 7:20 a.m., Andrew Burgess wrote:
> Building on the previous commit, this patch detects when two tests
> have the same test name and causes Dejagnu to print a new result type
> '# of duplicate test names' in the result summary. A line starting
> with 'DUPLICATE: ' is also added to the gdb.sum and gdb.log files.
>
> The DUPLICATE markers will be printed the second time a duplicate test
> name is seen, and every time after that. So you might see:
>
> PASS: gdb.base/sometest.exp: foo
> PASS: gdb.base/sometest.exp: bar
> PASS: gdb.base/sometest.exp: foo
> DUPLICATE: gdb.base/sometest.exp: foo
> PASS: gdb.base/sometest.exp: baz
> PASS: gdb.base/sometest.exp: foo
> DUPLICATE: gdb.base/sometest.exp: foo
>
> However, the results will report a duplicate count of 1, indicating
> that just one test name (foo) was duplicated.
>
> Currently if the tests are run in parallel mode the new result type is
> not merged into the combined summary file so users will need to run in
> non-parallel mode to check this result. Similarly, the 'DUPLICATE: '
> markers will not be merged into the final gdb.sum file. A later
> commit will fix this.

Hi Andrew,

When testing on Red Hat 7.8 (machine gcc135), I get this, which I think is related to this
change.

Running /home/simark/src/binutils-gdb/gdb/testsuite/gdb.ada/O2_float_param.exp ...
can't unset "all_test_names": no such variable
while executing
"unset all_test_names"

This machine has Dejagnu 1.5.1, which I suppose is the version that comes with this distro
version.

I'm kind of curious that this has not been reported before (or I missed it?). Do you think it
would be easy to make this feature compatible with that version of Dejagnu? Otherwise, could
we document the required version of dejagnu required to run the testsuite?

Simon