diff mbox series

[2/2] curl: rewrite ptest installation

Message ID 20240612110659.2750133-2-ross.burton@arm.com
State New
Headers show
Series [1/2] scripts/makefile-getvar: add script to get values from Makefiles | expand

Commit Message

Ross Burton June 12, 2024, 11:06 a.m. UTC
The latest libtool upgrade appears to have resulted in intermediate files
containing build paths. This wouldn't normally be a problem but the
curl-ptest package is populated by copying ${B}/tests/ which includes all
of the intermediate objects, so this causes buildpath warnings.

Rewrite the ptest installation to install just the pieces we need: the
test harness, utility scripts, and the test data.  We do not need the
libcurl unit tests nor the HTTP server tests, as we don't run those.

Remove all of the explicitly disabled tests, as many of these were for
tests that run curl-config or scan the source code, neither of which are
available at ptest time.  Instead use keyword exclusions to skip them.

Tell the test runner to use the system curl instead of symlinking in the
binary.

Don't copy curl-config, skipping these minor tests is acceptable.

Remove the RDEPENDS on bash, nothing needs this now we're not shipping a
build tree.

Signed-off-by: Ross Burton <ross.burton@arm.com>
---
 meta/recipes-support/curl/curl/disable-tests | 42 --------------------
 meta/recipes-support/curl/curl/run-ptest     |  8 +++-
 meta/recipes-support/curl/curl_8.8.0.bb      | 33 ++++++++-------
 3 files changed, 26 insertions(+), 57 deletions(-)
diff mbox series

Patch

diff --git a/meta/recipes-support/curl/curl/disable-tests b/meta/recipes-support/curl/curl/disable-tests
index c4aa7783a17..e69de29bb2d 100644
--- a/meta/recipes-support/curl/curl/disable-tests
+++ b/meta/recipes-support/curl/curl/disable-tests
@@ -1,42 +0,0 @@ 
-# Intermittently fails e.g. https://autobuilder.yocto.io/pub/non-release/20231220-28/testresults/qemux86-64-ptest/curl.log
-# https://autobuilder.yocto.io/pub/non-release/20231220-27/testresults/qemux86-64-ptest/curl.log
-337
-# These CRL test (alt-avc) are failing
-356
-412
-413
-# These CRL tests are scanning docs
-971
-# Intermittently hangs e.g http://autobuilder.yocto.io/pub/non-release/20231228-18/testresults/qemux86-64-ptest/curl.log
-1091
-# Intermittently hangs e.g https://autobuilder.yocto.io/pub/non-release/20231220-27/testresults/qemux86-64-ptest/curl.log
-1096
-# These CRL tests are scanning docs
-1119
-1132
-1135
-1478
-# These CRL tests are scanning headers
-1167
-1477
-# These CRL tests are scanning man pages
-1139
-1140
-1173
-1177
-# This CRL test is looking for m4 files
-1165
-# This CRL test is looking for src files
-1185
-# This test is scanning the source tree
-1222
-# These CRL tests need --libcurl option to be enabled
-1279
-1400
-1401
-1402
-1403
-1404
-1405
-1465
-1481
diff --git a/meta/recipes-support/curl/curl/run-ptest b/meta/recipes-support/curl/curl/run-ptest
index 579b3f4587e..597cf92dbbd 100644
--- a/meta/recipes-support/curl/curl/run-ptest
+++ b/meta/recipes-support/curl/curl/run-ptest
@@ -10,4 +10,10 @@  cd tests
 
 # Don't run the flaky or timing dependent tests
 # Until https://github.com/curl/curl/issues/13350 is resolved, don't run FTP tests
-./runtests.pl -a -n -am -j4 -p !flaky !timing-dependent !FTP
+# We don't enable --libcurl
+# Don't assume curl-config exists
+# We don't have the source tree
+./runtests.pl \
+    -a -c curl -vc curl -n -am -j4 -p \
+    !flaky !timing-dependent !FTP \
+    !--libcurl !curl-config !source\ analysis !checksrc !documentation
diff --git a/meta/recipes-support/curl/curl_8.8.0.bb b/meta/recipes-support/curl/curl_8.8.0.bb
index b9325941595..2b058e4e82d 100644
--- a/meta/recipes-support/curl/curl_8.8.0.bb
+++ b/meta/recipes-support/curl/curl_8.8.0.bb
@@ -101,23 +101,28 @@  do_compile_ptest() {
 }
 
 do_install_ptest() {
-	cat  ${UNPACKDIR}/disable-tests >> ${S}/tests/data/DISABLED
-	rm -f ${B}/tests/configurehelp.pm
-	cp -rf ${B}/tests ${D}${PTEST_PATH}
-        rm -f ${D}${PTEST_PATH}/tests/libtest/.libs/libhostname.la
-        rm -f ${D}${PTEST_PATH}/tests/libtest/libhostname.la
-        mv ${D}${PTEST_PATH}/tests/libtest/.libs/* ${D}${PTEST_PATH}/tests/libtest/
-        mv ${D}${PTEST_PATH}/tests/libtest/libhostname.so ${D}${PTEST_PATH}/tests/libtest/.libs/
-        mv ${D}${PTEST_PATH}/tests/http/clients/.libs/* ${D}${PTEST_PATH}/tests/http/clients/
-	cp -rf ${S}/tests ${D}${PTEST_PATH}
-	find ${D}${PTEST_PATH}/ -type f -name Makefile.am -o -name Makefile.in -o -name Makefile -delete
-	install -d ${D}${PTEST_PATH}/src
-	ln -sf ${bindir}/curl   ${D}${PTEST_PATH}/src/curl
-	cp -rf ${D}${bindir}/curl-config ${D}${PTEST_PATH}
+	install -d ${D}${PTEST_PATH}/tests
+	cp ${S}/tests/*.p[lmy] ${D}${PTEST_PATH}/tests/
+
+	install -d ${D}${PTEST_PATH}/tests/libtest
+	for name in $(makefile-getvar ${B}/tests/libtest/Makefile noinst_PROGRAMS noinst_LTLIBRARIES); do
+		${B}/libtool --mode=install install ${B}/tests/libtest/$name ${D}${PTEST_PATH}/tests/libtest
+	done
+	cp ${S}/tests/libtest/notexists.pl ${D}${PTEST_PATH}/tests/libtest
+	rm -f ${D}${PTEST_PATH}/tests/libtest/libhostname.la
+
+	install -d ${D}${PTEST_PATH}/tests/server
+	for name in $(makefile-getvar ${B}/tests/server/Makefile noinst_PROGRAMS); do
+		${B}/libtool --mode=install install ${B}/tests/server/$name ${D}${PTEST_PATH}/tests/server
+	done
+
+	cp -r ${S}/tests/data ${D}${PTEST_PATH}/tests/
+
+	# More tests that we disable for automated QA as they're not reliable
+	cat ${UNPACKDIR}/disable-tests >>${D}${PTEST_PATH}/tests/data/DISABLED
 }
 
 RDEPENDS:${PN}-ptest += " \
-	bash \
 	locale-base-en-us \
 	perl-module-b \
 	perl-module-base \