]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
m4: simplify path substitutions in ptest
authorAlexander Kanavin <alex@linutronix.de>
Fri, 6 Jun 2025 20:58:09 +0000 (22:58 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 9 Jun 2025 16:43:20 +0000 (17:43 +0100)
There's no need to setup a fake 'source directory' and
redirect the tests to it; rather it's possible to point
them directly to ptest directory (this needs to be done
twice, in Makefile substitutions, and as a C define during
ptest compilation).

This also eliminates the assumption that S and B are in the
same directory (no longer true when S is in UNPACKDIR).

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-devtools/m4/m4-1.4.20.inc
meta/recipes-devtools/m4/m4/run-ptest

index a31335f173e3c3955173eebc6db9bb3a62ec401d..aad57b8b6498138c285688f18b1c26d01e81d94d 100644 (file)
@@ -27,7 +27,7 @@ EXTRA_OEMAKE += "'infodir=${infodir}'"
 do_compile_ptest() {
        cd ${B}/tests
        sed -i '/^buildtest-TESTS: /c buildtest-TESTS: $(TESTS) $(check_LIBRARIES) $(check_PROGRAMS)' Makefile
-       oe_runmake buildtest-TESTS
+       oe_runmake CPPFLAGS="-DSRCDIR=\\\"${PTEST_PATH}/tests/\\\"" buildtest-TESTS
 }
 
 do_install_ptest() {
@@ -39,9 +39,6 @@ do_install_ptest() {
                 chmod 0755 ${D}${PTEST_PATH}/tests/test-spawn-pipe-main \
                      ${D}${PTEST_PATH}/tests/test-spawn-pipe-child ${D}${PTEST_PATH}/tests/test-version-etc \
                      ${D}${PTEST_PATH}/tests/test-xalloc-die
-
-                ln -sf ptest ${D}${libdir}/${BPN}/${BP}
-                sed -i -e 's/@BP@/${BP}/g' ${D}${PTEST_PATH}/run-ptest
 }
 
 do_install_ptest:append:libc-glibc() {
index a91c372e5413685d4eee0b8dd5d2793b47010af4..da786e26f4377d8b8584c7b7167128aff80ecf9c 100644 (file)
@@ -2,4 +2,4 @@
 #
 #This script is used to run m4 test suites
 cd tests 
-make -k runtest-TESTS abs_aux_dir=../../@BP@/tests/build-aux abs_top_srcdir=../../@BP@/tests abs_srcdir=../../@BP@/tests top_srcdir=.. srcdir=.
+make -k runtest-TESTS abs_aux_dir=./build-aux abs_top_srcdir=. abs_srcdir=. top_srcdir=.. srcdir=.