[PATCH v2 05/10] shared/tester: Add option to filter by string

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Luiz Augusto von Dentz <luiz.von.dentz@xxxxxxxxx>

This adds option to filter by string which does not require to enter
the entire prefix.
---
 src/shared/tester.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/src/shared/tester.c b/src/shared/tester.c
index bd42c8bad..0c31e8b1c 100644
--- a/src/shared/tester.c
+++ b/src/shared/tester.c
@@ -106,6 +106,7 @@ static gboolean option_debug = FALSE;
 static gboolean option_monitor = FALSE;
 static gboolean option_list = FALSE;
 static const char *option_prefix = NULL;
+static const char *option_string = NULL;
 
 struct monitor_hdr {
 	uint16_t opcode;
@@ -285,6 +286,12 @@ void tester_add_full(const char *name, const void *test_data,
 		return;
 	}
 
+	if (option_string && !strstr(name, option_string)) {
+		if (destroy)
+			destroy(user_data);
+		return;
+	}
+
 	if (option_list) {
 		tester_log("%s", name);
 		if (destroy)
@@ -804,6 +811,8 @@ static GOptionEntry options[] = {
 				"Only list the tests to be run" },
 	{ "prefix", 'p', 0, G_OPTION_ARG_STRING, &option_prefix,
 				"Run tests matching provided prefix" },
+	{ "string", 's', 0, G_OPTION_ARG_STRING, &option_string,
+				"Run tests matching provided string" },
 	{ NULL },
 };
 
-- 
2.26.2




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux