Skip to contentSkip to conversation

libgpiod: ptest: rrecommend python3-unittest when building python tests

PATCH New Bartosz Golaszewski 1 participant 2 messages Nov 19, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 libgpiod: ptest: rrecommend python3-unittest when building python tests

The python test suite uses the unittest module. It's not built by default in minimal images, so we need to add it RRECOMMENDS explicitly.

---
 meta-oe/recipes-support/libgpiod/libgpiod_1.6.3.bb | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
meta-oe/recipes-support/libgpiod/libgpiod_1.6.3.bb +4 -1
index ac4ba85d7..474784646 100644
@@ -49,7 +49,10 @@ FILES:${PN}-python = "${PYTHON_SITEPACKAGES_DIR}/*.so"
 FILES:${PN}-staticdev += "${PYTHON_SITEPACKAGES_DIR}/*.a"
 
 RRECOMMENDS:${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'python3', '${PN}-python', '', d)}"
-RRECOMMENDS:${PN}-ptest += "kernel-module-gpio-mockup"
+RRECOMMENDS:${PN}-ptest += " \
+    kernel-module-gpio-mockup \
+    ${@bb.utils.contains('PACKAGECONFIG', 'python3', 'python3-unittest', '', d)} \
+"
 
 PACKAGECONFIG:append = " ${@bb.utils.contains('DISTRO_FEATURES', 'ptest', 'tests', '', d)}"
 
Signature · 1 line
2.25.1
#1 lore raw

PATCH 2/2 libgpiod: ptest: rrecommend coreutils

The bats test suite requires the 'timeout' and 'nl' commands to be available. Busybox' default config doesn't include those. They are built by default by coreutils though, so add it to RRECOMMENDS for ptest.

---
 meta-oe/recipes-support/libgpiod/libgpiod_1.6.3.bb | 1 +
 1 file changed, 1 insertion(+)
meta-oe/recipes-support/libgpiod/libgpiod_1.6.3.bb +1 -0
index 474784646..51b74ba5b 100644
@@ -51,6 +51,7 @@ FILES:${PN}-staticdev += "${PYTHON_SITEPACKAGES_DIR}/*.a"
 RRECOMMENDS:${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'python3', '${PN}-python', '', d)}"
 RRECOMMENDS:${PN}-ptest += " \
     kernel-module-gpio-mockup \
+    coreutils \
     ${@bb.utils.contains('PACKAGECONFIG', 'python3', 'python3-unittest', '', d)} \
 "
 
Signature · 1 line
2.25.1