All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pauli Virtanen <pav@iki.fi>
To: linux-bluetooth@vger.kernel.org
Cc: Pauli Virtanen <pav@iki.fi>
Subject: [PATCH BlueZ v2 6/9] shared/tester: run test with given name
Date: Thu, 14 Mar 2024 20:21:15 +0200	[thread overview]
Message-ID: <c49b98ccde558527a7ff2ade4c84b37f2c4d9b3a.1710440408.git.pav@iki.fi> (raw)
In-Reply-To: <cover.1710440408.git.pav@iki.fi>

Add option for running a single test with given name.  Useful when some
test names have a common prefix, so that neither -s or -p can
distinguish them.
---
 src/shared/tester.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/src/shared/tester.c b/src/shared/tester.c
index a1ee5b687..280f509b9 100644
--- a/src/shared/tester.c
+++ b/src/shared/tester.c
@@ -112,6 +112,7 @@ static gboolean option_monitor = FALSE;
 static gboolean option_list = FALSE;
 static const char *option_prefix = NULL;
 static const char *option_string = NULL;
+static const char *option_name = NULL;
 
 struct monitor_hdr {
 	uint16_t opcode;
@@ -285,6 +286,12 @@ void tester_add_full(const char *name, const void *test_data,
 	if (!test_func)
 		return;
 
+	if (option_name && strcmp(name, option_name)) {
+		if (destroy)
+			destroy(user_data);
+		return;
+	}
+
 	if (option_prefix && !g_str_has_prefix(name, option_prefix)) {
 		if (destroy)
 			destroy(user_data);
@@ -829,6 +836,8 @@ static GOptionEntry options[] = {
 				"Enable monitor output" },
 	{ "list", 'l', 0, G_OPTION_ARG_NONE, &option_list,
 				"Only list the tests to be run" },
+	{ "name", 'n', 0, G_OPTION_ARG_STRING, &option_name,
+				"Run test with given name" },
 	{ "prefix", 'p', 0, G_OPTION_ARG_STRING, &option_prefix,
 				"Run tests matching provided prefix" },
 	{ "string", 's', 0, G_OPTION_ARG_STRING, &option_string,
-- 
2.44.0


  parent reply	other threads:[~2024-03-14 18:21 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-14 18:21 [PATCH BlueZ v2 0/9] tests: add TX timestamping tests Pauli Virtanen
2024-03-14 18:21 ` [PATCH BlueZ v2 1/9] lib: add BT_SCM_ERROR and BT_NO_ERRQUEUE_POLL Pauli Virtanen
2024-03-14 19:20   ` tests: add TX timestamping tests bluez.test.bot
2024-03-14 18:21 ` [PATCH BlueZ v2 2/9] iso-tester: Add tests for TX timestamping Pauli Virtanen
2024-03-14 18:21 ` [PATCH BlueZ v2 3/9] l2cap-tester: Add test " Pauli Virtanen
2024-03-14 18:21 ` [PATCH BlueZ v2 4/9] btdev: set nonzero SCO mtu & max pkt Pauli Virtanen
2024-03-14 18:21 ` [PATCH BlueZ v2 5/9] sco-tester: add TX timestamping test Pauli Virtanen
2024-03-14 18:21 ` Pauli Virtanen [this message]
2024-03-14 18:21 ` [PATCH BlueZ v2 7/9] bthost: handle client L2CAP conn in LE credit based mode Pauli Virtanen
2024-03-14 18:21 ` [PATCH BlueZ v2 8/9] l2cap-tester: add tests for LE Client read/write/tx-timestamping Pauli Virtanen
2024-03-14 18:21 ` [PATCH BlueZ v2 9/9] iso-tester: add test for BT_NO_ERRQUEUE_POLL Pauli Virtanen

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=c49b98ccde558527a7ff2ade4c84b37f2c4d9b3a.1710440408.git.pav@iki.fi \
    --to=pav@iki.fi \
    --cc=linux-bluetooth@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.