]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
python3-libarchive-c: add ptest
authorCorentin Lévy <corentin.levy@smile.fr>
Fri, 2 Aug 2024 15:10:21 +0000 (17:10 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 5 Aug 2024 13:28:34 +0000 (14:28 +0100)
test added to the fast-list
result of ptest-runner:
Testsuite summary
TOTAL: 36
PASS: 36
SKIP: 0
XFAIL: 0
FAIL: 0
XPASS: 0
ERROR: 0
DURATION: 11
END: /usr/lib/python3-libarchive-c/ptest
2024-08-01T11:44
STOP: ptest-runner
TOTAL: 1 FAIL: 0

Signed-off-by: Corentin Lévy <corentin.levy@smile.fr>
Reviewed-by: Yoann Congal <yoann.congal@smile.fr>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/conf/distro/include/ptest-packagelists.inc
meta/recipes-devtools/python/python3-libarchive-c/run-ptest [new file with mode: 0644]
meta/recipes-devtools/python/python3-libarchive-c_5.1.bb

index e3ab7e86292590accc3563cba3bfedfe0c8f2a79..7b8418654a504882db0ff8c563962ab6e2f3a892 100644 (file)
@@ -63,6 +63,7 @@ PTESTS_FAST = "\
     python3-idna \
     python3-jinja2 \
     python3-jsonpointer \
+    python3-libarchive-c \
     python3-license-expression \
     python3-mako \
     python3-markupsafe \
diff --git a/meta/recipes-devtools/python/python3-libarchive-c/run-ptest b/meta/recipes-devtools/python/python3-libarchive-c/run-ptest
new file mode 100644 (file)
index 0000000..ddfbba7
--- /dev/null
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+# export needed to set the locale to support accentuated and non-latin chars in tests
+export LC_ALL=en_US.UTF-8
+
+pytest --automake
index 4e318e52f46ba8e11890a82d64c868856595ed62..c8aff3defe61c78e2a111594c6282852874292ce 100644 (file)
@@ -5,9 +5,13 @@ HOMEPAGE = "https://github.com/Changaco/python-libarchive-c"
 LICENSE = "CC0-1.0"
 LIC_FILES_CHKSUM = "file://LICENSE.md;md5=bcab380227a83bc147350b40a81e6ffc"
 
+SRC_URI += " \
+        file://run-ptest \
+"
+
 PYPI_PACKAGE = "libarchive-c"
 
-inherit pypi setuptools3
+inherit pypi setuptools3 ptest
 
 SRC_URI[sha256sum] = "7bcce24ea6c0fa3bc62468476c6d2f6264156db2f04878a372027c10615a2721"
 
@@ -18,4 +22,18 @@ RDEPENDS:${PN} += "\
   python3-logging \
 "
 
+RDEPENDS:${PN}-ptest += " \
+        locale-base-en-us \
+        python3-pytest \
+        python3-unittest-automake-output \
+"
+
 BBCLASSEXTEND = "native"
+
+do_install_ptest() {
+    install -d ${D}${PTEST_PATH}/tests
+    install -d ${D}${PTEST_PATH}/libarchive
+    cp -r ${S}/tests/* ${D}${PTEST_PATH}/tests/
+    cp ${S}/libarchive/* ${D}${PTEST_PATH}/libarchive/
+    cp ${S}/README.rst ${D}${PTEST_PATH}/README.rst
+}