Workaround to broken kyua handling of empty test

Also filter used subdirectories, run tests only for compiled libraries
for export-libs.
This commit is contained in:
Petr Menšík 2019-03-14 21:23:31 +01:00
parent 812f6fb336
commit 16bdca79ba
2 changed files with 61 additions and 4 deletions

View File

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

View File

@ -140,6 +140,7 @@ Patch170:bind-9.11-feature-test-named.patch
Patch171:bind-9.11-tests-variants.patch
Patch172:bind-9.11-tests-pkcs11.patch
Patch173: bind-9.11-unit-dnstap-pkcs11.patch
Patch174: bind-9.11-unit-timer-nothread.patch
# SDB patches
Patch11: bind-9.3.2b2-sdbsrc.patch
@ -520,6 +521,7 @@ are used for building ISC DHCP.
%patch171 -p1 -b .test-variant
%patch172 -p1 -b .test-pkcs11
%patch173 -p1 -b .unit-dnstap
%patch174 -p1 -b .unit-timer
mkdir lib/dns/tests/testdata/dstrandom
cp -a %{SOURCE50} lib/dns/tests/testdata/dstrandom/random.data
@ -768,9 +770,15 @@ popd
# export library unit tests
%unit_prepare_build export-libs
# Do not try pkcs11 and lwres in export libs
sed -e '/^\s*include(.*-pkcs11/ d' -e '/^\s*include(.*lwres/ d' \
-i export-libs/lib/Kyuafile
# Test just compiled libraries
for lib in %{bind_export_libs}
do
sed -e "s,^\s*include(.*${lib}/.*,-- use &," \
-i export-libs/lib/Kyuafile
done
sed -e "/^\s*include(/ d" -e 's/^-- use //' \
-i export-libs/lib/Kyuafile
## End of export libs
%endif
@ -1503,7 +1511,7 @@ fi;
%changelog
* Thu Mar 14 2019 Petr Menšík <pemensik@redhat.com> - 32:9.11.6-2
- Fix dnstap issue in unit test once again
- Fix dnstap and timer issues in unit test
* Tue Mar 05 2019 Petr Menšík <pemensik@redhat.com> - 32:9.11.6-1
- Update to 9.11.6