Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Simon Marchi <simon.marchi@polymtl.ca>
To: gdb-patches@sourceware.org
Cc: Pedro Alves <palves@redhat.com>,	Simon Marchi <simon.marchi@polymtl.ca>
Subject: [PATCH] Make gdb.mi/user-selected-context-sync.exp use proc_with_prefix
Date: Wed, 09 Nov 2016 03:10:00 -0000	[thread overview]
Message-ID: <20161109031043.7132-1-simon.marchi@polymtl.ca> (raw)
In-Reply-To: <1478650771-24430-2-git-send-email-palves@redhat.com>

Pedro's patch provides a cleaner way to prefix tests with the proc name,
so let's use that.

gdb/testsuite/ChangeLog:

	* gdb.mi/user-selected-context-sync.exp (with_test_prefix_procname):
	Remove.
	(test_setup); Define with proc_with_prefix.
	(test_cli_inferior): Likewise.
	(test_cli_thread): Likewise.
	(test_cli_frame): Likewise.
	(test_cli_select_frame): Likewise.
	(test_cli_up_down): Likewise.
	(test_mi_thread_select): Likewise.
	(test_mi_stack_select_frame): Likewise.
	(test_cli_in_mi_inferior): Likewise.
	(test_cli_in_mi_thread): Likewise.
	(test_cli_in_mi_frame): Likewise.
	(top level): Do not use with_test_prefix_procname.
---
 .../gdb.mi/user-selected-context-sync.exp          | 55 +++++++++-------------
 1 file changed, 22 insertions(+), 33 deletions(-)

diff --git a/gdb/testsuite/gdb.mi/user-selected-context-sync.exp b/gdb/testsuite/gdb.mi/user-selected-context-sync.exp
index 382763c..d3f75d8 100644
--- a/gdb/testsuite/gdb.mi/user-selected-context-sync.exp
+++ b/gdb/testsuite/gdb.mi/user-selected-context-sync.exp
@@ -50,17 +50,6 @@ set main_break_line [gdb_get_line_number "main break line"]
 set thread_loop_line [gdb_get_line_number "thread loop line"]
 set thread_caller_line [gdb_get_line_number "thread caller line"]
 
-# Call PROCNAME with the given arguments, inside a with_test_prefix $procname
-# block.
-
-proc with_test_prefix_procname { procname args } {
-    with_test_prefix $procname {
-	# Note: this syntax requires TCL 8.5, if we need to support 8.4,
-	# we'll need to find an alternative.
-	$procname {*}$args
-    }
-}
-
 # Return whether we expect thread THREAD to be running in mode MODE.
 #
 # MODE can be either "all-stop" or "non-stop".
