librelp: Fix the ptest path to test-driver

Add a sed substitution for ${PTEST_PATH}/${TESTDIR}/Makefile that
transforms
 SH_LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver
to
 SH_LOG_DRIVER = $(SHELL) $(top_builddir)/test-driver
which is where the test-driver script can be found when installed.

The addition of this substition makes ptests work with or without an
automake patch in OE-Core that does the same thing.

Relates to [YOCTO #15635]

Signed-off-by: Ola x Nilsson <olani@axis.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
This commit is contained in:
Ola x Nilsson
2024-11-13 15:25:21 +01:00
committed by Khem Raj
parent e7d0ab859d
commit 953a453038
@@ -59,14 +59,16 @@ do_install_ptest() {
# some tests need to write to this directory # some tests need to write to this directory
chmod 777 -R ${D}${PTEST_PATH}/${TESTDIR} chmod 777 -R ${D}${PTEST_PATH}/${TESTDIR}
# do NOT need to rebuild Makefile or $(check_PROGRAMS) sed -e '# do NOT need to rebuild Makefile or $(check_PROGRAMS)' \
sed -i 's/^Makefile:.*$/Makefile:/' ${D}${PTEST_PATH}/${TESTDIR}/Makefile -e 's/^Makefile:.*$/Makefile:/' \
sed -i 's/^check-TESTS:.*$/check-TESTS:/' ${D}${PTEST_PATH}/${TESTDIR}/Makefile -e 's/^check-TESTS:.*$/check-TESTS:/' \
-e '# fix the srcdir, top_srcdir, abs_top_builddir' \
# fix the srcdir, top_srcdir, abs_top_builddir -e 's,^\(srcdir = \).*,\1${PTEST_PATH}/${TESTDIR},' \
sed -i 's,^\(srcdir = \).*,\1${PTEST_PATH}/${TESTDIR},' ${D}${PTEST_PATH}/${TESTDIR}/Makefile -e 's,^\(top_srcdir = \).*,\1${PTEST_PATH}/${TESTDIR},' \
sed -i 's,^\(top_srcdir = \).*,\1${PTEST_PATH}/${TESTDIR},' ${D}${PTEST_PATH}/${TESTDIR}/Makefile -e 's,^\(abs_top_builddir = \).*,\1${PTEST_PATH}/,' \
sed -i 's,^\(abs_top_builddir = \).*,\1${PTEST_PATH}/,' ${D}${PTEST_PATH}/${TESTDIR}/Makefile -e '# fix the path to test-driver' \
-e '/^SH_LOG_DRIVER =/s/(top_srcdir)/(top_builddir)/' \
-i ${D}${PTEST_PATH}/${TESTDIR}/Makefile
# install test-driver # install test-driver
install -m 644 ${S}/test-driver ${D}${PTEST_PATH} install -m 644 ${S}/test-driver ${D}${PTEST_PATH}