diff mbox series

[meta-oe,kirkstone] cli11: fix ptests

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

Commit Message

Gyorgy Sarvari Oct. 17, 2025, 11:21 a.m. UTC
The recipe inherits the ptest class, however it doesn't install
the actual tests, nor executes them.

This change installs the tests, and add a run-ptest script to
execute them also.

The tests are fairly quick, it takes single digit seconds on my
machine to execute.

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

Patch

diff --git a/meta-oe/recipes-support/cli11/cli11/run-ptest b/meta-oe/recipes-support/cli11/cli11/run-ptest
new file mode 100644
index 0000000000..ef37d44783
--- /dev/null
+++ b/meta-oe/recipes-support/cli11/cli11/run-ptest
@@ -0,0 +1,5 @@ 
+#!/bin/sh
+cd tests
+for t in `ls ./*Test`; do
+	./$t && echo PASS: $t || echo FAIL: $t
+done
diff --git a/meta-oe/recipes-support/cli11/cli11_1.9.1.bb b/meta-oe/recipes-support/cli11/cli11_1.9.1.bb
index 7de3335abd..c8a2f7358b 100644
--- a/meta-oe/recipes-support/cli11/cli11_1.9.1.bb
+++ b/meta-oe/recipes-support/cli11/cli11_1.9.1.bb
@@ -6,7 +6,8 @@  LIC_FILES_CHKSUM = "file://LICENSE;md5=b73927b18d5c6cd8d2ed28a6ad539733"
 SRCREV = "5cb3efabce007c3a0230e4cc2e27da491c646b6c"
 PV .= "+git${SRCPV}"
 
-SRC_URI += "gitsm://github.com/CLIUtils/CLI11;branch=v1;protocol=https"
+SRC_URI += "gitsm://github.com/CLIUtils/CLI11;branch=v1;protocol=https \
+            file://run-ptest"
 
 S = "${WORKDIR}/git"
 
@@ -15,3 +16,11 @@  inherit ptest
 
 # cli11 is a header only C++ library, so the main package will be empty.
 RDEPENDS:${PN}-dev = ""
+RDEPENDS:${PN}-ptest = ""
+
+do_install_ptest(){
+	install -d ${D}${PTEST_PATH}/tests
+	for t in `ls ${B}/tests/*Test`; do
+		install $t ${D}${PTEST_PATH}/tests/
+	done
+}