summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/recipes-connectivity/bluez5/bluez5.inc13
-rw-r--r--meta/recipes-connectivity/bluez5/bluez5/0001-tests-add-a-target-for-building-tests-without-runnin.patch28
-rw-r--r--meta/recipes-connectivity/bluez5/bluez5/run-ptest31
3 files changed, 71 insertions, 1 deletions
diff --git a/meta/recipes-connectivity/bluez5/bluez5.inc b/meta/recipes-connectivity/bluez5/bluez5.inc
index f38eaa5035..523252373a 100644
--- a/meta/recipes-connectivity/bluez5/bluez5.inc
+++ b/meta/recipes-connectivity/bluez5/bluez5.inc
@@ -19,11 +19,13 @@ PACKAGECONFIG[experimental] = "--enable-experimental,--disable-experimental,"
19SRC_URI = "\ 19SRC_URI = "\
20 ${KERNELORG_MIRROR}/linux/bluetooth/bluez-${PV}.tar.xz \ 20 ${KERNELORG_MIRROR}/linux/bluetooth/bluez-${PV}.tar.xz \
21 file://init \ 21 file://init \
22 file://run-ptest \
22 ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '', 'file://0001-Allow-using-obexd-without-systemd-in-the-user-sessio.patch', d)} \ 23 ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '', 'file://0001-Allow-using-obexd-without-systemd-in-the-user-sessio.patch', d)} \
24 file://0001-tests-add-a-target-for-building-tests-without-runnin.patch \
23" 25"
24S = "${WORKDIR}/bluez-${PV}" 26S = "${WORKDIR}/bluez-${PV}"
25 27
26inherit autotools-brokensep pkgconfig systemd update-rc.d distro_features_check 28inherit autotools-brokensep pkgconfig systemd update-rc.d distro_features_check ptest
27 29
28EXTRA_OECONF = "\ 30EXTRA_OECONF = "\
29 --enable-tools \ 31 --enable-tools \
@@ -101,3 +103,12 @@ INITSCRIPT_PACKAGES = "${PN}"
101INITSCRIPT_NAME_${PN} = "bluetooth" 103INITSCRIPT_NAME_${PN} = "bluetooth"
102 104
103EXCLUDE_FROM_WORLD = "1" 105EXCLUDE_FROM_WORLD = "1"
106
107do_compile_ptest() {
108 oe_runmake buildtests
109}
110
111do_install_ptest() {
112 cp -r ${B}/unit/ ${D}${PTEST_PATH}
113 rm ${D}${PTEST_PATH}/unit/*.c ${D}${PTEST_PATH}/unit/*.o
114}
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
new file mode 100644
index 0000000000..24ddae6b63
--- /dev/null
+++ b/meta/recipes-connectivity/bluez5/bluez5/0001-tests-add-a-target-for-building-tests-without-runnin.patch
@@ -0,0 +1,28 @@
1From 4bdf0f96dcaa945fd29f26d56e5b36d8c23e4c8b Mon Sep 17 00:00:00 2001
2From: Alexander Kanavin <alex.kanavin@gmail.com>
3Date: Fri, 1 Apr 2016 17:07:34 +0300
4Subject: [PATCH] tests: add a target for building tests without running them
5
6Upstream-Status: Inappropriate [oe specific]
7Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
8---
9 Makefile.am | 3 +++
10 1 file changed, 3 insertions(+)
11
12diff --git a/Makefile.am b/Makefile.am
13index 1a48a71..ba3b92f 100644
14--- a/Makefile.am
15+++ b/Makefile.am
16@@ -425,6 +425,9 @@ endif
17 TESTS = $(unit_tests)
18 AM_TESTS_ENVIRONMENT = MALLOC_CHECK_=3 MALLOC_PERTURB_=69
19
20+# This allows building tests without running them
21+buildtests: $(TESTS)
22+
23 if DBUS_RUN_SESSION
24 AM_TESTS_ENVIRONMENT += dbus-run-session --
25 endif
26--
272.8.0.rc3
28
diff --git a/meta/recipes-connectivity/bluez5/bluez5/run-ptest b/meta/recipes-connectivity/bluez5/bluez5/run-ptest
new file mode 100644
index 0000000000..21df00c327
--- /dev/null
+++ b/meta/recipes-connectivity/bluez5/bluez5/run-ptest
@@ -0,0 +1,31 @@
1#! /bin/sh
2
3cd unit
4
5failed=0
6all=0
7
8for f in test-*; do
9 "./$f"
10 case "$?" in
11 0)
12 echo "PASS: $f"
13 all=$((all + 1))
14 ;;
15 77)
16 echo "SKIP: $f"
17 ;;
18 *)
19 echo "FAIL: $f"
20 failed=$((failed + 1))
21 all=$((all + 1))
22 ;;
23 esac
24done
25
26if [ "$failed" -eq 0 ] ; then
27 echo "All $all tests passed"
28else
29 echo "$failed of $all tests failed"
30fi
31