glibc: Extract common code to build tests to glibc-tests.inc

The common code to build tests has been extracted from glibc-testsuite
recipe to glibc-tests.inc

This code will be reused in the recipe necessary for providing glibc
tests executed with ptest framework.

(From OE-Core rev: 4ee26ef672c75e73b10412e87cee23797105d9bc)

Signed-off-by: Lukasz Majewski <lukma@denx.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Lukasz Majewski
2021-09-30 12:43:56 +02:00
committed by Richard Purdie
parent 573c336353
commit 5f5660c7fa
2 changed files with 37 additions and 34 deletions

View File

@@ -0,0 +1,32 @@
EXCLUDE_FROM_WORLD = "1"
# handle PN differences
FILESEXTRAPATHS:prepend := "${THISDIR}/glibc:"
# setup depends
INHIBIT_DEFAULT_DEPS = ""
python () {
libc = d.getVar("PREFERRED_PROVIDER_virtual/libc")
libclocale = d.getVar("PREFERRED_PROVIDER_virtual/libc-locale")
if libc != "glibc" or libclocale != "glibc-locale":
raise bb.parse.SkipRecipe("glibc-testsuite requires that virtual/libc is glibc")
}
DEPENDS += "glibc-locale libgcc gcc-runtime"
# remove the initial depends
DEPENDS:remove = "libgcc-initial"
do_check[dirs] += "${B}"
do_check () {
# clean out previous test results
oe_runmake tests-clean
# makefiles don't clean entirely (and also sometimes fails due to too many args)
find ${B} -type f -name "*.out" -delete
find ${B} -type f -name "*.test-result" -delete
find ${B}/catgets -name "*.cat" -delete
find ${B}/conform -name "symlist-*" -delete
[ ! -e ${B}/timezone/testdata ] || rm -rf ${B}/timezone/testdata
}
addtask do_check after do_compile

View File

@@ -1,31 +1,13 @@
require glibc_${PV}.bb
EXCLUDE_FROM_WORLD = "1"
# handle PN differences
FILESEXTRAPATHS:prepend := "${THISDIR}/glibc:"
# strip provides
PROVIDES = ""
# setup depends
INHIBIT_DEFAULT_DEPS = ""
python () {
libc = d.getVar("PREFERRED_PROVIDER_virtual/libc")
libclocale = d.getVar("PREFERRED_PROVIDER_virtual/libc-locale")
if libc != "glibc" or libclocale != "glibc-locale":
raise bb.parse.SkipRecipe("glibc-testsuite requires that virtual/libc is glibc")
}
DEPENDS += "glibc-locale libgcc gcc-runtime"
# remove the initial depends
DEPENDS:remove = "libgcc-initial"
require glibc-tests.inc
inherit qemu
SRC_URI += "file://check-test-wrapper"
# strip provides
PROVIDES = ""
DEPENDS += "${@'qemu-native' if d.getVar('TOOLCHAIN_TEST_TARGET') == 'user' else ''}"
TOOLCHAIN_TEST_TARGET ??= "user"
@@ -33,20 +15,10 @@ TOOLCHAIN_TEST_HOST ??= "localhost"
TOOLCHAIN_TEST_HOST_USER ??= "root"
TOOLCHAIN_TEST_HOST_PORT ??= "2222"
do_check[dirs] += "${B}"
do_check[nostamp] = "1"
do_check () {
do_check:append () {
chmod 0755 ${WORKDIR}/check-test-wrapper
# clean out previous test results
oe_runmake tests-clean
# makefiles don't clean entirely (and also sometimes fails due to too many args)
find ${B} -type f -name "*.out" -delete
find ${B} -type f -name "*.test-result" -delete
find ${B}/catgets -name "*.cat" -delete
find ${B}/conform -name "symlist-*" -delete
[ ! -e ${B}/timezone/testdata ] || rm -rf ${B}/timezone/testdata
oe_runmake -i \
QEMU_SYSROOT="${RECIPE_SYSROOT}" \
QEMU_OPTIONS="${@qemu_target_binary(d)} ${QEMU_OPTIONS}" \
@@ -56,7 +28,6 @@ do_check () {
test-wrapper="${WORKDIR}/check-test-wrapper ${TOOLCHAIN_TEST_TARGET}" \
check
}
addtask do_check after do_compile
inherit nopackages
deltask do_stash_locale