m4: simplify path substitutions in ptest

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).

(From OE-Core rev: 4df67f54cc4f98b63e465fba3dc41ac9813a033e)

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Alexander Kanavin 2025-06-06 22:58:09 +02:00 committed by Richard Purdie
parent e65d0d156d
commit dfaff44d8a
2 changed files with 2 additions and 5 deletions

View 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() {

View 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=.