@@ -377,7 +366,7 @@ proc test_continue_to_start { mode inf } {
 #
 # MODE can be either "all-stop" or "non-stop".
 
-proc test_setup { mode } {
+proc_with_prefix test_setup { mode } {
     global srcfile
     global srcdir
     global subdir
@@ -535,7 +524,7 @@ proc match_re_or_ensure_not_output { re test } {
 
 # Test selecting an inferior from CLI.
 
-proc test_cli_inferior { mode } {
+proc_with_prefix test_cli_inferior { mode } {
     global gdb_main_spawn_id mi_spawn_id
 
     reset_selection "1.1"
@@ -567,7 +556,7 @@ proc test_cli_inferior { mode } {
 
 # Test thread selection from CLI.
 
-proc test_cli_thread { mode } {
+proc_with_prefix test_cli_thread { mode } {
     global gdb_main_spawn_id
     global mi_spawn_id
 
@@ -671,7 +660,7 @@ proc test_cli_thread { mode } {
 
 # Test frame selection from CLI.
 
-proc test_cli_frame { mode } {
+proc_with_prefix test_cli_frame { mode } {
     global gdb_main_spawn_id mi_spawn_id
 
     with_test_prefix "thread 1.2" {
@@ -756,7 +745,7 @@ proc test_cli_frame { mode } {
 
 # Test frame selection from CLI with the select-frame command.
 
-proc test_cli_select_frame { mode } {
+proc_with_prefix test_cli_select_frame { mode } {
     global gdb_main_spawn_id mi_spawn_id expect_out
 
     with_test_prefix "thread 1.2" {
@@ -818,7 +807,7 @@ proc test_cli_select_frame { mode } {
 
 # Test doing an up and then down command from CLI.
 
-proc test_cli_up_down { mode } {
+proc_with_prefix test_cli_up_down { mode } {
     global gdb_main_spawn_id mi_spawn_id
 
     reset_selection "1.2"
@@ -853,7 +842,7 @@ proc test_cli_up_down { mode } {
 
 # Test selecting a thread from MI.
 
-proc test_mi_thread_select { mode } {
+proc_with_prefix test_mi_thread_select { mode } {
     global gdb_main_spawn_id mi_spawn_id
 
     reset_selection "1.1"
@@ -948,7 +937,7 @@ proc test_mi_thread_select { mode } {
     # place to test it.
 }
 
-proc test_mi_stack_select_frame { mode } {
+proc_with_prefix test_mi_stack_select_frame { mode } {
     global gdb_main_spawn_id mi_spawn_id
 
     with_test_prefix "thread 1.2" {
@@ -1019,7 +1008,7 @@ proc make_cli_in_mi_command { cli_in_mi_mode command } {
 
 # Test selecting the inferior using a CLI command in the MI channel.
 
-proc test_cli_in_mi_inferior { mode cli_in_mi_mode } {
+proc_with_prefix test_cli_in_mi_inferior { mode cli_in_mi_mode } {
     global gdb_main_spawn_id mi_spawn_id
 
     reset_selection "1.1"
@@ -1051,7 +1040,7 @@ proc test_cli_in_mi_inferior { mode cli_in_mi_mode } {
 
 # Test selecting the thread using a CLI command in the MI channel.
 
-proc test_cli_in_mi_thread { mode cli_in_mi_mode } {
+proc_with_prefix test_cli_in_mi_thread { mode cli_in_mi_mode } {
     global gdb_main_spawn_id mi_spawn_id
 
     reset_selection "1.1"
@@ -1164,7 +1153,7 @@ proc test_cli_in_mi_thread { mode cli_in_mi_mode } {
 
 # Test selecting the frame using a CLI command in the MI channel.
 
-proc test_cli_in_mi_frame { mode cli_in_mi_mode } {
+proc_with_prefix test_cli_in_mi_frame { mode cli_in_mi_mode } {
     global gdb_main_spawn_id mi_spawn_id
 
     with_test_prefix "thread 1.2" {
@@ -1258,28 +1247,28 @@ proc test_cli_in_mi_frame { mode cli_in_mi_mode } {
 }
 
 foreach_with_prefix mode { "all-stop" "non-stop" } {
-    with_test_prefix_procname test_setup $mode
+    test_setup $mode
 
     # Test selecting inferior, thread and frame from CLI
 
-    with_test_prefix_procname test_cli_inferior $mode
-    with_test_prefix_procname test_cli_thread $mode
-    with_test_prefix_procname test_cli_frame $mode
-    with_test_prefix_procname test_cli_select_frame $mode
-    with_test_prefix_procname test_cli_up_down $mode
+    test_cli_inferior $mode
+    test_cli_thread $mode
+    test_cli_frame $mode
+    test_cli_select_frame $mode
+    test_cli_up_down $mode
 
     # Test selecting thread and frame from MI
 
-    with_test_prefix_procname test_mi_thread_select $mode
-    with_test_prefix_procname test_mi_stack_select_frame $mode
+    test_mi_thread_select $mode
+    test_mi_stack_select_frame $mode
 
     # Test some CLI commands sent through MI, both with a "direct" command,
     # such as "thread 1", and with -interpreter-exec, such as
     # '-interpreter-exec console "thread 1"'.
 
     foreach_with_prefix exec_mode {"direct" "interpreter-exec"} {
-	with_test_prefix_procname test_cli_in_mi_inferior $mode $exec_mode
-	with_test_prefix_procname test_cli_in_mi_thread $mode $exec_mode
-	with_test_prefix_procname test_cli_in_mi_frame $mode $exec_mode
+	test_cli_in_mi_inferior $mode $exec_mode
+	test_cli_in_mi_thread $mode $exec_mode
+	test_cli_in_mi_frame $mode $exec_mode
     }
 }
-- 
2.10.0


  parent reply	other threads:[~2016-11-09  3:10 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-09  0:19 [PATCH v2 0/5] Support an "unlimited" number of user-defined arguments Pedro Alves
2016-11-09  0:19 ` [PATCH v2 3/5] Fix PR 20559 - "eval" command and $arg0...$arg9/$argc substitution Pedro Alves
2016-11-09  0:19 ` [PATCH v2 2/5] Further cleanup/modernization of gdb.base/commands.exp Pedro Alves
2016-11-09  3:02   ` Simon Marchi
2016-11-09 15:56     ` Pedro Alves
2016-11-09 15:59       ` Pedro Alves
2016-11-09 16:09         ` Simon Marchi
2016-11-09 16:16           ` Pedro Alves
2016-11-09 16:25             ` Simon Marchi
2016-11-09 18:51               ` Pedro Alves
2016-11-09 16:22           ` Pedro Alves
2016-11-09 16:37             ` Pedro Alves
2016-11-09 16:41               ` Pedro Alves
2016-11-09  0:19 ` [PATCH v2 1/5] gdb/testsuite: Introduce "proc_with_prefix" Pedro Alves
2016-11-09  1:56   ` Simon Marchi
2016-11-09  3:10   ` Simon Marchi [this message]
2016-11-09 15:15     ` [PATCH] Make gdb.mi/user-selected-context-sync.exp use proc_with_prefix Pedro Alves
2016-11-09 15:57       ` Simon Marchi
2016-11-09 11:50   ` [PATCH v2 1/5] gdb/testsuite: Introduce "proc_with_prefix" Yao Qi
2016-11-09  0:25 ` [PATCH v2 5/5] Support an "unlimited" number of user-defined arguments Pedro Alves
2016-11-09  0:26 ` [PATCH v2 4/5] Test user-defined gdb commands and arguments stack Pedro Alves

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161109031043.7132-1-simon.marchi@polymtl.ca \
    --to=simon.marchi@polymtl.ca \
    --cc=gdb-patches@sourceware.org \
    --cc=palves@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox