diff options
| author | Lukasz Majewski <lukma@denx.de> | 2021-09-30 12:43:56 +0200 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-10-18 13:48:17 +0100 |
| commit | 5f5660c7fa050d9c0d9591094b5a5b077c22d346 (patch) | |
| tree | a54ebed4fd9682e90f6128ee7ca2f17640a1d90f /meta | |
| parent | 573c3363536048aea467901a5e6abde96f3c1b7b (diff) | |
| download | poky-5f5660c7fa050d9c0d9591094b5a5b077c22d346.tar.gz | |
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>
Diffstat (limited to 'meta')
| -rw-r--r-- | meta/recipes-core/glibc/glibc-tests.inc | 32 | ||||
| -rw-r--r-- | meta/recipes-core/glibc/glibc-testsuite_2.34.bb | 37 |
2 files changed, 36 insertions, 33 deletions
diff --git a/meta/recipes-core/glibc/glibc-tests.inc b/meta/recipes-core/glibc/glibc-tests.inc new file mode 100644 index 0000000000..a8fe160a54 --- /dev/null +++ b/meta/recipes-core/glibc/glibc-tests.inc | |||
| @@ -0,0 +1,32 @@ | |||
| 1 | EXCLUDE_FROM_WORLD = "1" | ||
| 2 | |||
| 3 | # handle PN differences | ||
| 4 | FILESEXTRAPATHS:prepend := "${THISDIR}/glibc:" | ||
| 5 | |||
| 6 | # setup depends | ||
| 7 | INHIBIT_DEFAULT_DEPS = "" | ||
| 8 | |||
| 9 | python () { | ||
| 10 | libc = d.getVar("PREFERRED_PROVIDER_virtual/libc") | ||
| 11 | libclocale = d.getVar("PREFERRED_PROVIDER_virtual/libc-locale") | ||
| 12 | if libc != "glibc" or libclocale != "glibc-locale": | ||
| 13 | raise bb.parse.SkipRecipe("glibc-testsuite requires that virtual/libc is glibc") | ||
| 14 | } | ||
| 15 | |||
| 16 | DEPENDS += "glibc-locale libgcc gcc-runtime" | ||
| 17 | |||
| 18 | # remove the initial depends | ||
| 19 | DEPENDS:remove = "libgcc-initial" | ||
| 20 | |||
| 21 | do_check[dirs] += "${B}" | ||
| 22 | do_check () { | ||
| 23 | # clean out previous test results | ||
| 24 | oe_runmake tests-clean | ||
| 25 | # makefiles don't clean entirely (and also sometimes fails due to too many args) | ||
| 26 | find ${B} -type f -name "*.out" -delete | ||
| 27 | find ${B} -type f -name "*.test-result" -delete | ||
| 28 | find ${B}/catgets -name "*.cat" -delete | ||
| 29 | find ${B}/conform -name "symlist-*" -delete | ||
| 30 | [ ! -e ${B}/timezone/testdata ] || rm -rf ${B}/timezone/testdata | ||
| 31 | } | ||
| 32 | addtask do_check after do_compile | ||
diff --git a/meta/recipes-core/glibc/glibc-testsuite_2.34.bb b/meta/recipes-core/glibc/glibc-testsuite_2.34.bb index 72aa332171..e8ad2a938b 100644 --- a/meta/recipes-core/glibc/glibc-testsuite_2.34.bb +++ b/meta/recipes-core/glibc/glibc-testsuite_2.34.bb | |||
| @@ -1,30 +1,12 @@ | |||
| 1 | require glibc_${PV}.bb | 1 | require glibc_${PV}.bb |
| 2 | require glibc-tests.inc | ||
| 2 | 3 | ||
| 3 | EXCLUDE_FROM_WORLD = "1" | 4 | inherit qemu |
| 4 | 5 | ||
| 5 | # handle PN differences | 6 | SRC_URI += "file://check-test-wrapper" |
| 6 | FILESEXTRAPATHS:prepend := "${THISDIR}/glibc:" | ||
| 7 | 7 | ||
| 8 | # strip provides | 8 | # strip provides |
| 9 | PROVIDES = "" | 9 | PROVIDES = "" |
| 10 | # setup depends | ||
| 11 | INHIBIT_DEFAULT_DEPS = "" | ||
| 12 | |||
| 13 | python () { | ||
| 14 | libc = d.getVar("PREFERRED_PROVIDER_virtual/libc") | ||
| 15 | libclocale = d.getVar("PREFERRED_PROVIDER_virtual/libc-locale") | ||
| 16 | if libc != "glibc" or libclocale != "glibc-locale": | ||
| 17 | raise bb.parse.SkipRecipe("glibc-testsuite requires that virtual/libc is glibc") | ||
| 18 | } | ||
| 19 | |||
| 20 | DEPENDS += "glibc-locale libgcc gcc-runtime" | ||
| 21 | |||
| 22 | # remove the initial depends | ||
| 23 | DEPENDS:remove = "libgcc-initial" | ||
| 24 | |||
| 25 | inherit qemu | ||
| 26 | |||
| 27 | SRC_URI += "file://check-test-wrapper" | ||
| 28 | 10 | ||
| 29 | DEPENDS += "${@'qemu-native' if d.getVar('TOOLCHAIN_TEST_TARGET') == 'user' else ''}" | 11 | DEPENDS += "${@'qemu-native' if d.getVar('TOOLCHAIN_TEST_TARGET') == 'user' else ''}" |
| 30 | 12 | ||
| @@ -33,20 +15,10 @@ TOOLCHAIN_TEST_HOST ??= "localhost" | |||
| 33 | TOOLCHAIN_TEST_HOST_USER ??= "root" | 15 | TOOLCHAIN_TEST_HOST_USER ??= "root" |
| 34 | TOOLCHAIN_TEST_HOST_PORT ??= "2222" | 16 | TOOLCHAIN_TEST_HOST_PORT ??= "2222" |
| 35 | 17 | ||
| 36 | do_check[dirs] += "${B}" | ||
| 37 | do_check[nostamp] = "1" | 18 | do_check[nostamp] = "1" |
| 38 | do_check () { | 19 | do_check:append () { |
| 39 | chmod 0755 ${WORKDIR}/check-test-wrapper | 20 | chmod 0755 ${WORKDIR}/check-test-wrapper |
| 40 | 21 | ||
| 41 | # clean out previous test results | ||
| 42 | oe_runmake tests-clean | ||
| 43 | # makefiles don't clean entirely (and also sometimes fails due to too many args) | ||
| 44 | find ${B} -type f -name "*.out" -delete | ||
| 45 | find ${B} -type f -name "*.test-result" -delete | ||
| 46 | find ${B}/catgets -name "*.cat" -delete | ||
| 47 | find ${B}/conform -name "symlist-*" -delete | ||
| 48 | [ ! -e ${B}/timezone/testdata ] || rm -rf ${B}/timezone/testdata | ||
| 49 | |||
| 50 | oe_runmake -i \ | 22 | oe_runmake -i \ |
| 51 | QEMU_SYSROOT="${RECIPE_SYSROOT}" \ | 23 | QEMU_SYSROOT="${RECIPE_SYSROOT}" \ |
| 52 | QEMU_OPTIONS="${@qemu_target_binary(d)} ${QEMU_OPTIONS}" \ | 24 | QEMU_OPTIONS="${@qemu_target_binary(d)} ${QEMU_OPTIONS}" \ |
| @@ -56,7 +28,6 @@ do_check () { | |||
| 56 | test-wrapper="${WORKDIR}/check-test-wrapper ${TOOLCHAIN_TEST_TARGET}" \ | 28 | test-wrapper="${WORKDIR}/check-test-wrapper ${TOOLCHAIN_TEST_TARGET}" \ |
| 57 | check | 29 | check |
| 58 | } | 30 | } |
| 59 | addtask do_check after do_compile | ||
| 60 | 31 | ||
| 61 | inherit nopackages | 32 | inherit nopackages |
| 62 | deltask do_stash_locale | 33 | deltask do_stash_locale |
