16bdca
From c88ba11ced1311e91a73ffdf42114ed14a805725 Mon Sep 17 00:00:00 2001
16bdca
From: Petr Mensik <pemensik@redhat.com>
16bdca
Date: Thu, 14 Mar 2019 21:05:34 +0100
16bdca
Subject: [PATCH] Workaround to kyua bug
16bdca
16bdca
Kyua 0.13 is not able to correctly handle whole test skipping.
16bdca
Make workaround to it, include skipping message.
16bdca
---
16bdca
 lib/isc/tests/timer_test.c | 11 +++++++++--
16bdca
 1 file changed, 9 insertions(+), 2 deletions(-)
16bdca
16bdca
diff --git a/lib/isc/tests/timer_test.c b/lib/isc/tests/timer_test.c
16bdca
index f69f2b3..050cf6d 100644
16bdca
--- a/lib/isc/tests/timer_test.c
16bdca
+++ b/lib/isc/tests/timer_test.c
16bdca
@@ -573,14 +573,13 @@ purge(void **state) {
16bdca
 
16bdca
 int
16bdca
 main(int argc, char **argv) {
16bdca
-	const struct CMUnitTest tests[] = {
16bdca
 #ifdef ISC_PLATFORM_USETHREADS
16bdca
+	const struct CMUnitTest tests[] = {
16bdca
 		cmocka_unit_test_setup_teardown(ticker, _setup, _teardown),
16bdca
 		cmocka_unit_test_setup_teardown(once_life, _setup, _teardown),
16bdca
 		cmocka_unit_test_setup_teardown(once_idle, _setup, _teardown),
16bdca
 		cmocka_unit_test_setup_teardown(reset, _setup, _teardown),
16bdca
 		cmocka_unit_test_setup_teardown(purge, _setup, _teardown),
16bdca
-#endif
16bdca
 	};
16bdca
 	int c;
16bdca
 
16bdca
@@ -595,6 +594,14 @@ main(int argc, char **argv) {
16bdca
 	}
16bdca
 
16bdca
 	return (cmocka_run_group_tests(tests, NULL, NULL));
16bdca
+#else
16bdca
+	UNUSED(argc);
16bdca
+	UNUSED(argv);
16bdca
+	UNUSED(verbose);
16bdca
+
16bdca
+	printf("1..0 # Skipped: threads disabled\n");
16bdca
+	return (0);
16bdca
+#endif
16bdca
 }
16bdca
 
16bdca
 #else /* HAVE_CMOCKA */
16bdca
-- 
16bdca
2.20.1
16bdca