Skip to contentSkip to conversation

Don't rely on OE-Core patch for Automake test-driver path

PATCH Superseded [email protected] 1 participant 3 messages Nov 13, 2024

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover Don't rely on OE-Core patch for Automake test-driver path

From: Ola x Nilsson <[email protected]>

Relates to [YOCTO #15635]

ptests in rsyslog and librelp rely on the Automake patch "Set relative to top_builddir path in Makefile to access" which hopefully will be removed from OE-Core as it breaks non-ptest use of Automake.

This series fixes those two recipes so they do not rely on the patch, but still works with the patch.

Ola x Nilsson (2):
librelp: Fix the ptest path to test-driver
rsyslog: Fix the ptest path to test-driver

 .../rsyslog/librelp_1.11.0.bb                 | 18 ++++++++-------
 .../rsyslog/rsyslog_8.2408.0.bb               | 22 ++++++++++---------
 2 files changed, 22 insertions(+), 18 deletions(-)
#1 lore raw

PATCH 1/2 librelp: Fix the ptest path to test-driver

From: Ola x Nilsson <[email protected]>

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]

---
 .../recipes-extended/rsyslog/librelp_1.11.0.bb | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)
meta-oe/recipes-extended/rsyslog/librelp_1.11.0.bb +10 -8
index 49847047a..65b5c8476 100644
@@ -59,14 +59,16 @@ do_install_ptest() {
     # some tests need to write to this directory
     chmod 777 -R ${D}${PTEST_PATH}/${TESTDIR}
 
-    # do NOT need to rebuild Makefile or $(check_PROGRAMS)
-    sed -i 's/^Makefile:.*$/Makefile:/' ${D}${PTEST_PATH}/${TESTDIR}/Makefile
-    sed -i 's/^check-TESTS:.*$/check-TESTS:/' ${D}${PTEST_PATH}/${TESTDIR}/Makefile
-
-    # fix the srcdir, top_srcdir, abs_top_builddir
-    sed -i 's,^\(srcdir = \).*,\1${PTEST_PATH}/${TESTDIR},' ${D}${PTEST_PATH}/${TESTDIR}/Makefile
-    sed -i 's,^\(top_srcdir = \).*,\1${PTEST_PATH}/${TESTDIR},' ${D}${PTEST_PATH}/${TESTDIR}/Makefile
-    sed -i 's,^\(abs_top_builddir = \).*,\1${PTEST_PATH}/,' ${D}${PTEST_PATH}/${TESTDIR}/Makefile
+	sed -e '# do NOT need to rebuild Makefile or $(check_PROGRAMS)' \
+		-e 's/^Makefile:.*$/Makefile:/' \
+		-e 's/^check-TESTS:.*$/check-TESTS:/' \
+		-e '# fix the srcdir, top_srcdir, abs_top_builddir' \
+		-e 's,^\(srcdir = \).*,\1${PTEST_PATH}/${TESTDIR},' \
+		-e 's,^\(top_srcdir = \).*,\1${PTEST_PATH}/${TESTDIR},' \
+		-e 's,^\(abs_top_builddir = \).*,\1${PTEST_PATH}/,' \
+		-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 -m 644 ${S}/test-driver ${D}${PTEST_PATH}
#2 lore raw

PATCH 2/2 rsyslog: Fix the ptest path to test-driver

In reply to [email protected]

From: Ola x Nilsson <[email protected]>

Add a sed substitution for ${PTEST_PATH}/${TESTDIR}/Makefile that transforms
LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver SH_LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver
to
LOG_DRIVER = $(SHELL) $(top_builddir)/test-driver 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]

---
 .../rsyslog/rsyslog_8.2408.0.bb               | 22 ++++++++++---------
 1 file changed, 12 insertions(+), 10 deletions(-)
meta-oe/recipes-extended/rsyslog/rsyslog_8.2408.0.bb +12 -10
index cf833de22..7d151bb9d 100644
@@ -100,16 +100,18 @@ do_install_ptest() {
     # some tests need to write to this directory as user 'daemon'
     chmod 777 -R ${D}${PTEST_PATH}/tests
 
-    # do NOT need to rebuild Makefile itself
-    sed -i 's/^Makefile:.*$/Makefile:/' ${D}${PTEST_PATH}/${TESTDIR}/Makefile
-    # do NOT need to rebuild $(check_PROGRAMS)
-    sed -i 's/^check-TESTS:.*$/check-TESTS:/' ${D}${PTEST_PATH}/${TESTDIR}/Makefile
-
-    # fix the srcdir, top_srcdir
-    sed -i 's,^\(srcdir = \).*,\1${PTEST_PATH}/tests,' ${D}${PTEST_PATH}/${TESTDIR}/Makefile
-    sed -i 's,^\(top_srcdir = \).*,\1${PTEST_PATH}/tests,' ${D}${PTEST_PATH}/${TESTDIR}/Makefile
-    # fix the abs_top_builddir
-    sed -i 's,^\(abs_top_builddir = \).*,\1${PTEST_PATH}/,' ${D}${PTEST_PATH}/${TESTDIR}/Makefile
+	sed -e '# do NOT need to rebuild Makefile itself' \
+	    -e 's/^Makefile:.*$/Makefile:/' \
+	    -e '# do NOT need to rebuild $(check_PROGRAMS)' \
+	    -e 's/^check-TESTS:.*$/check-TESTS:/' \
+	    -e '# fix the srcdir, top_srcdir' \
+	    -e 's,^\(srcdir = \).*,\1${PTEST_PATH}/tests,' \
+	    -e 's,^\(top_srcdir = \).*,\1${PTEST_PATH}/tests,' \
+	    -e '# fix the abs_top_builddir' \
+	    -e 's,^\(abs_top_builddir = \).*,\1${PTEST_PATH}/,' \
+	    -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 -m 644 ${S}/test-driver ${D}${PTEST_PATH}