[43/46] Use require target_can_use_run_cmd

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

Commit Message

Tom Tromey Dec. 17, 2022, 12:08 a.m. UTC
  This changes some tests to use "require target_can_use_run_cmd".
---
 gdb/testsuite/gdb.base/annota1.exp                    | 4 +---
 gdb/testsuite/gdb.base/annota3.exp                    | 4 +---
 gdb/testsuite/gdb.base/dprintf-execution-x-script.exp | 4 +---
 gdb/testsuite/gdb.cp/annota2.exp                      | 4 +---
 gdb/testsuite/gdb.cp/annota3.exp                      | 4 +---
 gdb/testsuite/gdb.multi/bkpt-multi-exec.exp           | 4 +---
 6 files changed, 6 insertions(+), 18 deletions(-)
  

Patch

diff --git a/gdb/testsuite/gdb.base/annota1.exp b/gdb/testsuite/gdb.base/annota1.exp
index 675f3afe2d4..6c0630b4bdd 100644
--- a/gdb/testsuite/gdb.base/annota1.exp
+++ b/gdb/testsuite/gdb.base/annota1.exp
@@ -19,9 +19,7 @@ 
 # This testcase cannot use runto_main because of the different prompt
 # we get when using annotation level 2.
 #
-if ![target_can_use_run_cmd] {
-    return 0
-}
+require target_can_use_run_cmd
 
 set breakpoints_invalid "\r\n\032\032breakpoints-invalid\r\n"
 
diff --git a/gdb/testsuite/gdb.base/annota3.exp b/gdb/testsuite/gdb.base/annota3.exp
index 4fae6f066ab..3502340060a 100644
--- a/gdb/testsuite/gdb.base/annota3.exp
+++ b/gdb/testsuite/gdb.base/annota3.exp
@@ -19,9 +19,7 @@ 
 # This testcase cannot use runto_main because of the different prompt
 # we get when using annotation level 2.
 #
-if ![target_can_use_run_cmd] {
-    return 0
-}
+require target_can_use_run_cmd
 
 
 #
diff --git a/gdb/testsuite/gdb.base/dprintf-execution-x-script.exp b/gdb/testsuite/gdb.base/dprintf-execution-x-script.exp
index a8fa858cb3a..90b9ecaee5f 100644
--- a/gdb/testsuite/gdb.base/dprintf-execution-x-script.exp
+++ b/gdb/testsuite/gdb.base/dprintf-execution-x-script.exp
@@ -20,9 +20,7 @@ 
 # part of this test.
 
 # Bail out if the target can't use the 'run' command.
-if ![target_can_use_run_cmd] {
-    return 0
-}
+require target_can_use_run_cmd
 
 standard_testfile
 
diff --git a/gdb/testsuite/gdb.cp/annota2.exp b/gdb/testsuite/gdb.cp/annota2.exp
index 96ac2e7ffbd..102bda557fc 100644
--- a/gdb/testsuite/gdb.cp/annota2.exp
+++ b/gdb/testsuite/gdb.cp/annota2.exp
@@ -32,9 +32,7 @@  if {[prepare_for_testing "failed to prepare" $testfile $srcfile \
 # This testcase cannot use runto_main because of the different prompt
 # we get when using annotation level 2.
 #
-if ![target_can_use_run_cmd] {
-    return 0
-}
+require target_can_use_run_cmd
 
 set breakpoints_invalid "\r\n\032\032breakpoints-invalid\r\n"
 set frames_invalid "\r\n\032\032frames-invalid\r\n"
diff --git a/gdb/testsuite/gdb.cp/annota3.exp b/gdb/testsuite/gdb.cp/annota3.exp
index f60bd469c7f..66e083ac7e5 100644
--- a/gdb/testsuite/gdb.cp/annota3.exp
+++ b/gdb/testsuite/gdb.cp/annota3.exp
@@ -32,9 +32,7 @@  if {[prepare_for_testing "failed to prepare" $testfile $srcfile \
 # This testcase cannot use runto_main because of the different prompt
 # we get when using annotation level 2.
 #
-if ![target_can_use_run_cmd] {
-    return 0
-}
+require target_can_use_run_cmd
 
 #
 # line number where we need to stop in main
diff --git a/gdb/testsuite/gdb.multi/bkpt-multi-exec.exp b/gdb/testsuite/gdb.multi/bkpt-multi-exec.exp
index 43700016b4e..8542fef8e34 100644
--- a/gdb/testsuite/gdb.multi/bkpt-multi-exec.exp
+++ b/gdb/testsuite/gdb.multi/bkpt-multi-exec.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 ![target_can_use_run_cmd] {
-    return
-}
+require target_can_use_run_cmd
 
 # Until "catch exec" is implemented on other targets...
 #