Diff between ea242fbf860284c13cf17f46c9731b148da4a6ac and a9f80a8195b737beebfe1daba50f77ae0db9ab42

Changed Files

File Additions Deletions Status
src/shared/tester.c +32 -0 modified
src/shared/tester.h +2 -0 modified

Full Patch

diff --git a/src/shared/tester.c b/src/shared/tester.c
index a1ee5b6..56c8cba 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 16f4102..1f81384 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);