@@ -7,6 +7,7 @@ PTESTS_FAST = "\
acl \
apr-util \
attr \
+ avahi \
babeltrace2 \
bc \
bluez5 \
@@ -24,6 +24,7 @@ SRC_URI = "git://github.com/avahi/avahi;protocol=https;branch=master;tag=v0.9-rc
file://avahi-daemon.in \
file://avahi-dnsconfd.in \
file://0001-Fix-opening-etc-resolv.conf-error.patch \
+ file://run-ptest \
"
PV = "0.9~rc5"
@@ -47,7 +48,7 @@ PACKAGECONFIG[libevent] = "--enable-libevent,--disable-libevent,libevent"
PACKAGECONFIG[systemd] = "--enable-libsystemd,--disable-libsystemd --without-systemdsystemunitdir,systemd"
PACKAGECONFIG[qt5] = "--enable-qt5,--disable-qt5,qtbase"
-inherit autotools pkgconfig gettext gobject-introspection github-releases
+inherit autotools pkgconfig gettext gobject-introspection github-releases ptest
EXTRA_OECONF = " \
--runstatedir=${runtimedir} \
@@ -62,6 +63,7 @@ EXTRA_OECONF = " \
--disable-python \
--disable-doxygen-doc \
--disable-manpages \
+ --enable-tests \
${EXTRA_OECONF_SYSVINIT} \
"
@@ -79,6 +81,33 @@ do_compile:prepend() {
RRECOMMENDS:${PN}:append:libc-glibc = " avahi-libnss-mdns"
+AVAHI_PTESTS = " \
+ avahi-common/strlst-test \
+ avahi-common/domain-test \
+ avahi-common/alternative-test \
+ avahi-common/timeval-test \
+ avahi-common/utf8-test \
+ avahi-core/dns-spin-test \
+ avahi-core/dns-test \
+ avahi-core/hashmap-test \
+"
+
+do_install_ptest() {
+ install -d ${D}${PTEST_PATH}/tests
+ for t in ${AVAHI_PTESTS}; do
+ d=$(dirname $t)
+ n=$(basename $t)
+ if [ -x ${B}/$d/.libs/$n ]; then
+ install -m 0755 ${B}/$d/.libs/$n ${D}${PTEST_PATH}/tests/$n
+ else
+ install -m 0755 ${B}/$t ${D}${PTEST_PATH}/tests/$n
+ fi
+ done
+}
+
+RDEPENDS:${PN}-ptest += "libavahi-common libavahi-core"
+RDEPENDS:${PN}-ptest:remove = "${PN}"
+
do_install() {
autotools_do_install
new file mode 100644
@@ -0,0 +1,12 @@
+#!/bin/sh
+# SPDX-License-Identifier: MIT
+
+cd "$(dirname "$0")/tests" || exit 1
+
+for t in *; do
+ if ./"$t" >/dev/null 2>&1; then
+ echo "PASS: $t"
+ else
+ echo "FAIL: $t"
+ fi
+done
Build avahi's upstream automake unit tests (via --enable-tests) and run the deterministic, non-interactive ones under ptest: the avahi-common (strlst, domain, alternative, timeval, utf8) and avahi-core (dns-spin, dns, hashmap) tests. Tested on qemux86-64 with ptest-runner: 8 tests, all pass. Signed-off-by: Pratik Farkase <pratik.farkase@est.tech> --- .../distro/include/ptest-packagelists.inc | 1 + meta/recipes-connectivity/avahi/avahi_0.9.bb | 31 ++++++++++++++++++- .../avahi/files/run-ptest | 12 +++++++ 3 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 meta/recipes-connectivity/avahi/files/run-ptest