diff mbox series

[5/5] m4: simplify path substitutions in ptest

Message ID 20250606205809.4071299-5-alex.kanavin@gmail.com
State New
Headers show
Series [1/5] kea: correctly eliminate build host paths from installed file | expand

Commit Message

Alexander Kanavin June 6, 2025, 8:58 p.m. UTC
From: Alexander Kanavin <alex@linutronix.de>

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>
---
 meta/recipes-devtools/m4/m4-1.4.20.inc | 5 +----
 meta/recipes-devtools/m4/m4/run-ptest  | 2 +-
 2 files changed, 2 insertions(+), 5 deletions(-)
diff mbox series

Patch

diff --git a/meta/recipes-devtools/m4/m4-1.4.20.inc b/meta/recipes-devtools/m4/m4-1.4.20.inc
index a31335f173e..aad57b8b649 100644
--- a/meta/recipes-devtools/m4/m4-1.4.20.inc
+++ b/meta/recipes-devtools/m4/m4-1.4.20.inc
@@ -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() {
diff --git a/meta/recipes-devtools/m4/m4/run-ptest b/meta/recipes-devtools/m4/m4/run-ptest
index a91c372e541..da786e26f43 100644
--- a/meta/recipes-devtools/m4/m4/run-ptest
+++ b/meta/recipes-devtools/m4/m4/run-ptest
@@ -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=.