diff options
4 files changed, 41 insertions, 40 deletions
diff --git a/meta/recipes-connectivity/bluez5/bluez5.inc b/meta/recipes-connectivity/bluez5/bluez5.inc index f2d9a4f9378..61584eb028d 100644 --- a/meta/recipes-connectivity/bluez5/bluez5.inc +++ b/meta/recipes-connectivity/bluez5/bluez5.inc @@ -23,6 +23,7 @@ PACKAGECONFIG ??= "obex-profiles \ tools \ deprecated \ udev \ + ${@bb.utils.contains('PTEST_ENABLED', '1', 'unittests', '', d)} \ " PACKAGECONFIG[obex-profiles] = "--enable-obex,--disable-obex,libical" PACKAGECONFIG[readline] = "--enable-client,--disable-client,readline," @@ -46,12 +47,13 @@ PACKAGECONFIG[mesh] = "--enable-mesh --enable-external-ell,--disable-mesh, json- PACKAGECONFIG[btpclient] = "--enable-btpclient --enable-external-ell,--disable-btpclient, ell" PACKAGECONFIG[udev] = "--enable-udev,--disable-udev,udev" PACKAGECONFIG[manpages] = "--enable-manpages,--disable-manpages,python3-docutils-native" +PACKAGECONFIG[unittests] = "--enable-install-unit-tests,--disable-install-unit-tests" SRC_URI = "${KERNELORG_MIRROR}/linux/bluetooth/bluez-${PV}.tar.xz \ file://init \ file://run-ptest \ ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '', 'file://0001-Allow-using-obexd-without-systemd-in-the-user-sessio.patch', d)} \ - file://0001-tests-add-a-target-for-building-tests-without-runnin.patch \ + file://install-tests.patch \ file://0001-test-gatt-Fix-hung-issue.patch \ file://0001-audio-Rename-pause-funciton-to-avoid-shadowing-glibc.patch \ " @@ -144,13 +146,5 @@ SYSTEMD_SERVICE_${PN} = "${@bb.utils.contains('PACKAGECONFIG', 'systemd', 'bluet INITSCRIPT_PACKAGES = "${PN}" INITSCRIPT_NAME_${PN} = "bluetooth" -do_compile_ptest() { - oe_runmake buildtests -} - -do_install_ptest() { - cp -r ${B}/unit/ ${D}${PTEST_PATH} - rm -f ${D}${PTEST_PATH}/unit/*.o -} - +FILES_${PN}-ptest += "${libdir}/bluez/unit-tests" RDEPENDS_${PN}-ptest_append_libc-glibc = " glibc-gconv-utf-16" diff --git a/meta/recipes-connectivity/bluez5/bluez5/0001-tests-add-a-target-for-building-tests-without-runnin.patch b/meta/recipes-connectivity/bluez5/bluez5/0001-tests-add-a-target-for-building-tests-without-runnin.patch deleted file mode 100644 index 24ddae6b632..00000000000 --- a/meta/recipes-connectivity/bluez5/bluez5/0001-tests-add-a-target-for-building-tests-without-runnin.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 4bdf0f96dcaa945fd29f26d56e5b36d8c23e4c8b Mon Sep 17 00:00:00 2001 -From: Alexander Kanavin <alex.kanavin@gmail.com> -Date: Fri, 1 Apr 2016 17:07:34 +0300 -Subject: [PATCH] tests: add a target for building tests without running them - -Upstream-Status: Inappropriate [oe specific] -Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> ---- - Makefile.am | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/Makefile.am b/Makefile.am -index 1a48a71..ba3b92f 100644 ---- a/Makefile.am -+++ b/Makefile.am -@@ -425,6 +425,9 @@ endif - TESTS = $(unit_tests) - AM_TESTS_ENVIRONMENT = MALLOC_CHECK_=3 MALLOC_PERTURB_=69 - -+# This allows building tests without running them -+buildtests: $(TESTS) -+ - if DBUS_RUN_SESSION - AM_TESTS_ENVIRONMENT += dbus-run-session -- - endif --- -2.8.0.rc3 - diff --git a/meta/recipes-connectivity/bluez5/bluez5/install-tests.patch b/meta/recipes-connectivity/bluez5/bluez5/install-tests.patch new file mode 100644 index 00000000000..0fd40e45c7c --- /dev/null +++ b/meta/recipes-connectivity/bluez5/bluez5/install-tests.patch @@ -0,0 +1,36 @@ +Add an option to install the unit tests. + +Upstream-Status: Pending +Signed-off-by: Ross Burton <ross.burton@arm.com> + +diff --git a/Makefile.am b/Makefile.am +index f98243f72..7e5826d11 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -563,6 +563,11 @@ endif + TESTS = $(unit_tests) + AM_TESTS_ENVIRONMENT = MALLOC_CHECK_=3 MALLOC_PERTURB_=69 + ++if INSTALL_UNIT_TESTS ++unittestdir = $(pkglibdir)/unit-tests ++unittest_PROGRAMS = $(unit_tests) ++endif ++ + if DBUS_RUN_SESSION + AM_TESTS_ENVIRONMENT += dbus-run-session -- + endif +diff --git a/configure.ac b/configure.ac +index dbd98c9ad..518c49545 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -156,6 +156,10 @@ AC_ARG_ENABLE(test, AC_HELP_STRING([--enable-test], + [enable test/example scripts]), [enable_test=${enableval}]) + AM_CONDITIONAL(TEST, test "${enable_test}" = "yes") + ++AC_ARG_ENABLE(install-unit-tests, AC_HELP_STRING([--enable-install-unit-tests], ++ [install unit tests]), [enable_install_unit_tests=${enableval}]) ++AM_CONDITIONAL(INSTALL_UNIT_TESTS, test "${enable_install_unit_tests}" = "yes") ++ + AC_ARG_ENABLE(nfc, AC_HELP_STRING([--enable-nfc], + [enable NFC paring]), [enable_nfc=${enableval}]) + AM_CONDITIONAL(NFC, test "${enable_nfc}" = "yes") diff --git a/meta/recipes-connectivity/bluez5/bluez5/run-ptest b/meta/recipes-connectivity/bluez5/bluez5/run-ptest index 0335e68e489..204592c2034 100644 --- a/meta/recipes-connectivity/bluez5/bluez5/run-ptest +++ b/meta/recipes-connectivity/bluez5/bluez5/run-ptest @@ -1,6 +1,6 @@ #! /bin/sh -cd unit +cd /usr/lib/bluez/unit-tests failed=0 all=0 @@ -28,4 +28,3 @@ if [ "$failed" -eq 0 ] ; then else echo "$failed of $all tests failed" fi - |