]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
binutils: Add do_check task for executing binutils test suite
authorNathan Rossi <nathan@nathanrossi.com>
Wed, 28 Aug 2019 05:06:29 +0000 (05:06 +0000)
committerArmin Kuster <akuster808@gmail.com>
Fri, 30 Aug 2019 22:29:47 +0000 (15:29 -0700)
Create the do_check task to the binutils-cross include. This task can be
used to execute the binutils test suite for the cross target binutils.
By default this executes all the check targets of the binutils Makefile,
this can however be changed by setting MAKE_CHECK_TARGETS to the desired
test suite target (e.g. check-gas).

The binutils test suites do not require any target execution, as such
the check target can be run without QEMU or a target device. However
since the binutils tests do rely on a C compiler there is dependence on
both gcc and libc in order to run the tests.

Signed-off-by: Nathan Rossi <nathan@nathanrossi.com>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
meta/recipes-devtools/binutils/binutils-cross.inc

index 02ec891606d6fc971ea0a0e03ea5bff7a40e6e59..76eb453f0e216417ee836bc5b2e8cfa6f1309c40 100644 (file)
@@ -36,3 +36,31 @@ do_install () {
        rmdir ${D}${STAGING_DIR_NATIVE}${prefix_native}/${libdir}64 || :
        rmdir ${D}${STAGING_DIR_NATIVE}${prefix_native}/${prefix} || :
 }
+
+EXTRA_OEMAKE_prepend_task-check = "${PARALLEL_MAKE} "
+MAKE_CHECK_TARGETS ??= "check-binutils check-gas check-gold check-ld check-libiberty"
+
+python () {
+    # crosssdk deps have different virtual targets
+    if bb.data.inherits_class('crosssdk', d):
+        d.appendVarFlag("do_check", "depends", " virtual/${TARGET_PREFIX}gcc-crosssdk:do_populate_sysroot")
+        d.appendVarFlag("do_check", "depends", " virtual/nativesdk-${TARGET_PREFIX}compilerlibs:do_populate_sysroot")
+    else:
+        d.appendVarFlag("do_check", "depends", " virtual/${TARGET_PREFIX}gcc:do_populate_sysroot")
+        d.appendVarFlag("do_check", "depends", " virtual/${TARGET_PREFIX}compilerlibs:do_populate_sysroot")
+}
+
+do_check[depends] += "dejagnu-native:do_populate_sysroot expect-native:do_populate_sysroot"
+do_check[depends] += "virtual/libc:do_populate_sysroot"
+do_check[dirs] = "${B}"
+do_check[nostamp] = "1"
+do_check() {
+    # need to inject CC and CXX as the target CC and CXX with sysroot
+    oe_runmake -i ${MAKE_CHECK_TARGETS} \
+        RUNTESTFLAGS=" \
+            CC='${TARGET_PREFIX}gcc --sysroot=${STAGING_DIR_TARGET} ${TUNE_CCARGS}' \
+            CXX='${TARGET_PREFIX}g++ --sysroot=${STAGING_DIR_TARGET} ${TUNE_CCARGS}' \
+            "
+}
+addtask check after do_compile
+