diff options
Diffstat (limited to 'meta/recipes-core/glibc')
-rw-r--r-- | meta/recipes-core/glibc/glibc-tests_2.34.bb | 113 | ||||
-rwxr-xr-x | meta/recipes-core/glibc/glibc/run-ptest | 37 |
2 files changed, 150 insertions, 0 deletions
diff --git a/meta/recipes-core/glibc/glibc-tests_2.34.bb b/meta/recipes-core/glibc/glibc-tests_2.34.bb new file mode 100644 index 0000000000..42b510c053 --- /dev/null +++ b/meta/recipes-core/glibc/glibc-tests_2.34.bb | |||
@@ -0,0 +1,113 @@ | |||
1 | require glibc_${PV}.bb | ||
2 | require glibc-tests.inc | ||
3 | |||
4 | inherit ptest | ||
5 | |||
6 | SRC_URI:append = " \ | ||
7 | file://run-ptest \ | ||
8 | " | ||
9 | |||
10 | SUMMARY = "glibc tests to be run with ptest" | ||
11 | |||
12 | # Erase some variables already set by glibc_${PV} | ||
13 | python __anonymous() { | ||
14 | # Remove packages provided by glibc build, we only need a subset of them | ||
15 | d.setVar("PACKAGES", "${PN} ${PN}-ptest") | ||
16 | |||
17 | d.setVar("PROVIDES", "${PN} ${PN}-ptest") | ||
18 | d.setVar("RPROVIDES", "${PN} ${PN}-ptest") | ||
19 | |||
20 | d.setVar("BBCLASSEXTEND", "") | ||
21 | d.setVar("RRECOMMENDS", "") | ||
22 | } | ||
23 | |||
24 | # Remove any leftovers from original glibc recipe | ||
25 | RPROVIDES:${PN} = "${PN}" | ||
26 | RRECOMMENDS:${PN} = "" | ||
27 | RDEPENDS:${PN} = " glibc sed" | ||
28 | DEPENDS:append = " sed" | ||
29 | |||
30 | # Just build tests for target - do not run them | ||
31 | do_check:append () { | ||
32 | oe_runmake -i check run-built-tests=no | ||
33 | } | ||
34 | addtask do_check after do_compile before do_install_ptest_base | ||
35 | |||
36 | glibc_strip_build_directory () { | ||
37 | # Delete all non executable files from build directory | ||
38 | find ${B} ! -executable -type f -delete | ||
39 | |||
40 | # Remove build dynamic libraries and links to them as | ||
41 | # those are already installed in the target device | ||
42 | find ${B} -type f -name "*.so" -delete | ||
43 | find ${B} -type l -name "*.so*" -delete | ||
44 | |||
45 | # Remove headers (installed with glibc) | ||
46 | find ${B} -type f -name "*.h" -delete | ||
47 | |||
48 | find ${B} -type f -name "isomac" -delete | ||
49 | find ${B} -type f -name "annexc" -delete | ||
50 | } | ||
51 | |||
52 | do_install_ptest_base () { | ||
53 | glibc_strip_build_directory | ||
54 | |||
55 | ls -r ${B}/*/*-time64 > ${B}/tst_time64 | ||
56 | |||
57 | # Remove '-time64' suffix - those tests are also time related | ||
58 | sed -e "s/-time64$//" ${B}/tst_time64 > ${B}/tst_time_tmp | ||
59 | tst_time=$(cat ${B}/tst_time_tmp ${B}/tst_time64) | ||
60 | |||
61 | rm ${B}/tst_time_tmp ${B}/tst_time64 | ||
62 | echo "${tst_time}" | ||
63 | |||
64 | # Install build test programs to the image | ||
65 | install -d ${D}${PTEST_PATH}/tests/glibc-ptest/ | ||
66 | |||
67 | for f in "${tst_time}" | ||
68 | do | ||
69 | cp -r ${f} ${D}${PTEST_PATH}/tests/glibc-ptest/ | ||
70 | done | ||
71 | |||
72 | install -d ${D}${PTEST_PATH} | ||
73 | cp ${WORKDIR}/run-ptest ${D}${PTEST_PATH}/ | ||
74 | |||
75 | } | ||
76 | |||
77 | # The datadir directory is required to allow core (and reused) | ||
78 | # glibc cleanup function to finish correctly, as this directory | ||
79 | # is not created for ptests | ||
80 | stash_locale_package_cleanup:prepend () { | ||
81 | mkdir -p ${PKGD}${datadir} | ||
82 | } | ||
83 | |||
84 | stash_locale_sysroot_cleanup:prepend () { | ||
85 | mkdir -p ${SYSROOT_DESTDIR}${datadir} | ||
86 | } | ||
87 | |||
88 | # Prevent the do_package() task to set 'libc6' prefix | ||
89 | # for glibc tests related packages | ||
90 | python populate_packages:prepend () { | ||
91 | if d.getVar('DEBIAN_NAMES'): | ||
92 | d.setVar('DEBIAN_NAMES', '') | ||
93 | } | ||
94 | |||
95 | FILES:${PN} = "${PTEST_PATH}/* /usr/src/debug/glibc-tests/*" | ||
96 | |||
97 | EXCLUDE_FROM_SHLIBS = "1" | ||
98 | |||
99 | # Install debug data in .debug and sources in /usr/src/debug | ||
100 | # It is more handy to have _all_ the sources and symbols in one | ||
101 | # place (package) as this recipe will be used for validation and | ||
102 | # debugging. | ||
103 | PACKAGE_DEBUG_SPLIT_STYLE = "debug" | ||
104 | |||
105 | # glibc test cases violate by default some Yocto/OE checks (staticdev, | ||
106 | # textrel) | ||
107 | # 'debug-files' - add everything (including debug) into one package | ||
108 | # (no need to install/build *-src package) | ||
109 | INSANE_SKIP:${PN} += "staticdev textrel debug-files rpaths" | ||
110 | |||
111 | deltask do_stash_locale | ||
112 | do_install[noexec] = "1" | ||
113 | do_populate_sysroot[noexec] = "1" | ||
diff --git a/meta/recipes-core/glibc/glibc/run-ptest b/meta/recipes-core/glibc/glibc/run-ptest new file mode 100755 index 0000000000..f637986105 --- /dev/null +++ b/meta/recipes-core/glibc/glibc/run-ptest | |||
@@ -0,0 +1,37 @@ | |||
1 | #!/bin/sh | ||
2 | # ptest script for glibc - to run time related tests to | ||
3 | # facilitate Y2038 validation | ||
4 | # Run with 'ptest-runner glibc-tests' | ||
5 | |||
6 | output() { | ||
7 | retcode=$? | ||
8 | if [ $retcode -eq 0 ] | ||
9 | then echo "PASS: $i" | ||
10 | elif [ $retcode -eq 77 ] | ||
11 | then echo "SKIP: $i" | ||
12 | else echo "FAIL: $i" | ||
13 | fi | ||
14 | } | ||
15 | |||
16 | # Allow altering time on the target | ||
17 | export GLIBC_TEST_ALLOW_TIME_SETTING="1" | ||
18 | |||
19 | tst_time64=$(ls -r ${PWD}/tests/glibc-ptest/*-time64) | ||
20 | |||
21 | # Remove '-time64' suffix - those tests are also time | ||
22 | # related | ||
23 | tst_time_tmp=$(sed -e "s/-time64$//" <<< ${tst_time64}) | ||
24 | |||
25 | # Run tests supporting only 32 bit time | ||
26 | for i in ${tst_time_tmp} | ||
27 | do | ||
28 | $i >/dev/null 2>&1 | ||
29 | output | ||
30 | done | ||
31 | |||
32 | # Run tests supporting only 64 bit time | ||
33 | for i in ${tst_time64} | ||
34 | do | ||
35 | $i >/dev/null 2>&1 | ||
36 | output | ||
37 | done | ||