[PATCH BlueZ 1/3] shared/tester: add ability to skip tests unless explicitly selected

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

 



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





[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