Skip to content

Commit 0216141

Browse files
committed
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.
1 parent 49bb474 commit 0216141

File tree

9 files changed

+18
-18
lines changed

9 files changed

+18
-18
lines changed

gdb/testsuite/gdb.multi/base.exp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ gdb_test_multiple "info inferior 2 3" "info inferior 2 3" {
8585
exp_continue
8686
}
8787
-re "$gdb_prompt $" {
88-
if { !$see1 && $see2 && $see3 } then {
88+
if {!$see1 && $see2 && $see3} {
8989
pass "info inferior 2 3"
9090
} else {
9191
fail "info inferior 2 3"
@@ -111,7 +111,7 @@ gdb_test_multiple "info inferior 1-2" "info inferior 1-2" {
111111
exp_continue
112112
}
113113
-re "$gdb_prompt $" {
114-
if { $see1 && $see2 && !$see3 } then {
114+
if {$see1 && $see2 && !$see3} {
115115
pass "info inferior 1-2"
116116
} else {
117117
fail "info inferior 1-2"
@@ -154,7 +154,7 @@ gdb_test "list commonfun" "from goodbye.*" "list commonfun in goodbye"
154154
# Let's run the hello program.
155155
gdb_test "inferior 1" ".*" "switch to inferior 1 to run it"
156156

157-
if { ![runto_main] } then {
157+
if {![runto_main]} {
158158
return -1
159159
}
160160

@@ -183,7 +183,7 @@ gdb_test_multiple "info inferiors" "check remove-inferiors" {
183183
exp_continue
184184
}
185185
-re "$gdb_prompt $" {
186-
if { $see1 && !$see2 && !$see3 } then {
186+
if {$see1 && !$see2 && !$see3} {
187187
pass "check remove-inferiors"
188188
} else {
189189
fail "check remove-inferiors"

gdb/testsuite/gdb.multi/bkpt-multi-exec.exp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ if ![target_can_use_run_cmd] {
1919

2020
# Until "catch exec" is implemented on other targets...
2121
#
22-
if {![istarget "*-linux*"]} then {
22+
if {![istarget "*-linux*"]} {
2323
return
2424
}
2525

@@ -49,7 +49,7 @@ clean_restart ${exec1}
4949

5050
# Start the program running, and stop at main.
5151
#
52-
if ![runto_main] then {
52+
if {![runto_main]} {
5353
return
5454
}
5555

gdb/testsuite/gdb.multi/dummy-frame-restore.exp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug}]} {
2727

2828
# Inferior 1 stops at f1.
2929

30-
if ![runto f1] then {
30+
if {![runto f1]} {
3131
return 0
3232
}
3333

@@ -40,7 +40,7 @@ delete_breakpoints
4040

4141
# Inferior 2 stops at f2.
4242

43-
if ![runto f2] then {
43+
if {![runto f2]} {
4444
return 0
4545
}
4646

gdb/testsuite/gdb.multi/info-threads.exp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {pthreads d
2424
return -1
2525
}
2626

27-
if { ![runto_main] } then {
27+
if {![runto_main]} {
2828
return -1
2929
}
3030

gdb/testsuite/gdb.multi/multi-arch-exec.exp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ proc do_test { first_arch mode selected_thread } {
152152
set from_exec "$first_arch-multi-arch-exec"
153153

154154
clean_restart ${from_exec}
155-
if ![runto all_started] then {
155+
if {![runto all_started]} {
156156
return -1
157157
}
158158

gdb/testsuite/gdb.multi/multi-arch.exp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ if { [build_executable "failed to prepare" ${exec2} "${srcfile2}" \
7878
# Start inferior 1
7979

8080
clean_restart ${exec1}
81-
if ![runto_main] then {
81+
if {![runto_main]} {
8282
return
8383
}
8484

@@ -88,7 +88,7 @@ gdb_test "add-inferior" "Added inferior 2.*" "add empty inferior 2"
8888
gdb_test "inferior 2" "Switching to inferior 2.*" "switch to inferior 2"
8989
gdb_load ${binfile2}
9090

91-
if ![runto_main] then {
91+
if {![runto_main]} {
9292
return
9393
}
9494

gdb/testsuite/gdb.multi/multi-re-run.exp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ proc test_re_run {re_run_inf} {
8080

8181
# Run the steady inferior to a breakpoint, and let it stay stopped
8282
# there.
83-
if ![runto all_started] then {
83+
if {![runto all_started]} {
8484
return 0
8585
}
8686

gdb/testsuite/gdb.multi/tids-gid-reset.exp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ with_test_prefix "single-inferior" {
3131
with_test_prefix "before restart" {
3232
clean_restart ${testfile}
3333

34-
if { ![runto_main] } then {
34+
if {![runto_main]} {
3535
return -1
3636
}
3737

@@ -40,7 +40,7 @@ with_test_prefix "single-inferior" {
4040

4141
with_test_prefix "restart" {
4242
gdb_continue_to_end
43-
if { ![runto_main] } then {
43+
if {![runto_main]} {
4444
return -1
4545
}
4646
}
@@ -66,7 +66,7 @@ with_test_prefix "multi-inferior" {
6666
gdb_test "inferior 2" "Switching to inferior 2 .*" "switch to inferior 2"
6767
gdb_load ${binfile}
6868

69-
if ![runto_main] then {
69+
if {![runto_main]} {
7070
return
7171
}
7272

@@ -82,7 +82,7 @@ with_test_prefix "multi-inferior" {
8282

8383
with_test_prefix "restart" {
8484
gdb_continue_to_end
85-
if { ![runto_main] } then {
85+
if {![runto_main]} {
8686
return -1
8787
}
8888
}

gdb/testsuite/gdb.multi/tids.exp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {pthreads d
3131
return -1
3232
}
3333

34-
if { ![runto_main] } then {
34+
if {![runto_main]} {
3535
return -1
3636
}
3737

0 commit comments

Comments
 (0)