summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/glibc
diff options
context:
space:
mode:
authorLukasz Majewski <lukma@denx.de>2021-09-30 12:43:56 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-10-18 13:48:17 +0100
commit5f5660c7fa050d9c0d9591094b5a5b077c22d346 (patch)
treea54ebed4fd9682e90f6128ee7ca2f17640a1d90f /meta/recipes-core/glibc
parent573c3363536048aea467901a5e6abde96f3c1b7b (diff)
downloadpoky-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/recipes-core/glibc')
-rw-r--r--meta/recipes-core/glibc/glibc-tests.inc32
-rw-r--r--meta/recipes-core/glibc/glibc-testsuite_2.34.bb37
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 @@
1EXCLUDE_FROM_WORLD = "1"
2
3# handle PN differences
4FILESEXTRAPATHS:prepend := "${THISDIR}/glibc:"
5
6# setup depends
7INHIBIT_DEFAULT_DEPS = ""
8
9python () {
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
16DEPENDS += "glibc-locale libgcc gcc-runtime"
17
18# remove the initial depends
19DEPENDS:remove = "libgcc-initial"
20
21do_check[dirs] += "${B}"
22do_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}
32addtask 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 @@
1require glibc_${PV}.bb 1require glibc_${PV}.bb
2require glibc-tests.inc
2 3
3EXCLUDE_FROM_WORLD = "1" 4inherit qemu
4 5
5# handle PN differences 6SRC_URI += "file://check-test-wrapper"
6FILESEXTRAPATHS:prepend := "${THISDIR}/glibc:"
7 7
8# strip provides 8# strip provides
9PROVIDES = "" 9PROVIDES = ""
10# setup depends
11INHIBIT_DEFAULT_DEPS = ""
12
13python () {
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
20DEPENDS += "glibc-locale libgcc gcc-runtime"
21
22# remove the initial depends
23DEPENDS:remove = "libgcc-initial"
24
25inherit qemu
26
27SRC_URI += "file://check-test-wrapper"
28 10
29DEPENDS += "${@'qemu-native' if d.getVar('TOOLCHAIN_TEST_TARGET') == 'user' else ''}" 11DEPENDS += "${@'qemu-native' if d.getVar('TOOLCHAIN_TEST_TARGET') == 'user' else ''}"
30 12
@@ -33,20 +15,10 @@ TOOLCHAIN_TEST_HOST ??= "localhost"
33TOOLCHAIN_TEST_HOST_USER ??= "root" 15TOOLCHAIN_TEST_HOST_USER ??= "root"
34TOOLCHAIN_TEST_HOST_PORT ??= "2222" 16TOOLCHAIN_TEST_HOST_PORT ??= "2222"
35 17
36do_check[dirs] += "${B}"
37do_check[nostamp] = "1" 18do_check[nostamp] = "1"
38do_check () { 19do_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}
59addtask do_check after do_compile
60 31
61inherit nopackages 32inherit nopackages
62deltask do_stash_locale 33deltask do_stash_locale