summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathan Rossi <nathan@nathanrossi.com>2019-08-28 05:06:29 +0000
committerArmin Kuster <akuster808@gmail.com>2019-08-30 15:29:47 -0700
commit2df7531388d5b282411244629542ec889c5178c6 (patch)
tree0db9add0f2c226339b4e598e304cc96ff68c99ae
parentedfa71c57f63eb093e2a24bf78523d938881688b (diff)
downloadopenembedded-core-contrib-2df7531388d5b282411244629542ec889c5178c6.tar.gz
gcc-runtime: Add do_check task for executing gcc-runtime test suites
Add a do_check task to implement execution of the gcc-runtime component test suites. The component test suites require execution of compiled programs on the target, this recipe reuses the same setup as gcc-cross for setup of the target (either as ssh or qemu linux-user). Signed-off-by: Nathan Rossi <nathan@nathanrossi.com> Signed-off-by: Armin Kuster <akuster808@gmail.com>
-rw-r--r--meta/recipes-devtools/gcc/gcc-runtime.inc37
1 files changed, 37 insertions, 0 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-runtime.inc b/meta/recipes-devtools/gcc/gcc-runtime.inc
index 3d03d8e571..a25262e5e0 100644
--- a/meta/recipes-devtools/gcc/gcc-runtime.inc
+++ b/meta/recipes-devtools/gcc/gcc-runtime.inc
@@ -260,3 +260,40 @@ FILES_libitm-dev = "\
SUMMARY_libitm-dev = "GNU transactional memory support library - development files"
FILES_libitm-staticdev = "${libdir}/libitm.a"
SUMMARY_libitm-staticdev = "GNU transactional memory support library - static development files"
+
+require gcc-testsuite.inc
+
+EXTRA_OEMAKE_prepend_task-check = "${PARALLEL_MAKE} "
+
+MAKE_CHECK_TARGETS ??= "${@" ".join("check-target-" + i for i in d.getVar("RUNTIMETARGET").split())}"
+MAKE_CHECK_IGNORE ??= "prettyprinters.exp xmethods.exp"
+MAKE_CHECK_RUNTESTFLAGS ??= "${MAKE_CHECK_BOARDARGS} --ignore '${MAKE_CHECK_IGNORE}'"
+
+# specific host and target dependencies required for test suite running
+do_check[depends] += "dejagnu-native:do_populate_sysroot expect-native:do_populate_sysroot"
+do_check[depends] += "virtual/libc:do_populate_sysroot"
+# only depend on qemu if targeting linux user execution
+do_check[depends] += "${@'qemu-native:do_populate_sysroot' if "user" in d.getVar('BUILD_TEST_TARGET') else ''}"
+# extend the recipe sysroot to include the built libraries (for qemu usermode)
+do_check[prefuncs] += "extend_recipe_sysroot"
+do_check[prefuncs] += "check_prepare"
+do_check[dirs] = "${WORKDIR}/dejagnu ${B}"
+do_check[nostamp] = "1"
+do_check() {
+ export DEJAGNU="${WORKDIR}/dejagnu/site.exp"
+
+ # HACK: this works around the configure setting CXX with -nostd* args
+ sed -i 's/-nostdinc++ -nostdlib++//g' $(find ${B} -name testsuite_flags | head -1)
+
+ if [ "${BUILD_TEST_TARGET}" = "user" ]; then
+ # qemu user has issues allocating large amounts of memory
+ export G_SLICE=always-malloc
+ # no test should need more that 10G of memory, this prevents tests like pthread7-rope from leaking memory
+ ulimit -m 4194304
+ ulimit -v 10485760
+ fi
+
+ oe_runmake -i ${MAKE_CHECK_TARGETS} RUNTESTFLAGS="${MAKE_CHECK_RUNTESTFLAGS}"
+}
+addtask check after do_compile do_populate_sysroot
+