[OE-core] [PATCH v3] curl: add ptest

Maxin B. John maxin.john at intel.com
Thu Jul 6 11:24:02 UTC 2017


Add ptest support to curl

Fixes [YOCTO #6707]

Signed-off-by: Maxin B. John <maxin.john at intel.com>
---
 meta/recipes-support/curl/curl/run-ptest |  6 ++++++
 meta/recipes-support/curl/curl_7.54.1.bb | 22 +++++++++++++++++++++-
 2 files changed, 27 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-support/curl/curl/run-ptest

diff --git a/meta/recipes-support/curl/curl/run-ptest b/meta/recipes-support/curl/curl/run-ptest
new file mode 100644
index 0000000..614e822
--- /dev/null
+++ b/meta/recipes-support/curl/curl/run-ptest
@@ -0,0 +1,6 @@
+#!/bin/sh
+cd tests
+./runtests.pl -a -n -s | sed \
+     -e 's|\([^ ]* *\) \([^ ]* *\)...OK|PASS: \1 \2|' \
+     -e 's|\([^ ]* *\) \([^ ]* *\)...FAILED|FAIL: \1 \2|' \
+     -e 's/Warning: test[0-9]\+ not present in tests\/data\/Makefile.inc//'
diff --git a/meta/recipes-support/curl/curl_7.54.1.bb b/meta/recipes-support/curl/curl_7.54.1.bb
index f42582a..3622022 100644
--- a/meta/recipes-support/curl/curl_7.54.1.bb
+++ b/meta/recipes-support/curl/curl_7.54.1.bb
@@ -7,6 +7,7 @@ LIC_FILES_CHKSUM = "file://COPYING;beginline=8;md5=3a34942f4ae3fbf1a303160714e66
 
 SRC_URI = "http://curl.haxx.se/download/curl-${PV}.tar.bz2 \
            file://0001-replace-krb5-config-with-pkg-config.patch \
+           file://run-ptest \
 "
 
 # curl likes to set -g0 in CFLAGS, so we stop it
@@ -18,7 +19,7 @@ SRC_URI[md5sum] = "6b6eb722f512e7a24855ff084f54fe55"
 SRC_URI[sha256sum] = "fdfc4df2d001ee0c44ec071186e770046249263c491fcae48df0e1a3ca8f25a0"
 
 CVE_PRODUCT = "libcurl"
-inherit autotools pkgconfig binconfig multilib_header
+inherit autotools pkgconfig binconfig multilib_header ptest
 
 PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)} gnutls proxy zlib"
 PACKAGECONFIG_class-native = "ipv6 proxy ssl zlib"
@@ -62,6 +63,25 @@ do_install_append_class-target() {
 	sed -i -e 's,${STAGING_DIR_HOST},,g' ${D}${bindir}/curl-config
 }
 
+do_compile_ptest() {
+	oe_runmake test
+	oe_runmake -C ${B}/tests/data/ show
+	oe_runmake -C ${B}/tests/server
+}
+
+do_install_ptest() {
+	cp -rf ${B}/tests ${D}${PTEST_PATH}
+	cp -rf ${S}/tests ${D}${PTEST_PATH}
+	install -d ${D}${PTEST_PATH}/src
+	ln -sf ${bindir}/curl   ${D}${PTEST_PATH}/src/curl
+}
+
+RDEPENDS_${PN}-ptest += "make bash perl perl-module-cwd \
+                         perl-module-ipc-open2 perl-module-digest-md5\
+                         perl-module-file-basename perl-module-posix \
+                         perl-module-errno python python-netserver \
+                         python-argparse python-pprint diffutils"
+
 PACKAGES =+ "lib${BPN}"
 
 FILES_lib${BPN} = "${libdir}/lib*.so.*"
-- 
2.4.0



More information about the Openembedded-core mailing list