On 7/16/20 3:43 PM, zangrc wrote: > Signed-off-by: Zang Ruochen Acked-by: Trevor Gamblin > --- > .../python/python3-smpplib/run-ptest | 3 +++ > .../python/python3-smpplib_2.1.0.bb | 17 ++++++++++++++++- > 2 files changed, 19 insertions(+), 1 deletion(-) > create mode 100644 meta-python/recipes-devtools/python/python3-smpplib/run-ptest > > diff --git a/meta-python/recipes-devtools/python/python3-smpplib/run-ptest b/meta-python/recipes-devtools/python/python3-smpplib/run-ptest > new file mode 100644 > index 0000000000..b63c4de0d9 > --- /dev/null > +++ b/meta-python/recipes-devtools/python/python3-smpplib/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/SKIPPED/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-smpplib_2.1.0.bb b/meta-python/recipes-devtools/python/python3-smpplib_2.1.0.bb > index 948af58aab..15b326bad4 100644 > --- a/meta-python/recipes-devtools/python/python3-smpplib_2.1.0.bb > +++ b/meta-python/recipes-devtools/python/python3-smpplib_2.1.0.bb > @@ -6,4 +6,19 @@ LIC_FILES_CHKSUM = "file://README.md;md5=56a03d0ce7e492d4b9487b8aae957efe" > PYPI_PACKAGE = "smpplib" > SRC_URI[sha256sum] = "df4139a279b35fbb42a58f2a254a9c6daf362b04a7f94e208dc120e0b8a3fd4b" > > -inherit pypi setuptools3 > +inherit pypi setuptools3 ptest > + > +SRC_URI += " \ > + file://run-ptest \ > +" > + > +RDEPENDS_${PN}-ptest += " \ > + ${PYTHON_PN}-pytest \ > + ${PYTHON_PN}-unittest \ > +" > + > +do_install_ptest() { > + install -d ${D}${PTEST_PATH}/tests > + cp -rf ${S}/tests/* ${D}${PTEST_PATH}/tests/ > + sed -i 's/mock/unittest.mock/g' ${D}${PTEST_PATH}/tests/* > +} > >