mirror of
https://github.com/openembedded/meta-openembedded.git
synced 2026-06-04 14:39:54 +00:00
lldpd: add ptest for lldpd package
Signed-off-by: Xiangyu Chen <xiangyu.chen@eng.windriver.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
This commit is contained in:
+16
@@ -0,0 +1,16 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
num_fail=0
|
||||||
|
|
||||||
|
for test in tests/check*
|
||||||
|
do
|
||||||
|
./"$test" \
|
||||||
|
&& echo "PASS: $test" \
|
||||||
|
|| {
|
||||||
|
echo "FAIL: $test"
|
||||||
|
num_fail=$(( ${num_fail} + 1))
|
||||||
|
}
|
||||||
|
|
||||||
|
done
|
||||||
|
|
||||||
|
exit $num_fail
|
||||||
@@ -9,11 +9,12 @@ SRC_URI = "\
|
|||||||
http://media.luffy.cx/files/${BPN}/${BPN}-${PV}.tar.gz \
|
http://media.luffy.cx/files/${BPN}/${BPN}-${PV}.tar.gz \
|
||||||
file://lldpd.init.d \
|
file://lldpd.init.d \
|
||||||
file://lldpd.default \
|
file://lldpd.default \
|
||||||
|
file://run-ptest \
|
||||||
"
|
"
|
||||||
|
|
||||||
SRC_URI[sha256sum] = "f7fe3a130be98a19c491479ef60f36b8ee41a9e6bc4d7f2c41033f63956a3126"
|
SRC_URI[sha256sum] = "f7fe3a130be98a19c491479ef60f36b8ee41a9e6bc4d7f2c41033f63956a3126"
|
||||||
|
|
||||||
inherit autotools update-rc.d useradd systemd pkgconfig bash-completion github-releases
|
inherit autotools update-rc.d useradd systemd pkgconfig bash-completion github-releases ptest
|
||||||
|
|
||||||
USERADD_PACKAGES = "${PN}"
|
USERADD_PACKAGES = "${PN}"
|
||||||
USERADD_PARAM:${PN} = "--system -g lldpd --shell /bin/false lldpd"
|
USERADD_PARAM:${PN} = "--system -g lldpd --shell /bin/false lldpd"
|
||||||
@@ -61,3 +62,20 @@ RDEPENDS:${PN} += "os-release"
|
|||||||
FILES:${PN}-zsh-completion += "${datadir}/zsh/"
|
FILES:${PN}-zsh-completion += "${datadir}/zsh/"
|
||||||
# FIXME: zsh is broken in meta-oe so this cannot be enabled for now
|
# FIXME: zsh is broken in meta-oe so this cannot be enabled for now
|
||||||
#RDEPENDS:${PN}-zsh-completion += "zsh"
|
#RDEPENDS:${PN}-zsh-completion += "zsh"
|
||||||
|
|
||||||
|
RDEPENDS:${PN}-ptest = "libcheck"
|
||||||
|
DEPENDS += "${@bb.utils.contains('PTEST_ENABLED', '1', 'libcheck', '', d)}"
|
||||||
|
|
||||||
|
TESTDIR = "tests"
|
||||||
|
do_compile_ptest () {
|
||||||
|
# hack to remove the call to `make check-TESTS`
|
||||||
|
sed -i 's/$(MAKE) $(AM_MAKEFLAGS) check-TESTS//g' ${TESTDIR}/Makefile
|
||||||
|
oe_runmake check
|
||||||
|
}
|
||||||
|
|
||||||
|
do_install_ptest () {
|
||||||
|
# install the tests
|
||||||
|
cp -rf ${B}/${TESTDIR} ${D}${PTEST_PATH}
|
||||||
|
# remove the object files
|
||||||
|
rm ${D}${PTEST_PATH}/${TESTDIR}/*.o
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user