From 4df67f54cc4f98b63e465fba3dc41ac9813a033e Mon Sep 17 00:00:00 2001 From: Alexander Kanavin Date: Fri, 6 Jun 2025 22:58:09 +0200 Subject: [PATCH] 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). Signed-off-by: Alexander Kanavin Signed-off-by: Richard Purdie --- 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 --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=. -- 2.47.3