[05/46] Use require supports_process_record

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

Commit Message

Tom Tromey Dec. 17, 2022, 12:07 a.m. UTC
  This changes some tests to use "require supports_process_record".
---
 gdb/testsuite/gdb.mi/mi-record-changed.exp          |  4 +---
 gdb/testsuite/gdb.python/py-record-full.exp         |  5 +----
 gdb/testsuite/gdb.reverse/break-precsave.exp        | 10 +++-------
 gdb/testsuite/gdb.reverse/consecutive-precsave.exp  | 10 +++-------
 gdb/testsuite/gdb.reverse/i386-precsave.exp         | 10 +++-------
 gdb/testsuite/gdb.reverse/machinestate-precsave.exp | 10 +++-------
 gdb/testsuite/gdb.reverse/solib-precsave.exp        | 13 +++----------
 gdb/testsuite/gdb.reverse/step-precsave.exp         | 10 +++-------
 gdb/testsuite/gdb.reverse/until-precsave.exp        | 10 +++-------
 gdb/testsuite/gdb.reverse/watch-precsave.exp        | 10 +++-------
 10 files changed, 26 insertions(+), 66 deletions(-)
  

Patch

diff --git a/gdb/testsuite/gdb.mi/mi-record-changed.exp b/gdb/testsuite/gdb.mi/mi-record-changed.exp
index b49bc12eaed..1d7dfbd5f58 100644
--- a/gdb/testsuite/gdb.mi/mi-record-changed.exp
+++ b/gdb/testsuite/gdb.mi/mi-record-changed.exp
@@ -13,9 +13,7 @@ 
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if ![supports_process_record] {
-    return
-}
+require supports_process_record
 
 standard_testfile basics.c
 if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \
diff --git a/gdb/testsuite/gdb.python/py-record-full.exp b/gdb/testsuite/gdb.python/py-record-full.exp
index 52d6dd3da0b..c8efd9c5889 100644
--- a/gdb/testsuite/gdb.python/py-record-full.exp
+++ b/gdb/testsuite/gdb.python/py-record-full.exp
@@ -17,10 +17,7 @@ 
 
 # Skip this test if target does not support recording.
 
-if { ![supports_process_record] } {
-    untested "skipping recording tests"
-    return -1
-}
+require supports_process_record
 
 load_lib gdb-python.exp
 
diff --git a/gdb/testsuite/gdb.reverse/break-precsave.exp b/gdb/testsuite/gdb.reverse/break-precsave.exp
index 937bf060134..52251a94022 100644
--- a/gdb/testsuite/gdb.reverse/break-precsave.exp
+++ b/gdb/testsuite/gdb.reverse/break-precsave.exp
@@ -17,9 +17,7 @@ 
 # with breakpoints in a process record logfile.
 
 # This test suitable only for process record-replay
-if ![supports_process_record] {
-    return
-}
+require supports_process_record
 
 standard_testfile break-reverse.c
 set precsave [standard_output_file break.precsave]
