recipes: removed unittest class, cleaned recipes to build only for target

As we do not longer want yocto to build unit tests, the unittest class
is completely removed. In addition the inhertiance of unittests is
removed from libnmapp and sys-mon.

The recipes are only built for target and do not differ for native or
native-sdk

BugzID: 73551

Signed-off-by: Marc Mattmueller <marc.mattmueller@netmodule.com>
This commit is contained in:
Marc Mattmueller 2021-07-01 13:59:35 +02:00 committed by Gitea
parent 6fffac5fd4
commit 2adf913004
4 changed files with 10 additions and 80 deletions

View File

@ -1,24 +0,0 @@
DEPENDS_class-target += "${PN}-native"
DEPENDS_class-native += "cpputest"
export CPPUTEST_HOME="${base_prefix}/usr/lib/cpputest/"
export BUILD_CFLAGS +="-I${CPPUTEST_HOME}/include"
export BUILD_CPPFLAGS +="-I${CPPUTEST_HOME}/include"
export CPPUTEST_ADDITIONAL_CFLAGS=" ${BUILD_CFLAGS}"
export CPPUTEST_ADDITIONAL_CPPFLAGS=" ${BUILD_CPPFLAGS}"
export CPPUTEST_ADDITIONAL_CXXFLAGS=" ${BUILD_CXXFLAGS}"
export CPPUTEST_ADDITIONAL_LDFLAGS=" ${BUILD_LDFLAGS}"
do_compile_append_class-native() {
bbplain "building UNIT TEST ${BPN}..."
export UNITTEST_OUTPUT_XML=0
export USE_INITSYS_DUMMY=1
export BUILD_CONFIG="utest"
export BUILD_TARGET="host"
export SYSROOT=${STAGING_DIR_HOST}
export SILENCE=""
oe_runmake -f Makefile.utest.mk
}
BBCLASSEXTEND = "native nativesdk"

View File

@ -12,20 +12,9 @@ PV = "3.8+git${SRCPV}"
S = "${WORKDIR}/git"
# Moving everything to /usr/lib/cpputest, aka CPPUTEST_HOME
do_install_append() {
install -d ${D}${base_prefix}/usr/lib/cpputest/build
install -m 644 ${S}/build/MakefileWorker.mk ${D}${base_prefix}/usr/lib/cpputest/build
mv ${D}${base_prefix}/usr/include ${D}${base_prefix}/usr/lib/cpputest
install -d ${D}${base_prefix}/usr/lib/cpputest/lib
mv ${D}${base_prefix}/usr/lib/lib* ${D}${base_prefix}/usr/lib/cpputest/lib
}
FILES_${PN}-staticdev += " \
${base_prefix}/usr/lib/cpputest/build/ \
${base_prefix}/usr/lib/cpputest/build/* \
"
# Required to add the libary to the SDK.
# ${PN}-dev depends on ${PN} which is empty because
# only the static library is built
ALLOW_EMPTY_${PN} = "1"
BBCLASSEXTEND = "native nativesdk"

View File

@ -10,11 +10,7 @@ PV = "0.0.1+git${SRCPV}"
LIB_SHORT_NAME = "nmapp"
LIB_PKG_NAME = "libnmapp.a"
DEPENDS_append = " libevent"
DEPENDS_class-target += "systemd"
# performs the unit test of the library
inherit unittests
DEPENDS_append = " libevent systemd"
# Required to add the libary to the SDK.
# ${PN}-dev depends on ${PN} which is empty because
@ -24,13 +20,10 @@ ALLOW_EMPTY_${PN} = "1"
S = "${WORKDIR}/git"
B = "${S}/build"
# build variables for the host
EXTRA_OEMAKE_append_class-native = " 'BUILD_TARGET=host' 'BUILD_CONFIG=test' 'USE_INITSYS_DUMMY=1' 'SYSROOT=${STAGING_DIR_HOST}'"
# build variables for the target (rest is default)
EXTRA_OEMAKE_append_class-target = " 'BUILD_TARGET=target' 'BUILD_CONFIG=rls' 'USE_INITSYS_DUMMY=0' 'SYSROOT=${STAGING_DIR_TARGET}'"
EXTRA_OEMAKE_append = " 'BUILD_TARGET=target' 'BUILD_CONFIG=rls' 'USE_INITSYS_DUMMY=0' 'SYSROOT=${STAGING_DIR_TARGET}'"
do_install_class-target() {
do_install() {
install -d ${D}${libdir}
install -m 644 ${B}/rls/target/${LIB_PKG_NAME} ${D}${libdir}
@ -38,20 +31,4 @@ do_install_class-target() {
cp -r ${S}/include/${LIB_SHORT_NAME}/* ${D}${includedir}/${LIB_SHORT_NAME}
}
do_install_class-native() {
# Setup directories
install -d ${D}${includedir}/${LIB_SHORT_NAME}
install -d ${D}${includedir}/${LIB_SHORT_NAME}-test
install -d ${D}${includedir}/${LIB_SHORT_NAME}-test/mocks
install -d ${D}${includedir}/${LIB_SHORT_NAME}-test/utils
install -d ${D}${libdir}
# Install headers
cp -r ${S}/include/${LIB_SHORT_NAME}/* ${D}${includedir}/${LIB_SHORT_NAME}
cp -r ${S}/src/* ${D}${includedir}/${LIB_SHORT_NAME}-test
cp -r ${S}/tests/mocks/* ${D}${includedir}/${LIB_SHORT_NAME}-test/mocks
cp -r ${S}/tests/utils/* ${D}${includedir}/${LIB_SHORT_NAME}-test/utils
# Install rls and test library
install -m 644 ${B}/test/host/*.a ${D}${libdir}
}
BBCLASSEXTEND = "native nativesdk"

View File

@ -17,10 +17,6 @@ DEPENDS_append = " libnmapp"
inherit systemd
# performs the unit test of the app
inherit unittests
S = "${WORKDIR}/git/apps/sys-mon"
B = "${S}/build"
@ -32,13 +28,10 @@ FILES_${PN} += " \
${sysconfdir}/default/sys-mon.conf \
"
# build variables for the host
EXTRA_OEMAKE_append_class-native = " 'BUILD_TARGET=host' 'BUILD_CONFIG=dbg' 'SYSROOT=${STAGING_DIR_HOST}'"
# build variables for the target (rest is default)
EXTRA_OEMAKE_append_class-target = " 'BUILD_TARGET=target' 'BUILD_CONFIG=rls' 'SYSROOT=${STAGING_DIR_TARGET}'"
EXTRA_OEMAKE_append = " 'BUILD_TARGET=target' 'BUILD_CONFIG=rls' 'SYSROOT=${STAGING_DIR_TARGET}'"
do_install_class-target() {
do_install() {
bbplain "Installing ${BPN} to ${bindir}..."
install -d ${D}${bindir}
install -m 555 ${B}/rls/target/${BPN} ${D}${bindir}
@ -49,8 +42,3 @@ do_install_class-target() {
install -m 644 ${WORKDIR}/${BPN}.service ${D}${systemd_system_unitdir}
}
do_install_class-native() {
bbplain "Installing ${BPN} to ${bindir}..."
install -d ${D}${bindir}
install -m 555 ${B}/dbg/host/${BPN} ${D}${bindir}
}