From 8917528948c93a9c933bf7d2c9110ba2cade43cc Mon Sep 17 00:00:00 2001 From: Mingli Yu Date: Sat, 12 Oct 2024 18:01:46 +0800 Subject: tomlplusplus: Add ptest support # ./run-ptest PASS: tomlplusplus_odr_test PASS: tomlplusplus_tests Signed-off-by: Mingli Yu Signed-off-by: Khem Raj --- meta-oe/recipes-devtools/tomlplusplus/files/run-ptest | 12 ++++++++++++ meta-oe/recipes-devtools/tomlplusplus/tomlplusplus_git.bb | 15 +++++++++++++-- 2 files changed, 25 insertions(+), 2 deletions(-) create mode 100755 meta-oe/recipes-devtools/tomlplusplus/files/run-ptest (limited to 'meta-oe/recipes-devtools/tomlplusplus') diff --git a/meta-oe/recipes-devtools/tomlplusplus/files/run-ptest b/meta-oe/recipes-devtools/tomlplusplus/files/run-ptest new file mode 100755 index 0000000000..4f682c5eb2 --- /dev/null +++ b/meta-oe/recipes-devtools/tomlplusplus/files/run-ptest @@ -0,0 +1,12 @@ +#!/bin/sh + +cd tests +for atest in tomlplusplus_* ; do + rm -rf tests.log + ./${atest} > tests.log 2>&1 + if [ $? = 0 ] ; then + echo "PASS: ${atest}" + else + echo "FAIL: ${atest}" + fi +done diff --git a/meta-oe/recipes-devtools/tomlplusplus/tomlplusplus_git.bb b/meta-oe/recipes-devtools/tomlplusplus/tomlplusplus_git.bb index 0e8202bdcc..245c309a2e 100644 --- a/meta-oe/recipes-devtools/tomlplusplus/tomlplusplus_git.bb +++ b/meta-oe/recipes-devtools/tomlplusplus/tomlplusplus_git.bb @@ -3,7 +3,9 @@ HOMEPAGE = "https://github.com/marzer/tomlplusplus" LICENSE = "MIT" LIC_FILES_CHKSUM = "file://LICENSE;md5=90960f22c10049c117d56ed2ee5ee167" -SRC_URI = "git://github.com/marzer/tomlplusplus.git;protocol=https;branch=master" +SRC_URI = "git://github.com/marzer/tomlplusplus.git;protocol=https;branch=master \ + file://run-ptest \ +" PV = "3.4.0" SRCREV = "30172438cee64926dc41fdd9c11fb3ba5b2ba9de" @@ -11,4 +13,13 @@ S = "${WORKDIR}/git" DEPENDS = "cmake-native" -inherit meson +inherit meson ptest + +EXTRA_OEMESON += "-Dbuild_tests=${@bb.utils.contains("DISTRO_FEATURES", "ptest", "true", "false", d)} \ +" + +do_install_ptest () { + install -d ${D}${PTEST_PATH}/tests + cp ${B}/tests/tomlplusplus_odr_test ${D}${PTEST_PATH}/tests + cp ${B}/tests/tomlplusplus_tests ${D}${PTEST_PATH}/tests +} -- cgit v1.2.3-54-g00ecf