binutils: testsuite: fix duplicate testnames in readelf.exp

Message ID 20250916153121.3214496-1-rearnsha@arm.com
State New
Headers
Series binutils: testsuite: fix duplicate testnames in readelf.exp |

Commit Message

Richard Earnshaw Sept. 16, 2025, 3:31 p.m. UTC
  There are two places in readelf.exp where we generate duplicate
testnames.

The first is due to calling readelf_find_size twice with the same
iteration index (2).  This is fixed by using 4 for the second
instance.

The other is at the end of readelf_thin_archive_test.  This test calls
readelf_test before unconditionally passing.  It happens to construct
exactly the same test name as readelf test (might not be a
coincidence), so we end up with a duplicate test.  But it seems wrong
anyway to 'pass' a test that readelf_test might have failed, so simply
delete this duplicate pass entry.
---

Jan, do you agree with my analysis?

 binutils/testsuite/binutils-all/readelf.exp | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
  

Comments

Jan Beulich Sept. 16, 2025, 4:14 p.m. UTC | #1
On 16.09.2025 17:31, Richard Earnshaw wrote:
> There are two places in readelf.exp where we generate duplicate
> testnames.
> 
> The first is due to calling readelf_find_size twice with the same
> iteration index (2).  This is fixed by using 4 for the second
> instance.
> 
> The other is at the end of readelf_thin_archive_test.  This test calls
> readelf_test before unconditionally passing.  It happens to construct
> exactly the same test name as readelf test (might not be a
> coincidence), so we end up with a duplicate test.  But it seems wrong
> anyway to 'pass' a test that readelf_test might have failed, so simply
> delete this duplicate pass entry.
> ---
> 
> Jan, do you agree with my analysis?

Yes, and thanks.

Jan
  

Patch

diff --git a/binutils/testsuite/binutils-all/readelf.exp b/binutils/testsuite/binutils-all/readelf.exp
index 22f2a355bfd..dcb63b16c4c 100644
--- a/binutils/testsuite/binutils-all/readelf.exp
+++ b/binutils/testsuite/binutils-all/readelf.exp
@@ -332,8 +332,6 @@  proc readelf_thin_archive_test {} {
     }
 
     readelf_test -h $libname readelf.h.thin
-
-    pass $testname
 }
 
 if ![is_remote host] {
@@ -629,7 +627,7 @@  if ![is_remote host] {
 }
 
 # First, determine the size, so specific output matchers can be used.
-readelf_find_size $tempfile 2
+readelf_find_size $tempfile 4
 
 # Make sure that readelf can decode the contents.
 readelf_test -wi $tempfile dw5-op.W