]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
[gdb/testsuite] Fix duplicates in gdb.fortran/huge.exp
authorTom de Vries <tdevries@suse.de>
Thu, 20 Jun 2024 13:37:48 +0000 (15:37 +0200)
committerTom de Vries <tdevries@suse.de>
Thu, 20 Jun 2024 13:37:48 +0000 (15:37 +0200)
With test-case gdb.fortran/huge.exp, on a system without fortran compiler, I
ran into a number of duplicates:
...
Running /home/vries/gdb/src/gdb/testsuite/gdb.fortran/huge.exp ...
gdb compile failed, default_target_compile: Can't find gfortran.
UNTESTED: gdb.fortran/huge.exp: huge.exp
  ...
gdb compile failed, default_target_compile: Can't find gfortran.
UNTESTED: gdb.fortran/huge.exp: huge.exp
DUPLICATE: gdb.fortran/huge.exp: huge.exp
UNSUPPORTED: gdb.fortran/huge.exp: require failed: expr $compilation_succeeded
...

Fix this by wrapping the compile in a with_test_prefix, getting us instead:
...
gdb compile failed, default_target_compile: Can't find gfortran.
UNTESTED: gdb.fortran/huge.exp: CRASH_GDB=2097152: huge.exp
  ...
gdb compile failed, default_target_compile: Can't find gfortran.
UNTESTED: gdb.fortran/huge.exp: CRASH_GDB=16: huge.exp
UNSUPPORTED: gdb.fortran/huge.exp: require failed: expr $compilation_succeeded
...

Tested on x86_64-linux.

gdb/testsuite/gdb.fortran/huge.exp

index 8d2158f172b144f75394d4c6bdc7c0fe03f1d924..78c1d521e2a4527840c8209a96e41db8eb1f9c8a 100644 (file)
@@ -37,8 +37,10 @@ lappend opts f90
 set compilation_succeeded 0
 for { set size [expr $max] } { $size >= $min } { set size [expr $size / 2] } {
     set try_opts [concat $opts [list additional_flags=-DCRASH_GDB=$size]]
-    if { [build_executable $testfile.exp $testfile $srcfile $try_opts] == -1 } {
-       continue
+    with_test_prefix CRASH_GDB=$size {
+       if { [build_executable $testfile.exp $testfile $srcfile $try_opts] == -1 } {
+           continue
+       }
     }
 
     set compilation_succeeded 1