summaryrefslogtreecommitdiffstats
path: root/meta-python
diff options
context:
space:
mode:
authorZang Ruochen <zangrc.fnst@cn.fujitsu.com>2020-07-17 03:43:18 +0800
committerKhem Raj <raj.khem@gmail.com>2020-07-16 12:10:35 -0700
commit5589e39dbe4f19e8cecd0a55d5f5130e953c3b08 (patch)
tree0f396ebdc2f4f695fa58708883d6f6efb02d42a7 /meta-python
parent0fdee019fd5c90abd057b9c47f6a6d6786caec5c (diff)
downloadmeta-openembedded-5589e39dbe4f19e8cecd0a55d5f5130e953c3b08.tar.gz
python3-smpplib: Enable ptest
Signed-off-by: Zang Ruochen <zangrc.fnst@cn.fujitsu.com> Acked-by: Trevor Gamblin <trevor.gamblin@windriver.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-python')
-rw-r--r--meta-python/recipes-devtools/python/python3-smpplib/run-ptest3
-rw-r--r--meta-python/recipes-devtools/python/python3-smpplib_2.1.0.bb17
2 files changed, 19 insertions, 1 deletions
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 @@
1#!/bin/sh
2
3pytest -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"
6PYPI_PACKAGE = "smpplib" 6PYPI_PACKAGE = "smpplib"
7SRC_URI[sha256sum] = "df4139a279b35fbb42a58f2a254a9c6daf362b04a7f94e208dc120e0b8a3fd4b" 7SRC_URI[sha256sum] = "df4139a279b35fbb42a58f2a254a9c6daf362b04a7f94e208dc120e0b8a3fd4b"
8 8
9inherit pypi setuptools3 9inherit pypi setuptools3 ptest
10
11SRC_URI += " \
12 file://run-ptest \
13"
14
15RDEPENDS_${PN}-ptest += " \
16 ${PYTHON_PN}-pytest \
17 ${PYTHON_PN}-unittest \
18"
19
20do_install_ptest() {
21 install -d ${D}${PTEST_PATH}/tests
22 cp -rf ${S}/tests/* ${D}${PTEST_PATH}/tests/
23 sed -i 's/mock/unittest.mock/g' ${D}${PTEST_PATH}/tests/*
24}