diff options
author | Tom de Vries <tdevries@suse.de> | 2024-07-31 15:04:25 +0200 |
---|---|---|
committer | Tom de Vries <tdevries@suse.de> | 2024-07-31 15:04:25 +0200 |
commit | 35f09cd5d7fdd1a64f4d1751e73c3495bef1ed99 (patch) | |
tree | 78266ecbffb4d52f66da9254fb05a72a9aecd6f3 /gdb/testsuite/gdb.cp/cold-clone.cc | |
parent | 61ed16ee6341535924e5e601964afc6c256258e6 (diff) | |
download | gdb-35f09cd5d7fdd1a64f4d1751e73c3495bef1ed99.zip gdb-35f09cd5d7fdd1a64f4d1751e73c3495bef1ed99.tar.gz gdb-35f09cd5d7fdd1a64f4d1751e73c3495bef1ed99.tar.bz2 |
[gdb/testsuite] Detect trailing-text-in-parentheses duplicates
When using a duplicate test name:
...
fail foo
fail foo
...
we get:
...
FAIL: $exp: foo
FAIL: $exp: foo
DUPLICATE: $exp: foo
...
But when we do:
...
fail foo
fail "foo (timeout)"
...
we get only:
...
FAIL: $exp: foo
FAIL: $exp: foo (timeout)
...
Trailing text between parentheses prefixed with a space is interpreted as
extra information, and not as part of the test name [1].
Consequently, "foo" and "foo (timeout)" do count as duplicate test names,
which should have been detected. This is PR testsuite/29772.
Fix this in CheckTestNames::_check_duplicates, such that we get:
...
FAIL: $exp: foo
FAIL: $exp: foo (timeout)
DUPLICATE: $exp: foo (timeout)
...
[ One note on the implementation: I used the regexp { \([^()]*\)$}. I don't
know whether that covers all required cases, due to the fact that those are
not unambiguousely specified. It might be possible to reverse-engineer that
information by reading or running the "regression analysis tools" mentioned on
the wiki page [1], but I haven't been able to. Regardless, the current regexp
covers a large amount of cases, which IMO should be sufficient to be
acceptable. ]
Doing so shows many new duplicates in the testsuite.
A significant number of those is due to using a message which is a copy of the
command:
...
gdb_test "print (1)"
...
Fix this by handling those cases using test names "gdb-command<print (1)>" and
"gdb-command<print (2)>.
Fix the remaining duplicates manually (split off as follow-up patch for
readability of this patch).
Tested on x86_64-linux and aarch64-linux.
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=29772
[1] https://sourceware.org/gdb/wiki/GDBTestcaseCookbook#Do_not_use_.22tail_parentheses.22_on_test_messages
Diffstat (limited to 'gdb/testsuite/gdb.cp/cold-clone.cc')
0 files changed, 0 insertions, 0 deletions