diff options
author | Nathan Rossi <nathan@nathanrossi.com> | 2019-09-03 16:56:41 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-09-06 12:45:47 +0100 |
commit | 6ccf0746cf91bf9e792e9dfe41389eeb286db803 (patch) | |
tree | c5be7300eadc5f9c69e3468cfd54803a6a0edc33 /meta/recipes-devtools/gcc/gcc-runtime.inc | |
parent | 9d00c56d5bb7d13485c68ebb17c9f493218860ca (diff) | |
download | poky-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.inc | 42 |
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 = "\ | |||
277 | SUMMARY_libitm-dev = "GNU transactional memory support library - development files" | 277 | SUMMARY_libitm-dev = "GNU transactional memory support library - development files" |
278 | FILES_libitm-staticdev = "${libdir}/libitm.a" | 278 | FILES_libitm-staticdev = "${libdir}/libitm.a" |
279 | SUMMARY_libitm-staticdev = "GNU transactional memory support library - static development files" | 279 | SUMMARY_libitm-staticdev = "GNU transactional memory support library - static development files" |
280 | |||
281 | require gcc-testsuite.inc | ||
282 | |||
283 | EXTRA_OEMAKE_prepend_task-check = "${PARALLEL_MAKE} " | ||
284 | |||
285 | MAKE_CHECK_TARGETS ??= "check-gcc ${@" ".join("check-target-" + i for i in d.getVar("RUNTIMETARGET").split())}" | ||
286 | # prettyprinters and xmethods require gdb tooling | ||
287 | MAKE_CHECK_IGNORE ??= "prettyprinters.exp xmethods.exp" | ||
288 | MAKE_CHECK_RUNTESTFLAGS ??= "${MAKE_CHECK_BOARDARGS} --ignore '${MAKE_CHECK_IGNORE}'" | ||
289 | |||
290 | # specific host and target dependencies required for test suite running | ||
291 | do_check[depends] += "dejagnu-native:do_populate_sysroot expect-native:do_populate_sysroot" | ||
292 | do_check[depends] += "virtual/libc:do_populate_sysroot" | ||
293 | # only depend on qemu if targeting linux user execution | ||
294 | do_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) | ||
296 | do_check[prefuncs] += "extend_recipe_sysroot" | ||
297 | do_check[prefuncs] += "check_prepare" | ||
298 | do_check[dirs] = "${WORKDIR}/dejagnu ${B}" | ||
299 | do_check[nostamp] = "1" | ||
300 | do_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 | } | ||
320 | addtask check after do_compile do_populate_sysroot | ||
321 | |||