diff mbox series

[meta-python,2/5] python3-olefile: Enable tests

Message ID 20260709130921.4185087-2-leon.anavi@konsulko.com
State Under Review
Headers show
Series [meta-python,1/5] python3-jsbeautifier: Enable tests | expand

Commit Message

Leon Anavi July 9, 2026, 1:09 p.m. UTC
Inherit ptest and include tests for olefile.

This work was sponsored by GOVCERT.LU.

Signed-off-by: Leon Anavi <leon.anavi@konsulko.com>
---
 .../python/python3-olefile/run-ptest            |  3 +++
 .../python/python3-olefile_0.47.bb              | 17 +++++++++++++++--
 2 files changed, 18 insertions(+), 2 deletions(-)
 create mode 100644 meta-python/recipes-devtools/python/python3-olefile/run-ptest
diff mbox series

Patch

diff --git a/meta-python/recipes-devtools/python/python3-olefile/run-ptest b/meta-python/recipes-devtools/python/python3-olefile/run-ptest
new file mode 100644
index 0000000000..8d2017d39c
--- /dev/null
+++ b/meta-python/recipes-devtools/python/python3-olefile/run-ptest
@@ -0,0 +1,3 @@ 
+#!/bin/sh
+
+pytest --automake
diff --git a/meta-python/recipes-devtools/python/python3-olefile_0.47.bb b/meta-python/recipes-devtools/python/python3-olefile_0.47.bb
index bb6fa7a8cc..c5f72d12eb 100644
--- a/meta-python/recipes-devtools/python/python3-olefile_0.47.bb
+++ b/meta-python/recipes-devtools/python/python3-olefile_0.47.bb
@@ -3,11 +3,12 @@  HOMEPAGE = "https://github.com/decalage2/olefile"
 LICENSE = "BSD-2-Clause"
 LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=f18814bd70fd28e11a4545145dcb3822"
 
+SRC_URI += "file://run-ptest"
+
 SRC_URI[sha256sum] = "599383381a0bf3dfbd932ca0ca6515acd174ed48870cbf7fee123d698c192c1c"
 
-inherit pypi setuptools3
+inherit pypi setuptools3 ptest
 
-PYPI_PACKAGE = "olefile"
 PYPI_PACKAGE_EXT = "zip"
 
 RDEPENDS:${PN} += "\
@@ -15,3 +16,15 @@  RDEPENDS:${PN} += "\
     python3-datetime \
     python3-logging \
 "
+
+RDEPENDS:${PN}-ptest += " \
+    python3-pytest \
+    python3-core \
+    python3-unittest \
+    python3-unittest-automake-output \
+"
+
+do_install_ptest() {
+    install -d ${D}${PTEST_PATH}/tests
+    cp -rf ${S}/tests/* ${D}${PTEST_PATH}/tests/
+}