public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH BlueZ 1/3] shared/tester: add ability to skip tests unless explicitly selected
@ 2024-05-14 20:41 Pauli Virtanen
  2024-05-14 20:41 ` [PATCH BlueZ 2/3] tools: disable running TX timestamping tests for now Pauli Virtanen
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Pauli Virtanen @ 2024-05-14 20:41 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Pauli Virtanen

Make it possible to skip running a test, and skip running if the test
was not explicitly selected on command line.
---

Notes:
    This series disables the TX timestamping related tests by default for
    now. The TX timestamping itself should be OK, and the assumption is we'd
    re-enable these tests again once the kernel feature is reworked.
    
    I left the BT_POLL_ERRQUEUE parts in aside from the tests for now, not
    yet clear where if that is going to go further yet.

 src/shared/tester.c | 32 ++++++++++++++++++++++++++++++++
 src/shared/tester.h |  2 ++
 2 files changed, 34 insertions(+)

diff --git a/src/shared/tester.c b/src/shared/tester.c
index a1ee5b687..56c8cba6f 100644
--- a/src/shared/tester.c
+++ b/src/shared/tester.c
@@ -563,6 +563,38 @@ void tester_pre_setup_failed(void)
 	g_idle_add(done_callback, test);
 }
 
+void tester_pre_setup_abort(void)
+{
+	struct test_case *test;
+
+	if (!test_current)
+		return;
+
+	test = test_current->data;
+
+	if (test->stage != TEST_STAGE_PRE_SETUP)
+		return;
+
+	if (test->timeout_id > 0) {
+		timeout_remove(test->timeout_id);
+		test->timeout_id = 0;
+	}
+
+	print_progress(test->name, COLOR_YELLOW, "not run");
+
+	g_idle_add(done_callback, test);
+}
+
+bool tester_pre_setup_skip_by_default(void)
+{
+	if (!option_prefix && !option_string) {
+		tester_pre_setup_abort();
+		return true;
+	}
+
+	return false;
+}
+
 void tester_setup_complete(void)
 {
 	struct test_case *test;
diff --git a/src/shared/tester.h b/src/shared/tester.h
index 16f41022d..1f8138434 100644
--- a/src/shared/tester.h
+++ b/src/shared/tester.h
@@ -59,6 +59,8 @@ void *tester_get_data(void);
 
 void tester_pre_setup_complete(void);
 void tester_pre_setup_failed(void);
+void tester_pre_setup_abort(void);
+bool tester_pre_setup_skip_by_default(void);
 
 void tester_setup_complete(void);
 void tester_setup_failed(void);
-- 
2.45.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-05-15 17:40 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-14 20:41 [PATCH BlueZ 1/3] shared/tester: add ability to skip tests unless explicitly selected Pauli Virtanen
2024-05-14 20:41 ` [PATCH BlueZ 2/3] tools: disable running TX timestamping tests for now Pauli Virtanen
2024-05-14 20:41 ` [PATCH BlueZ 3/3] Revert "mgmt-tester: update for Poll Errqueue experimental fature" Pauli Virtanen
2024-05-14 23:29 ` [BlueZ,1/3] shared/tester: add ability to skip tests unless explicitly selected bluez.test.bot
2024-05-15 17:40 ` [PATCH BlueZ 1/3] " patchwork-bot+bluetooth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox