Fix gdb.fortran "failed to extract expected results" errors
authorKeith Seitz <keiths@redhat.com>
Mon, 28 Feb 2022 15:31:32 +0000 (07:31 -0800)
committerKeith Seitz <keiths@redhat.com>
Mon, 28 Feb 2022 15:31:32 +0000 (07:31 -0800)
When running the gdb.fortran tests array-slices.exp and lbound-ubound.exp,
the test suite throws several ERRORs on native-gdbserver/-m{32,64},
and native-extended-gdbsever/-m{32,64}:

[on native-extended-gdbserver/-m64]
Running /home/keiths/work/gdb/branches/testsuite-errors/linux/gdb/testsuite/../../../src/gdb/testsuite/gdb.fortran/array-slices.exp ...
ERROR: failed to extract expected results
ERROR: failed to extract expected results
Running /home/keiths/work/gdb/branches/testsuite-errors/linux/gdb/testsuite/../../../src/gdb/testsuite/gdb.fortran/lbound-ubound.exp ...
ERROR: failed to extract expected results for lbound

This occurs because the tests require inferior I/O which we do not have
access to while using these targets.

This patch skips these tests when running on non-native targets.

gdb/testsuite/gdb.fortran/array-slices.exp
gdb/testsuite/gdb.fortran/lbound-ubound.exp

index 5a909812fe3ea8b81a4815f4826b3f1a1d2838ea..8f9c012e3991d15c8041cf6f8144d029c1d7a478 100644 (file)
@@ -62,6 +62,12 @@ proc run_test { repack } {
        return -1
     }
 
+    # This test relies on output from the inferior and is not supported on
+    # remote targets.
+    if {![gdb_is_target_native]} {
+       return 0
+    }
+
     # Avoid libc symbols, in particular the 'array' type.
     gdb_test_no_output "nosharedlibrary"
 
index 51dd38184999fae6a5238b3c658fc8f31393ec57..671b251c799ad6af9a9137975529c3a3a33a8937 100644 (file)
@@ -32,6 +32,12 @@ if ![fortran_runto_main] {
     return -1
 }
 
+# This test relies on output from the inferior and is not supported on
+# remote targets.
+if {![gdb_is_target_native]} {
+   return 0
+}
+
 # Avoid libc symbols, in particular the 'array' type.
 gdb_test_no_output "nosharedlibrary"