curl: rewrite ptest installation

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.

(From OE-Core rev: ace380501d3ef62a9e94e2bd4e880cbfaddac02c)

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Ross Burton
2024-06-12 11:06:59 +00:00
committed by Richard Purdie
parent 4574919d30
commit 38feae1adb
3 changed files with 26 additions and 57 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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 \