gdb/testsuite: use foreach_with_prefix in gdb.threads/fork-plus-threads.exp
authorSimon Marchi <simon.marchi@polymtl.ca>
Thu, 15 Apr 2021 18:45:47 +0000 (14:45 -0400)
committerSimon Marchi <simon.marchi@polymtl.ca>
Thu, 15 Apr 2021 18:45:47 +0000 (14:45 -0400)
I noticed that using foreach_with_prefix could make things a bit
less verbose.  No changes in behavior expected.

gdb/testsuite/ChangeLog:

* gdb.threads/fork-plus-threads.exp: Use foreach_with_prefix.

Change-Id: I06aa6e3d10a9cfb6ada11547aefe8c70b636ac81

gdb/testsuite/ChangeLog
gdb/testsuite/gdb.threads/fork-plus-threads.exp

index d1b6f5c650fb39d88eace7ff5ddfcedd5edb2ccc..9de1a44fd82599b6f5bb92d401e7dcbfd818dba7 100644 (file)
@@ -1,3 +1,7 @@
+2021-04-15  Simon Marchi  <simon.marchi@polymtl.ca>
+
+       * gdb.threads/fork-plus-threads.exp: Use foreach_with_prefix.
+
 2021-04-15  Tom Tromey  <tromey@adacore.com>
 
        * gdb.dwarf2/arr-stride.exp: Add test.
index 17502618cb919b10fe3be1bc8170f8d6c9f7bc16..f5cfb279ce7e97c1378531d77a4f53a15584950c 100644 (file)
@@ -29,7 +29,7 @@ if { [target_info exists gdb_protocol]
 
 standard_testfile
 
-proc do_test { detach_on_fork } {
+proc do_test { detach-on-fork } {
     global GDBFLAGS
     global srcfile testfile
     global gdb_prompt
@@ -50,7 +50,7 @@ proc do_test { detach_on_fork } {
        return 0
     }
 
-    gdb_test_no_output "set detach-on-fork $detach_on_fork"
+    gdb_test_no_output "set detach-on-fork ${detach-on-fork}"
     set test "continue &"
     gdb_test_multiple $test $test {
        -re "$gdb_prompt " {
@@ -113,8 +113,6 @@ proc do_test { detach_on_fork } {
        "only inferior 1 left"
 }
 
-foreach detach_on_fork {"on" "off"} {
-    with_test_prefix "detach-on-fork=$detach_on_fork" {
-       do_test $detach_on_fork
-    }
+foreach_with_prefix detach-on-fork {"on" "off"} {
+    do_test ${detach-on-fork}
 }