glibc-tests_2.36.bb 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. require glibc_${PV}.bb
  2. require glibc-tests.inc
  3. inherit ptest features_check
  4. REQUIRED_DISTRO_FEATURES = "ptest"
  5. SRC_URI += "\
  6. file://run-ptest \
  7. "
  8. SUMMARY = "glibc tests to be run with ptest"
  9. # Erase some variables already set by glibc_${PV}
  10. python __anonymous() {
  11. # Remove packages provided by glibc build, we only need a subset of them
  12. d.setVar("PACKAGES", "${PN} ${PN}-ptest")
  13. d.setVar("PROVIDES", "${PN} ${PN}-ptest")
  14. bbclassextend = d.getVar("BBCLASSEXTEND").replace("nativesdk", "").strip()
  15. d.setVar("BBCLASSEXTEND", bbclassextend)
  16. d.setVar("RRECOMMENDS", "")
  17. d.setVar("SYSTEMD_SERVICE:nscd", "")
  18. d.setVar("SYSTEMD_PACKAGES", "")
  19. }
  20. # Remove any leftovers from original glibc recipe
  21. RPROVIDES:${PN} = "${PN}"
  22. RRECOMMENDS:${PN} = ""
  23. RDEPENDS:${PN} = " glibc sed"
  24. RDEPENDS:${PN}-ptest = "${PN}"
  25. DEPENDS += "sed"
  26. export oe_srcdir="${exec_prefix}/src/debug/glibc/${PV}/"
  27. # Just build tests for target - do not run them
  28. do_check:append () {
  29. oe_runmake -i check run-built-tests=no
  30. }
  31. addtask do_check after do_compile before do_install_ptest_base
  32. glibc_strip_build_directory () {
  33. # Delete all non executable files from build directory
  34. find ${B} ! -executable -type f -delete
  35. # Remove build dynamic libraries and links to them as
  36. # those are already installed in the target device
  37. find ${B} -type f -name "*.so" -delete
  38. find ${B} -type l -name "*.so*" -delete
  39. # Remove headers (installed with glibc)
  40. find ${B} -type f -name "*.h" -delete
  41. find ${B} -type f -name "isomac" -delete
  42. find ${B} -type f -name "annexc" -delete
  43. }
  44. do_install_ptest_base () {
  45. glibc_strip_build_directory
  46. ls -r ${B}/*/*-time64 > ${B}/tst_time64
  47. # Remove '-time64' suffix - those tests are also time related
  48. sed -e "s/-time64$//" ${B}/tst_time64 > ${B}/tst_time_tmp
  49. tst_time=$(cat ${B}/tst_time_tmp ${B}/tst_time64)
  50. rm ${B}/tst_time_tmp ${B}/tst_time64
  51. echo "${tst_time}"
  52. # Install build test programs to the image
  53. install -d ${D}${PTEST_PATH}/tests/glibc-ptest/
  54. for f in "${tst_time}"
  55. do
  56. cp -r ${f} ${D}${PTEST_PATH}/tests/glibc-ptest/
  57. done
  58. install -d ${D}${PTEST_PATH}
  59. cp ${WORKDIR}/run-ptest ${D}${PTEST_PATH}/
  60. }
  61. # The datadir directory is required to allow core (and reused)
  62. # glibc cleanup function to finish correctly, as this directory
  63. # is not created for ptests
  64. stash_locale_package_cleanup:prepend () {
  65. mkdir -p ${PKGD}${datadir}
  66. }
  67. stash_locale_sysroot_cleanup:prepend () {
  68. mkdir -p ${SYSROOT_DESTDIR}${datadir}
  69. }
  70. # Prevent the do_package() task to set 'libc6' prefix
  71. # for glibc tests related packages
  72. python populate_packages:prepend () {
  73. if d.getVar('DEBIAN_NAMES'):
  74. d.setVar('DEBIAN_NAMES', '')
  75. }
  76. FILES:${PN} = "${PTEST_PATH}/* /usr/src/debug/${PN}/*"
  77. EXCLUDE_FROM_SHLIBS = "1"
  78. # Install debug data in .debug and sources in /usr/src/debug
  79. # It is more handy to have _all_ the sources and symbols in one
  80. # place (package) as this recipe will be used for validation and
  81. # debugging.
  82. PACKAGE_DEBUG_SPLIT_STYLE = ".debug"
  83. # glibc test cases violate by default some Yocto/OE checks (staticdev,
  84. # textrel)
  85. # 'debug-files' - add everything (including debug) into one package
  86. # (no need to install/build *-src package)
  87. INSANE_SKIP:${PN} += "staticdev textrel debug-files rpaths"
  88. deltask do_stash_locale
  89. do_install[noexec] = "1"
  90. do_populate_sysroot[noexec] = "1"