summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/classes-recipe/ptest-python-pytest.bbclass31
-rwxr-xr-xmeta/files/ptest-python-pytest/run-ptest3
2 files changed, 34 insertions, 0 deletions
diff --git a/meta/classes-recipe/ptest-python-pytest.bbclass b/meta/classes-recipe/ptest-python-pytest.bbclass
new file mode 100644
index 0000000000..6d4f16a96e
--- /dev/null
+++ b/meta/classes-recipe/ptest-python-pytest.bbclass
@@ -0,0 +1,31 @@
1#
2# Copyright OpenEmbedded Contributors
3#
4# SPDX-License-Identifier: MIT
5#
6
7inherit ptest
8
9FILESEXTRAPATHS:prepend := "${COREBASE}/meta/files:"
10
11SRC_URI:append = "\
12 file://ptest-python-pytest/run-ptest \
13"
14
15# Overridable configuration for the directory within the source tree
16# containing the pytest files
17PTEST_PYTEST_DIR ?= "tests"
18
19do_install_ptest() {
20 if [ ! -f ${D}${PTEST_PATH}/run-ptest ]; then
21 install -m 0755 ${UNPACKDIR}/ptest-python-pytest/run-ptest ${D}${PTEST_PATH}
22 fi
23 if [ -d "${S}/${PTEST_PYTEST_DIR}" ]; then
24 install -d ${D}${PTEST_PATH}/${PTEST_PYTEST_DIR}
25 cp -rf ${S}/${PTEST_PYTEST_DIR}/* ${D}${PTEST_PATH}/${PTEST_PYTEST_DIR}/
26 fi
27}
28
29FILES:${PN}-ptest:prepend = "${PTEST_PATH}/*"
30
31RDEPENDS:${PN}-ptest:prepend = "python3-pytest python3-unittest-automake-output "
diff --git a/meta/files/ptest-python-pytest/run-ptest b/meta/files/ptest-python-pytest/run-ptest
new file mode 100755
index 0000000000..8d2017d39c
--- /dev/null
+++ b/meta/files/ptest-python-pytest/run-ptest
@@ -0,0 +1,3 @@
1#!/bin/sh
2
3pytest --automake