@@ -39,10 +37,8 @@  proc precsave_tests {} {
 
     runto_main
 
-    if [supports_process_record] {
-	# Activate process record/replay
-	gdb_test_no_output "record" "turn on process record"
-    }
+    # Activate process record/replay
+    gdb_test_no_output "record" "turn on process record"
 
     gdb_test "break $end_location" \
 	"Breakpoint $decimal at .*$srcfile, line $end_location\." \
diff --git a/gdb/testsuite/gdb.reverse/consecutive-precsave.exp b/gdb/testsuite/gdb.reverse/consecutive-precsave.exp
index d1d1aa2b061..e57730a12c3 100644
--- a/gdb/testsuite/gdb.reverse/consecutive-precsave.exp
+++ b/gdb/testsuite/gdb.reverse/consecutive-precsave.exp
@@ -17,9 +17,7 @@ 
 # consecutive instructions in a process record logfile.
 
 # This test suitable only for process record-replay
-if ![supports_process_record] {
-    return
-}
+require supports_process_record
 
 standard_testfile consecutive-reverse.c
 set precsave [standard_output_file consecutive.precsave]
@@ -30,10 +28,8 @@  if { [prepare_for_testing "failed to prepare" $testfile $srcfile] } {
 
 runto_main
 
-if [supports_process_record] {
-    # Activate process record/replay
-    gdb_test_no_output "record" "turn on process record"
-}
+# Activate process record/replay
+gdb_test_no_output "record" "turn on process record"
 
 set is_stmt [is_stmt_addresses $srcfile]
 
diff --git a/gdb/testsuite/gdb.reverse/i386-precsave.exp b/gdb/testsuite/gdb.reverse/i386-precsave.exp
index fbf80b89c05..c2467b56c27 100644
--- a/gdb/testsuite/gdb.reverse/i386-precsave.exp
+++ b/gdb/testsuite/gdb.reverse/i386-precsave.exp
@@ -20,9 +20,7 @@ 
 #
 
 # This test suitable only for process record-replay
-if ![supports_process_record] {
-    return
-}
+require supports_process_record
 
 
 if {![is_x86_like_target]} {
@@ -46,10 +44,8 @@  set end_of_inc_dec_tests [gdb_get_line_number " end inc_dec_tests "]
 
 runto_main
 
-if [supports_process_record] {
-    # Activate process record/replay
-    gdb_test_no_output "record" "turn on process record"
-}
+# Activate process record/replay
+gdb_test_no_output "record" "turn on process record"
 
 global hex
 global decimal
diff --git a/gdb/testsuite/gdb.reverse/machinestate-precsave.exp b/gdb/testsuite/gdb.reverse/machinestate-precsave.exp
index bafea4a30f6..c58ad08c2d4 100644
--- a/gdb/testsuite/gdb.reverse/machinestate-precsave.exp
+++ b/gdb/testsuite/gdb.reverse/machinestate-precsave.exp
@@ -36,9 +36,7 @@ 
 #
 
 # This test suitable only for process record-replay
-if ![supports_process_record] {
-    return
-}
+require supports_process_record
 
 standard_testfile machinestate.c ms1.c
 set precsave [standard_output_file machinestate.precsave]
@@ -57,10 +55,8 @@  set endmain   [gdb_get_line_number " end main "   $srcfile]
 
 runto_main
 
-if [supports_process_record] {
-    # Activate process record/replay
-    gdb_test_no_output "record" "turn on process record"
-}
+# Activate process record/replay
+gdb_test_no_output "record" "turn on process record"
 
 gdb_test "break $endmain" \
     "Breakpoint $decimal at .*$srcfile, line $endmain\." \
diff --git a/gdb/testsuite/gdb.reverse/solib-precsave.exp b/gdb/testsuite/gdb.reverse/solib-precsave.exp
index 67bb52addeb..1a6af90986e 100644
--- a/gdb/testsuite/gdb.reverse/solib-precsave.exp
+++ b/gdb/testsuite/gdb.reverse/solib-precsave.exp
@@ -17,12 +17,7 @@ 
 # with shared libraries and a logfile.
 
 # This test suitable only for process record-replay
-if ![supports_process_record] {
-    return
-}
-if {[skip_shlib_tests]} {
-    return
-}
+require supports_process_record !skip_shlib_tests
 
 standard_testfile solib-reverse.c
 set precsave [standard_output_file solib.precsave]
@@ -77,10 +72,8 @@  gdb_load_shlib $library2
 
 runto_main
 
-if [supports_process_record] {
-    # Activate process record/replay
-    gdb_test_no_output "record" "turn on process record"
-}
+# Activate process record/replay
+gdb_test_no_output "record" "turn on process record"
 
 set end_of_main [gdb_get_line_number "end of main" ]
 gdb_test "break $end_of_main" \
diff --git a/gdb/testsuite/gdb.reverse/step-precsave.exp b/gdb/testsuite/gdb.reverse/step-precsave.exp
index 3279b6ce879..33c5051c7f8 100644
--- a/gdb/testsuite/gdb.reverse/step-precsave.exp
+++ b/gdb/testsuite/gdb.reverse/step-precsave.exp
@@ -21,9 +21,7 @@ 
 #
 
 # This test suitable only for process record-replay
-if ![supports_process_record] {
-    return
-}
+require supports_process_record
 
 standard_testfile step-reverse.c
 set precsave [standard_output_file step.precsave]
@@ -34,10 +32,8 @@  if { [prepare_for_testing "failed to prepare" $testfile $srcfile] } {
 
 runto_main
 
-if [supports_process_record] {
-    # Activate process record/replay
-    gdb_test_no_output "record" "turn on process record"
-}
+# Activate process record/replay
+gdb_test_no_output "record" "turn on process record"
 
 set end_of_main [gdb_get_line_number "end of main" ]
 gdb_test "break $end_of_main" \
diff --git a/gdb/testsuite/gdb.reverse/until-precsave.exp b/gdb/testsuite/gdb.reverse/until-precsave.exp
index 98a5188837f..68878bc8f73 100644
--- a/gdb/testsuite/gdb.reverse/until-precsave.exp
+++ b/gdb/testsuite/gdb.reverse/until-precsave.exp
@@ -17,9 +17,7 @@ 
 # 'advance' in precord logfile.
 
 # This test suitable only for process record-replay
-if ![supports_process_record] {
-    return
-}
+require supports_process_record
 
 standard_testfile until-reverse.c ur1.c
 set precsave [standard_output_file until.precsave]
@@ -38,10 +36,8 @@  set bp_location21 [gdb_get_line_number "set breakpoint 21 here"]
 
 runto_main
 
-if [supports_process_record] {
-    # Activate process record/replay
-    gdb_test_no_output "record" "turn on process record"
-}
+# Activate process record/replay
+gdb_test_no_output "record" "turn on process record"
 
 set end_of_main [gdb_get_line_number "set breakpoint 10a here" ]
 gdb_test "break $end_of_main" \
diff --git a/gdb/testsuite/gdb.reverse/watch-precsave.exp b/gdb/testsuite/gdb.reverse/watch-precsave.exp
index ceac823bd6c..181157c837d 100644
--- a/gdb/testsuite/gdb.reverse/watch-precsave.exp
+++ b/gdb/testsuite/gdb.reverse/watch-precsave.exp
@@ -18,9 +18,7 @@ 
 # debugging with watchpoints.
 
 # This test suitable only for process record-replay
-if ![supports_process_record] {
-    return
-}
+require supports_process_record
 
 standard_testfile watch-reverse.c
 set precsave [standard_output_file watch.precsave]
@@ -31,10 +29,8 @@  if { [prepare_for_testing "failed to prepare" $testfile $srcfile] } {
 
 runto_main
 
-if [supports_process_record] {
-    # Activate process record/replay
-    gdb_test_no_output "record" "turn on process record"
-}
+# Activate process record/replay
+gdb_test_no_output "record" "turn on process record"
 
 set end_location  [gdb_get_line_number "end of main"  ]
 gdb_test "break $end_location" \