Add ptest provided from the source code, and run it using pytest.
Since the tarball provided with pypi does not include ptest, switch the
source to be its git repo.
Signed-off-by: Zheng Qiu <zheng.qiu@...>
---
.../python/python3-inotify/run-ptest | 3 +++
.../python/python3-inotify_0.2.10.bb | 23 ++++++++++++++++++-
2 files changed, 25 insertions(+), 1 deletion(-)
create mode 100644 meta-python/recipes-devtools/python/python3-inotify/run-ptest
diff --git a/meta-python/recipes-devtools/python/python3-inotify/run-ptest b/meta-python/recipes-devtools/python/python3-inotify/run-ptest
new file mode 100644
index 000000000..3385d6893
--- /dev/null
+++ b/meta-python/recipes-devtools/python/python3-inotify/run-ptest
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+pytest -o log_cli=true -o log_cli_level=INFO | sed -e 's/\[...%\]//g'| sed -e 's/PASSED/PASS/g'| sed -e 's/FAILED/FAIL/g'|sed -e 's/SKIPED/SKIP/g'| awk '{if ($NF=="PASS" || $NF=="FAIL" || $NF=="SKIP" || $NF=="XFAIL" || $NF=="XPASS"){printf "%s: %s\n", $NF, $0}else{print}}'| awk '{if ($NF=="PASS" || $NF=="FAIL" || $NF=="SKIP" || $NF=="XFAIL" || $NF=="XPASS") {$NF="";print $0}else{print}}'
diff --git a/meta-python/recipes-devtools/python/python3-inotify_0.2.10.bb b/meta-python/recipes-devtools/python/python3-inotify_0.2.10.bb
index 524c3a0d2..3306438a1 100644
--- a/meta-python/recipes-devtools/python/python3-inotify_0.2.10.bb
+++ b/meta-python/recipes-devtools/python/python3-inotify_0.2.10.bb
@@ -6,9 +6,30 @@ LIC_FILES_CHKSUM = "file://setup.py;md5=79b7ec72aa0d446a552d3cceb5799e41;beginli
SRC_URI[sha256sum] = "974a623a338482b62e16d4eb705fb863ed33ec178680fc3e96ccdf0df6c02a07"
-inherit pypi setuptools3
+SRC_URI = " \
+ git://github.com/dsoprea/pyinotify.git;branch=master;protocol=https \
+ file://run-ptest \
+"
+
+SRCREV = "f77596ae965e47124f38d7bd6587365924dcd8f7"
+
+S = "${WORKDIR}/git"
+
+inherit setuptools3 ptest
+PIP_INSTALL_PACKAGE = "inotify"
+PIP_INSTALL_DIST_PATH = "${S}/dist"
+
RDEPENDS:${PN} += " \
python3-ctypes \
python3-logging \
"
+
+RDEPENDS:${PN}-ptest += " \
+ ${PYTHON_PN}-pytest \
+"
+
+do_install_ptest() {
+ install -d ${D}${PTEST_PATH}/tests
+ cp -rf ${S}/tests/* ${D}${PTEST_PATH}/tests/
+}
--
2.33.0