From: Ross Burton Date: Thu, 18 Dec 2025 17:42:47 +0000 (+0000) Subject: libexif: rewrite ptest handling X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ea08cb177394d51c28dd13de8b84172d91fa044a;p=thirdparty%2Fopenembedded%2Fopenembedded-core.git libexif: rewrite ptest handling What started as replacing the installation of libtool wrapper scripts ended up being a rewrite of the ptest integration. There are only ~15 tests so we can install the binaries with libtool, extract the test names from the Makefile, and just run them with a few lines of shell. Signed-off-by: Ross Burton Signed-off-by: Mathieu Dubois-Briand Signed-off-by: Richard Purdie --- diff --git a/meta/recipes-support/libexif/libexif/run-ptest b/meta/recipes-support/libexif/libexif/run-ptest index 2d23159eb03..6a50f64822a 100644 --- a/meta/recipes-support/libexif/libexif/run-ptest +++ b/meta/recipes-support/libexif/libexif/run-ptest @@ -1,3 +1,33 @@ -#!/bin/sh +#! /bin/sh -make -o Makefile runtest-TESTS +all=0 +passed=0 +failed=0 +skipped=0 + +for t in @TESTS@; do + "./$t" + case "$?" in + 0) + echo "PASS: $t" + passed=$((passed + 1)) + ;; + 77) + echo "SKIP: $t" + skipped=$((skipped + 1)) + ;; + *) + echo "FAIL: $t" + failed=$((failed + 1)) + ;; + esac + all=$((all + 1)) +done + +if [ "$failed" -eq 0 ]; then + echo "All $all tests passed ($skipped skipped)" + exit 0 +else + echo "$failed of $all tests failed ($skipped skipped)" + exit 1 +fi diff --git a/meta/recipes-support/libexif/libexif_0.6.25.bb b/meta/recipes-support/libexif/libexif_0.6.25.bb index 59c22753d04..c57855303f4 100644 --- a/meta/recipes-support/libexif/libexif_0.6.25.bb +++ b/meta/recipes-support/libexif/libexif_0.6.25.bb @@ -23,25 +23,16 @@ do_compile_ptest() { } do_install_ptest() { - install ${B}/test/test*[!\.o] ${D}${PTEST_PATH} - for f in ${D}${PTEST_PATH}/test*; do - sed -i "s/\(LD_LIBRARY_PATH=\).*\(:\$LD_LIBRARY_PATH\)\"/\1.\2/" $f - done - - install ${B}/test/Makefile ${D}${PTEST_PATH} - sed -i -e "/^srcdir/c srcdir = \$\{PWD\}" ${D}${PTEST_PATH}/Makefile - - install -d ${D}${PTEST_PATH}/nls - install ${B}/test/nls/*[!\.o] ${D}${PTEST_PATH}/nls - install -d ${D}${PTEST_PATH}/.libs - install ${B}/test/.libs/* ${D}${PTEST_PATH}/.libs - install ${S}/test/*.sh ${D}${PTEST_PATH} + for file in $(find ${B}/test/test-* -executable -type f); do + ${B}/libtool --mode=install install $file ${D}/${PTEST_PATH} + done + install -d ${D}${PTEST_PATH}/testdata install ${S}/test/testdata/* ${D}${PTEST_PATH}/testdata -} -RDEPENDS:${PN}-ptest += "make bash" + sed -i -e "s/@TESTS@/$(makefile-getvar ${B}/test/Makefile TESTS)/" ${D}${PTEST_PATH}/run-ptest +} BBCLASSEXTEND = "native nativesdk"