aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Burgess <aburgess@redhat.com>2022-11-14 14:28:22 +0000
committerAndrew Burgess <aburgess@redhat.com>2022-11-28 21:04:09 +0000
commit0216141ac37843192e3525dda4cc3c58810ee195 (patch)
tree6e502597866e28cb998f8a2cfa8ed3a8dcb9a806
parent49bb47443c05e573d1675adba6d8f07562db2d3f (diff)
downloadgdb-0216141ac37843192e3525dda4cc3c58810ee195.zip
gdb-0216141ac37843192e3525dda4cc3c58810ee195.tar.gz
gdb-0216141ac37843192e3525dda4cc3c58810ee195.tar.bz2
gdb/testsuite: remove use of then keyword from gdb.multi/*.exp
The canonical form of 'if' in modern TCL is 'if {} {}'. But there's still a bunch of places in the testsuite where we make use of the 'then' keyword, and sometimes these get copies into new tests, which just spreads poor practice. This commit removes all use of the 'then' keyword from the gdb.multi/ test script directory. There should be no changes in what is tested after this commit.
-rw-r--r--gdb/testsuite/gdb.multi/base.exp8
-rw-r--r--gdb/testsuite/gdb.multi/bkpt-multi-exec.exp4
-rw-r--r--gdb/testsuite/gdb.multi/dummy-frame-restore.exp4
-rw-r--r--gdb/testsuite/gdb.multi/info-threads.exp2
-rw-r--r--gdb/testsuite/gdb.multi/multi-arch-exec.exp2
-rw-r--r--gdb/testsuite/gdb.multi/multi-arch.exp4
-rw-r--r--gdb/testsuite/gdb.multi/multi-re-run.exp2
-rw-r--r--gdb/testsuite/gdb.multi/tids-gid-reset.exp8
-rw-r--r--gdb/testsuite/gdb.multi/tids.exp2
9 files changed, 18 insertions, 18 deletions
diff --git a/gdb/testsuite/gdb.multi/base.exp b/gdb/testsuite/gdb.multi/base.exp
index 7f29199..6c5042e 100644
--- a/gdb/testsuite/gdb.multi/base.exp
+++ b/gdb/testsuite/gdb.multi/base.exp
@@ -85,7 +85,7 @@ gdb_test_multiple "info inferior 2 3" "info inferior 2 3" {
exp_continue
}
-re "$gdb_prompt $" {
- if { !$see1 && $see2 && $see3 } then {
+ if {!$see1 && $see2 && $see3} {
pass "info inferior 2 3"
} else {
fail "info inferior 2 3"
@@ -111,7 +111,7 @@ gdb_test_multiple "info inferior 1-2" "info inferior 1-2" {
exp_continue
}
-re "$gdb_prompt $" {
- if { $see1 && $see2 && !$see3 } then {
+ if {$see1 && $see2 && !$see3} {
pass "info inferior 1-2"
} else {
fail "info inferior 1-2"
@@ -154,7 +154,7 @@ gdb_test "list commonfun" "from goodbye.*" "list commonfun in goodbye"
# Let's run the hello program.
gdb_test "inferior 1" ".*" "switch to inferior 1 to run it"
-if { ![runto_main] } then {
+if {![runto_main]} {
return -1
}
@@ -183,7 +183,7 @@ gdb_test_multiple "info inferiors" "check remove-inferiors" {
exp_continue
}
-re "$gdb_prompt $" {
- if { $see1 && !$see2 && !$see3 } then {
+ if {$see1 && !$see2 && !$see3} {
pass "check remove-inferiors"
} else {
fail "check remove-inferiors"
diff --git a/gdb/testsuite/gdb.multi/bkpt-multi-exec.exp b/gdb/testsuite/gdb.multi/bkpt-multi-exec.exp
index cf7101b..4370001 100644
--- a/gdb/testsuite/gdb.multi/bkpt-multi-exec.exp
+++ b/gdb/testsuite/gdb.multi/bkpt-multi-exec.exp
@@ -19,7 +19,7 @@ if ![target_can_use_run_cmd] {
# Until "catch exec" is implemented on other targets...
#
-if {![istarget "*-linux*"]} then {
+if {![istarget "*-linux*"]} {
return
}
@@ -49,7 +49,7 @@ clean_restart ${exec1}
# Start the program running, and stop at main.
#
-if ![runto_main] then {
+if {![runto_main]} {
return
}
diff --git a/gdb/testsuite/gdb.multi/dummy-frame-restore.exp b/gdb/testsuite/gdb.multi/dummy-frame-restore.exp
index 5accd7d..0cd1cf5 100644
--- a/gdb/testsuite/gdb.multi/dummy-frame-restore.exp
+++ b/gdb/testsuite/gdb.multi/dummy-frame-restore.exp
@@ -27,7 +27,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug}]} {
# Inferior 1 stops at f1.
-if ![runto f1] then {
+if {![runto f1]} {
return 0
}
@@ -40,7 +40,7 @@ delete_breakpoints
# Inferior 2 stops at f2.
-if ![runto f2] then {
+if {![runto f2]} {
return 0
}
diff --git a/gdb/testsuite/gdb.multi/info-threads.exp b/gdb/testsuite/gdb.multi/info-threads.exp
index 5a4d611..650e7c6 100644
--- a/gdb/testsuite/gdb.multi/info-threads.exp
+++ b/gdb/testsuite/gdb.multi/info-threads.exp
@@ -24,7 +24,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {pthreads d
return -1
}
-if { ![runto_main] } then {
+if {![runto_main]} {
return -1
}
diff --git a/gdb/testsuite/gdb.multi/multi-arch-exec.exp b/gdb/testsuite/gdb.multi/multi-arch-exec.exp
index 3d77960..7899c22 100644
--- a/gdb/testsuite/gdb.multi/multi-arch-exec.exp
+++ b/gdb/testsuite/gdb.multi/multi-arch-exec.exp
@@ -152,7 +152,7 @@ proc do_test { first_arch mode selected_thread } {
set from_exec "$first_arch-multi-arch-exec"
clean_restart ${from_exec}
- if ![runto all_started] then {
+ if {![runto all_started]} {
return -1
}
diff --git a/gdb/testsuite/gdb.multi/multi-arch.exp b/gdb/testsuite/gdb.multi/multi-arch.exp
index b564e6c..a15b021 100644
--- a/gdb/testsuite/gdb.multi/multi-arch.exp
+++ b/gdb/testsuite/gdb.multi/multi-arch.exp
@@ -78,7 +78,7 @@ if { [build_executable "failed to prepare" ${exec2} "${srcfile2}" \
# Start inferior 1
clean_restart ${exec1}
-if ![runto_main] then {
+if {![runto_main]} {
return
}
@@ -88,7 +88,7 @@ gdb_test "add-inferior" "Added inferior 2.*" "add empty inferior 2"
gdb_test "inferior 2" "Switching to inferior 2.*" "switch to inferior 2"
gdb_load ${binfile2}
-if ![runto_main] then {
+if {![runto_main]} {
return
}
diff --git a/gdb/testsuite/gdb.multi/multi-re-run.exp b/gdb/testsuite/gdb.multi/multi-re-run.exp
index 5af4fde..04073c9 100644
--- a/gdb/testsuite/gdb.multi/multi-re-run.exp
+++ b/gdb/testsuite/gdb.multi/multi-re-run.exp
@@ -80,7 +80,7 @@ proc test_re_run {re_run_inf} {
# Run the steady inferior to a breakpoint, and let it stay stopped
# there.
- if ![runto all_started] then {
+ if {![runto all_started]} {
return 0
}
diff --git a/gdb/testsuite/gdb.multi/tids-gid-reset.exp b/gdb/testsuite/gdb.multi/tids-gid-reset.exp
index 6cab573..27474b1 100644
--- a/gdb/testsuite/gdb.multi/tids-gid-reset.exp
+++ b/gdb/testsuite/gdb.multi/tids-gid-reset.exp
@@ -31,7 +31,7 @@ with_test_prefix "single-inferior" {
with_test_prefix "before restart" {
clean_restart ${testfile}
- if { ![runto_main] } then {
+ if {![runto_main]} {
return -1
}
@@ -40,7 +40,7 @@ with_test_prefix "single-inferior" {
with_test_prefix "restart" {
gdb_continue_to_end
- if { ![runto_main] } then {
+ if {![runto_main]} {
return -1
}
}
@@ -66,7 +66,7 @@ with_test_prefix "multi-inferior" {
gdb_test "inferior 2" "Switching to inferior 2 .*" "switch to inferior 2"
gdb_load ${binfile}
- if ![runto_main] then {
+ if {![runto_main]} {
return
}
@@ -82,7 +82,7 @@ with_test_prefix "multi-inferior" {
with_test_prefix "restart" {
gdb_continue_to_end
- if { ![runto_main] } then {
+ if {![runto_main]} {
return -1
}
}
diff --git a/gdb/testsuite/gdb.multi/tids.exp b/gdb/testsuite/gdb.multi/tids.exp
index 23668ca..44face8 100644
--- a/gdb/testsuite/gdb.multi/tids.exp
+++ b/gdb/testsuite/gdb.multi/tids.exp
@@ -31,7 +31,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {pthreads d
return -1
}
-if { ![runto_main] } then {
+if {![runto_main]} {
return -1
}