diff mbox series

[meta-oe,kirkstone] function2: fix ptests

Message ID 20251017131118.2474234-1-skandigraun@gmail.com
State New
Headers show
Series [meta-oe,kirkstone] function2: fix ptests | expand

Commit Message

Gyorgy Sarvari Oct. 17, 2025, 1:11 p.m. UTC
The recipe has inherited the ptest class, however it did not install
not execute any tests.

This change installs the tests and add a script to execute them.

The tests are quick, execution takes single digit seconds.

Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com>
---
 meta-oe/recipes-support/function2/function2/run-ptest | 3 +++
 meta-oe/recipes-support/function2/function2_4.2.0.bb  | 9 ++++++++-
 2 files changed, 11 insertions(+), 1 deletion(-)
 create mode 100644 meta-oe/recipes-support/function2/function2/run-ptest
diff mbox series

Patch

diff --git a/meta-oe/recipes-support/function2/function2/run-ptest b/meta-oe/recipes-support/function2/function2/run-ptest
new file mode 100644
index 0000000000..de0eab0cee
--- /dev/null
+++ b/meta-oe/recipes-support/function2/function2/run-ptest
@@ -0,0 +1,3 @@ 
+#!/bin/sh
+
+./function2_tests && echo PASS: function2_tests || echo FAIL: function2_tests
diff --git a/meta-oe/recipes-support/function2/function2_4.2.0.bb b/meta-oe/recipes-support/function2/function2_4.2.0.bb
index 2843939ee8..3fe757f0ba 100644
--- a/meta-oe/recipes-support/function2/function2_4.2.0.bb
+++ b/meta-oe/recipes-support/function2/function2_4.2.0.bb
@@ -6,7 +6,8 @@  LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=e4224ccaecb14d942c71d31bef20d78c"
 SRCREV = "02ca99831de59c7c3a4b834789260253cace0ced"
 PV .= "+git${SRCPV}"
 
-SRC_URI += "gitsm://github.com/Naios/function2;branch=master;protocol=https"
+SRC_URI += "gitsm://github.com/Naios/function2;branch=master;protocol=https \
+            file://run-ptest"
 
 S = "${WORKDIR}/git"
 
@@ -19,3 +20,9 @@  do_install:append() {
 	mv ${D}/${prefix}/Readme.md ${D}/${datadir}/function2/
 	mv ${D}/${prefix}/LICENSE.txt ${D}/${datadir}/function2/
 }
+
+do_install_ptest(){
+	if [ -f ${B}/test/function2_tests ]; then
+		install ${B}/test/function2_tests ${D}${PTEST_PATH}/
+	fi
+}