diff options
author | Zang Ruochen <zangrc.fnst@cn.fujitsu.com> | 2020-07-17 03:43:18 +0800 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2020-07-16 12:10:35 -0700 |
commit | 5589e39dbe4f19e8cecd0a55d5f5130e953c3b08 (patch) | |
tree | 0f396ebdc2f4f695fa58708883d6f6efb02d42a7 /meta-python | |
parent | 0fdee019fd5c90abd057b9c47f6a6d6786caec5c (diff) | |
download | meta-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-ptest | 3 | ||||
-rw-r--r-- | meta-python/recipes-devtools/python/python3-smpplib_2.1.0.bb | 17 |
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 | |||
3 | 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" | |||
6 | PYPI_PACKAGE = "smpplib" | 6 | PYPI_PACKAGE = "smpplib" |
7 | SRC_URI[sha256sum] = "df4139a279b35fbb42a58f2a254a9c6daf362b04a7f94e208dc120e0b8a3fd4b" | 7 | SRC_URI[sha256sum] = "df4139a279b35fbb42a58f2a254a9c6daf362b04a7f94e208dc120e0b8a3fd4b" |
8 | 8 | ||
9 | inherit pypi setuptools3 | 9 | inherit pypi setuptools3 ptest |
10 | |||
11 | SRC_URI += " \ | ||
12 | file://run-ptest \ | ||
13 | " | ||
14 | |||
15 | RDEPENDS_${PN}-ptest += " \ | ||
16 | ${PYTHON_PN}-pytest \ | ||
17 | ${PYTHON_PN}-unittest \ | ||
18 | " | ||
19 | |||
20 | do_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 | } | ||