python3-inotify: add ptest

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.

ptest result:
           PASS FAIL SKIP
qemux86-64 5    3    1
qemuarm64  5    3    1

This issue exists since inotify adds unit test support, and it is
reported here: https://github.com/dsoprea/PyInotify/issues/95

Signed-off-by: Zheng Qiu <zheng.qiu@windriver.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
This commit is contained in:
Zheng Qiu 2022-11-28 10:44:57 -05:00 committed by Khem Raj
parent f5cc539e40
commit 4091a12ef9
3 changed files with 38 additions and 14 deletions

View File

@ -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}}'

View File

@ -1,14 +0,0 @@
SUMMARY = "An adapter to Linux kernel support for inotify directory-watching."
AUTHOR = "Dustin Oprea"
HOMEPAGE = "https://pypi.org/project/inotify/"
LICENSE = "GPL-2.0-only"
LIC_FILES_CHKSUM = "file://setup.py;md5=79b7ec72aa0d446a552d3cceb5799e41;beginline=28;endline=28"
SRC_URI[sha256sum] = "974a623a338482b62e16d4eb705fb863ed33ec178680fc3e96ccdf0df6c02a07"
inherit pypi setuptools3
RDEPENDS:${PN} += " \
python3-ctypes \
python3-logging \
"

View File

@ -0,0 +1,35 @@
SUMMARY = "An adapter to Linux kernel support for inotify directory-watching."
AUTHOR = "Dustin Oprea"
HOMEPAGE = "https://pypi.org/project/inotify/"
LICENSE = "GPL-2.0-only"
LIC_FILES_CHKSUM = "file://setup.py;md5=79b7ec72aa0d446a552d3cceb5799e41;beginline=28;endline=28"
SRC_URI[sha256sum] = "974a623a338482b62e16d4eb705fb863ed33ec178680fc3e96ccdf0df6c02a07"
SRC_URI = " \
git://github.com/dsoprea/pyinotify.git;branch=master;protocol=https \
file://run-ptest \
"
SRCREV = "9be6a51d1660991562eefaaddefa757ca0e0e00f"
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/
}