summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/gcc/gcc-runtime.inc
diff options
context:
space:
mode:
authorNathan Rossi <nathan@nathanrossi.com>2019-09-03 16:56:41 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-09-06 12:45:47 +0100
commit6ccf0746cf91bf9e792e9dfe41389eeb286db803 (patch)
treec5be7300eadc5f9c69e3468cfd54803a6a0edc33 /meta/recipes-devtools/gcc/gcc-runtime.inc
parent9d00c56d5bb7d13485c68ebb17c9f493218860ca (diff)
downloadpoky-6ccf0746cf91bf9e792e9dfe41389eeb286db803.tar.gz
gcc-runtime: Add do_check task for executing gcc test suites
Add a do_check task to implement execution of the gcc component test suites. The component test suites require execution of compiled programs on the target. The implementation provided allows for execution testing against a host via SSH or within the local build environment using qemu linux-user execution. The selection of execution is done via the TOOLCHAIN_TEST_TARGET variable, and configuration of the remote host is done with the TOOLCHAIN_TEST_HOST, TOOLCHAIN_TEST_HOST_USER and TOOLCHAIN_TEST_HOST_PORT variables. By default the do_check task will execute all check targets, this can be changed by setting MAKE_CHECK_TARGETS to the desired test suite target (e.g. check-gcc or check-target-libatomic). (From OE-Core rev: 9d5d680baa91b34dc97641f98856a51d1bb060c1) Signed-off-by: Nathan Rossi <nathan@nathanrossi.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/gcc/gcc-runtime.inc')
-rw-r--r--meta/recipes-devtools/gcc/gcc-runtime.inc42
1 files changed, 42 insertions, 0 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-runtime.inc b/meta/recipes-devtools/gcc/gcc-runtime.inc
index 22c1d78dd1..2da3c02ef0 100644
--- a/meta/recipes-devtools/gcc/gcc-runtime.inc
+++ b/meta/recipes-devtools/gcc/gcc-runtime.inc
@@ -277,3 +277,45 @@ FILES_libitm-dev = "\
277SUMMARY_libitm-dev = "GNU transactional memory support library - development files" 277SUMMARY_libitm-dev = "GNU transactional memory support library - development files"
278FILES_libitm-staticdev = "${libdir}/libitm.a" 278FILES_libitm-staticdev = "${libdir}/libitm.a"
279SUMMARY_libitm-staticdev = "GNU transactional memory support library - static development files" 279SUMMARY_libitm-staticdev = "GNU transactional memory support library - static development files"
280
281require gcc-testsuite.inc
282
283EXTRA_OEMAKE_prepend_task-check = "${PARALLEL_MAKE} "
284
285MAKE_CHECK_TARGETS ??= "check-gcc ${@" ".join("check-target-" + i for i in d.getVar("RUNTIMETARGET").split())}"
286# prettyprinters and xmethods require gdb tooling
287MAKE_CHECK_IGNORE ??= "prettyprinters.exp xmethods.exp"
288MAKE_CHECK_RUNTESTFLAGS ??= "${MAKE_CHECK_BOARDARGS} --ignore '${MAKE_CHECK_IGNORE}'"
289
290# specific host and target dependencies required for test suite running
291do_check[depends] += "dejagnu-native:do_populate_sysroot expect-native:do_populate_sysroot"
292do_check[depends] += "virtual/libc:do_populate_sysroot"
293# only depend on qemu if targeting linux user execution
294do_check[depends] += "${@'qemu-native:do_populate_sysroot' if "user" in d.getVar('TOOLCHAIN_TEST_TARGET') else ''}"
295# extend the recipe sysroot to include the built libraries (for qemu usermode)
296do_check[prefuncs] += "extend_recipe_sysroot"
297do_check[prefuncs] += "check_prepare"
298do_check[dirs] = "${WORKDIR}/dejagnu ${B}"
299do_check[nostamp] = "1"
300do_check() {
301 export DEJAGNU="${WORKDIR}/dejagnu/site.exp"
302
303 # HACK: this works around the configure setting CXX with -nostd* args
304 sed -i 's/-nostdinc++ -nostdlib++//g' $(find ${B} -name testsuite_flags | head -1)
305 # HACK: this works around the de-stashing changes to configargs.h, as well as recipe-sysroot changing the content
306 sed -i '/static const char configuration_arguments/d' ${B}/gcc/configargs.h
307 ${CC} -v 2>&1 | grep "^Configured with:" | \
308 sed 's/Configured with: \(.*\)/static const char configuration_arguments[] = "\1";/g' >> ${B}/gcc/configargs.h
309
310 if [ "${TOOLCHAIN_TEST_TARGET}" = "user" ]; then
311 # qemu user has issues allocating large amounts of memory
312 export G_SLICE=always-malloc
313 # no test should need more that 10G of memory, this prevents tests like pthread7-rope from leaking memory
314 ulimit -m 4194304
315 ulimit -v 10485760
316 fi
317
318 oe_runmake -i ${MAKE_CHECK_TARGETS} RUNTESTFLAGS="${MAKE_CHECK_RUNTESTFLAGS}"
319}
320addtask check after do_compile do_populate_sysroot
321