From 2adf913004f491c5ed70292b8753624b455482e7 Mon Sep 17 00:00:00 2001 From: Marc Mattmueller Date: Thu, 1 Jul 2021 13:59:35 +0200 Subject: [PATCH] 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 --- classes/unittests.bbclass | 24 ------------------ recipes-testing/cpputest/cpputest_git.bb | 19 +++------------ recipes-tools/libnmapp/libnmapp_git.bb | 31 +++--------------------- recipes-tools/sys-mon/sys-mon_git.bb | 16 ++---------- 4 files changed, 10 insertions(+), 80 deletions(-) delete mode 100644 classes/unittests.bbclass diff --git a/classes/unittests.bbclass b/classes/unittests.bbclass deleted file mode 100644 index 49068c3..0000000 --- a/classes/unittests.bbclass +++ /dev/null @@ -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" diff --git a/recipes-testing/cpputest/cpputest_git.bb b/recipes-testing/cpputest/cpputest_git.bb index 47f5a4c..fc2c9c0 100644 --- a/recipes-testing/cpputest/cpputest_git.bb +++ b/recipes-testing/cpputest/cpputest_git.bb @@ -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" diff --git a/recipes-tools/libnmapp/libnmapp_git.bb b/recipes-tools/libnmapp/libnmapp_git.bb index 87c79e8..f722538 100644 --- a/recipes-tools/libnmapp/libnmapp_git.bb +++ b/recipes-tools/libnmapp/libnmapp_git.bb @@ -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" diff --git a/recipes-tools/sys-mon/sys-mon_git.bb b/recipes-tools/sys-mon/sys-mon_git.bb index 7a83306..df966a5 100644 --- a/recipes-tools/sys-mon/sys-mon_git.bb +++ b/recipes-tools/sys-mon/sys-mon_git.bb @@ -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} -}