[v2,01/79] Don't use ensure_gdb_index with require

Message ID 20230112030052.3306113-2-tom@tromey.com
State Committed
Headers
Series Rewrite "require" test procedure and use it more often |

Commit Message

Tom Tromey Jan. 12, 2023, 2:59 a.m. UTC
  This series changes 'require' to take a list of simple predicates.
This patch backs out the one use of 'require' that doesn't conform to
this -- calling ensure_gdb_index.
---
 gdb/testsuite/gdb.base/with-mf.exp                    | 5 ++++-
 gdb/testsuite/gdb.dwarf2/gdb-add-index-symlink.exp    | 5 ++++-
 gdb/testsuite/gdb.dwarf2/gdb-add-index.exp            | 5 ++++-
 gdb/testsuite/gdb.dwarf2/gdb-index-types-dwarf5.exp   | 5 ++++-
 gdb/testsuite/gdb.dwarf2/imported-unit-runto-main.exp | 5 ++++-
 gdb/testsuite/gdb.rust/dwindex.exp                    | 5 ++++-
 6 files changed, 24 insertions(+), 6 deletions(-)
  

Patch

diff --git a/gdb/testsuite/gdb.base/with-mf.exp b/gdb/testsuite/gdb.base/with-mf.exp
index c16027b6f18..f26d48e1026 100644
--- a/gdb/testsuite/gdb.base/with-mf.exp
+++ b/gdb/testsuite/gdb.base/with-mf.exp
@@ -24,7 +24,10 @@  if {[prepare_for_testing "failed to prepare" $testfile "$srcfile $srcfile2" \
     return -1
 }
 
-require {ensure_gdb_index $binfile} != -1
+if { [ensure_gdb_index $binfile] == -1 } {
+    untested "error adding gdb index"
+    return -1
+}
 
 clean_restart $binfile
 
diff --git a/gdb/testsuite/gdb.dwarf2/gdb-add-index-symlink.exp b/gdb/testsuite/gdb.dwarf2/gdb-add-index-symlink.exp
index e65cc88e427..d8ed180e31b 100644
--- a/gdb/testsuite/gdb.dwarf2/gdb-add-index-symlink.exp
+++ b/gdb/testsuite/gdb.dwarf2/gdb-add-index-symlink.exp
@@ -29,7 +29,10 @@  with_test_prefix non-symlink {
 	return -1
     }
 
-    require {ensure_gdb_index $binfile} != -1
+    if { [ensure_gdb_index $binfile] == -1 } {
+	untested "error adding gdb index"
+	return -1
+    }
 }
 
 # Regenerate exec without index.
diff --git a/gdb/testsuite/gdb.dwarf2/gdb-add-index.exp b/gdb/testsuite/gdb.dwarf2/gdb-add-index.exp
index 12dc2c3d2d7..248bb28aabf 100644
--- a/gdb/testsuite/gdb.dwarf2/gdb-add-index.exp
+++ b/gdb/testsuite/gdb.dwarf2/gdb-add-index.exp
@@ -27,7 +27,10 @@  if { [prepare_for_testing "failed to prepare" "${testfile}" \
     return -1
 }
 
-require {ensure_gdb_index $binfile} != -1
+if { [ensure_gdb_index $binfile] == -1 } {
+    untested "error adding gdb index"
+    return -1
+}
 
 # Ok, we have a copy of $binfile with an index.
 # Restart gdb and verify the index was used.
diff --git a/gdb/testsuite/gdb.dwarf2/gdb-index-types-dwarf5.exp b/gdb/testsuite/gdb.dwarf2/gdb-index-types-dwarf5.exp
index fc85795b996..2c9f037a80e 100644
--- a/gdb/testsuite/gdb.dwarf2/gdb-index-types-dwarf5.exp
+++ b/gdb/testsuite/gdb.dwarf2/gdb-index-types-dwarf5.exp
@@ -24,7 +24,10 @@  if { [prepare_for_testing "failed to prepare" ${testfile} \
     return -1
 }
 
-require {ensure_gdb_index $binfile} == 1
+if { [ensure_gdb_index $binfile] != 1 } {
+    untested "error adding gdb index"
+    return -1
+}
 
 clean_restart ${binfile}
 
diff --git a/gdb/testsuite/gdb.dwarf2/imported-unit-runto-main.exp b/gdb/testsuite/gdb.dwarf2/imported-unit-runto-main.exp
index 92573034b9b..09c26ebaaf5 100644
--- a/gdb/testsuite/gdb.dwarf2/imported-unit-runto-main.exp
+++ b/gdb/testsuite/gdb.dwarf2/imported-unit-runto-main.exp
@@ -74,7 +74,10 @@  if { [prepare_for_testing "failed to prepare" ${testfile} \
     return -1
 }
 
-require {ensure_gdb_index $binfile} != -1
+if { [ensure_gdb_index $binfile] == -1 } {
+    untested "error adding gdb index"
+    return -1
+}
 
 clean_restart ${binfile}
 
diff --git a/gdb/testsuite/gdb.rust/dwindex.exp b/gdb/testsuite/gdb.rust/dwindex.exp
index 306a7e7b246..4f05cb9eca8 100644
--- a/gdb/testsuite/gdb.rust/dwindex.exp
+++ b/gdb/testsuite/gdb.rust/dwindex.exp
@@ -26,7 +26,10 @@  if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug rust}]} {
     return -1
 }
 
-require {ensure_gdb_index $binfile -dwarf-5} != -1
+if {[ensure_gdb_index $binfile -dwarf-5] == -1} {
+    untested "error adding gdb index"
+    return -1
+}
 
 gdb_exit
 gdb_start