[v2,2/2] python3-lz4: add ptest

Message ID 20220321114353.1731727-2-ross.burton@arm.com
State New
Headers show
Series [v2,1/2] python3-lz4: use system lz4 library | expand

Commit Message

Ross Burton March 21, 2022, 11:43 a.m. UTC
Signed-off-by: Ross Burton <ross.burton@arm.com>
---
 .../recipes-devtools/python/python3-lz4/run-ptest    |  3 +++
 .../recipes-devtools/python/python3-lz4_4.0.0.bb     | 12 +++++++++++-
 2 files changed, 14 insertions(+), 1 deletion(-)
 create mode 100644 meta-python/recipes-devtools/python/python3-lz4/run-ptest

Patch

diff --git a/meta-python/recipes-devtools/python/python3-lz4/run-ptest b/meta-python/recipes-devtools/python/python3-lz4/run-ptest
new file mode 100644
index 0000000000..1b245bcd8f
--- /dev/null
+++ b/meta-python/recipes-devtools/python/python3-lz4/run-ptest
@@ -0,0 +1,3 @@ 
+#!/bin/sh
+
+pytest -v
diff --git a/meta-python/recipes-devtools/python/python3-lz4_4.0.0.bb b/meta-python/recipes-devtools/python/python3-lz4_4.0.0.bb
index 75472d327e..ef5b006272 100644
--- a/meta-python/recipes-devtools/python/python3-lz4_4.0.0.bb
+++ b/meta-python/recipes-devtools/python/python3-lz4_4.0.0.bb
@@ -9,8 +9,18 @@  DEPENDS += " \
     ${PYTHON_PN}-pkgconfig-native \
 "
 
+SRC_URI += "file://run-ptest"
+
 SRC_URI[sha256sum] = "57c5dfd3b7dae833b0d2b2c1aafd7f9d0dfcab40683d183d010c67c9fd1beca3"
 
-inherit pkgconfig pypi python_setuptools_build_meta
+inherit pkgconfig pypi python_setuptools_build_meta ptest
+
+RDEPENDS:${PN}-ptest += "${PYTHON_PN}-pytest ${PYTHON_PN}-multiprocessing ${PYTHON_PN}-psutil"
+
+do_install_ptest() {
+    cp -rf ${S}/tests/ ${D}${PTEST_PATH}/
+    # The stream API is experimental and not enabled yet, so don't ship the test suite
+    rm -rf ${D}${PTEST_PATH}/tests/stream
+}
 
 BBCLASSEXTEND = "native nativesdk"