diff mbox series

[meta-python,4/5] python3-portion: enable ptest

Message ID 20241011130441.2919272-4-alperyasinak1@gmail.com
State Accepted
Headers show
Series [meta-python,1/5] python3-propcache: enable ptest | expand

Commit Message

alperak Oct. 11, 2024, 1:04 p.m. UTC
- Tested on qemux86-64 and qemuarm64

- Added ptest into PTESTS_FAST_META_PYTHON

Ptest result:
=============

qemux86-64:

Testsuite summary
TOTAL: 205
PASS: 205
SKIP: 0
XFAIL: 0
FAIL: 0
XPASS: 0
ERROR: 0
DURATION: 27
END: /usr/lib/python3-portion/ptest
2024-10-11T12:13
STOP: ptest-runner
TOTAL: 1 FAIL: 0

qemuarm64:

Testsuite summary
TOTAL: 205
PASS: 205
SKIP: 0
XFAIL: 0
FAIL: 0
XPASS: 0
ERROR: 0
DURATION: 25
END: /usr/lib/python3-portion/ptest
2024-10-11T12:18
STOP: ptest-runner
TOTAL: 1 FAIL: 0

Signed-off-by: alperak <alperyasinak1@gmail.com>
---
 .../ptest-packagelists-meta-python.inc        |  1 +
 .../python/python3-portion/run-ptest          |  3 +++
 .../python/python3-portion_2.5.0.bb           | 22 ++++++++++++++++---
 3 files changed, 23 insertions(+), 3 deletions(-)
 create mode 100644 meta-python/recipes-devtools/python/python3-portion/run-ptest
diff mbox series

Patch

diff --git a/meta-python/conf/include/ptest-packagelists-meta-python.inc b/meta-python/conf/include/ptest-packagelists-meta-python.inc
index 8f739f24f..196ff6a73 100644
--- a/meta-python/conf/include/ptest-packagelists-meta-python.inc
+++ b/meta-python/conf/include/ptest-packagelists-meta-python.inc
@@ -48,6 +48,7 @@  PTESTS_FAST_META_PYTHON = "\
     python3-platformdirs \
     python3-polyline \
     python3-portalocker \
+    python3-portion \
     python3-precise-runner \
     python3-prettytable \
     python3-propcache \
diff --git a/meta-python/recipes-devtools/python/python3-portion/run-ptest b/meta-python/recipes-devtools/python/python3-portion/run-ptest
new file mode 100644
index 000000000..8d2017d39
--- /dev/null
+++ b/meta-python/recipes-devtools/python/python3-portion/run-ptest
@@ -0,0 +1,3 @@ 
+#!/bin/sh
+
+pytest --automake
diff --git a/meta-python/recipes-devtools/python/python3-portion_2.5.0.bb b/meta-python/recipes-devtools/python/python3-portion_2.5.0.bb
index f4e5d2036..269473e93 100644
--- a/meta-python/recipes-devtools/python/python3-portion_2.5.0.bb
+++ b/meta-python/recipes-devtools/python/python3-portion_2.5.0.bb
@@ -5,12 +5,28 @@  SECTION = "devel/python"
 LICENSE = "LGPL-3.0-only"
 LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=3000208d539ec061b899bce1d9ce9404"
 
-inherit pypi python_setuptools_build_meta
+inherit pypi python_setuptools_build_meta ptest
 
 SRC_URI[sha256sum] = "80ae7bab71f4844e3eb33c57954d76a3bd4cb351039b6e260e779325aeb4a487"
 
-RDEPENDS:${PN} = "\
-    python3-sortedcontainers \
+SRC_URI += " \
+	file://run-ptest \
 "
 
+RDEPENDS:${PN} += "\
+	python3-sortedcontainers \
+"
+
+RDEPENDS:${PN}-ptest += " \
+	python3-pytest \
+	python3-unittest-automake-output \
+"
+
+do_install_ptest() {
+	install -d ${D}${PTEST_PATH}/tests
+	# This file tests README.md and deleted as redundant.
+	rm -f ${S}/tests/test_doc.py
+	cp -rf ${S}/tests/* ${D}${PTEST_PATH}/tests/
+}
+
 BBCLASSEXTEND = "native"