]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
libgcrypt: Add ptest
authorSimone Weiss <simone.weiss@elektrobit.com>
Wed, 4 May 2022 12:25:15 +0000 (14:25 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 5 May 2022 20:17:12 +0000 (21:17 +0100)
Add a ptest for libgcript to core-image-ptest-all. All tests passed on a trial
run.

Signed-off-by: Simone Weiss <simone.weiss@elektrobit.com>
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/conf/distro/include/ptest-packagelists.inc
meta/recipes-support/libgcrypt/files/run-ptest [new file with mode: 0644]
meta/recipes-support/libgcrypt/libgcrypt_1.10.1.bb

index 54a290871e8d1f4cc1f19407dad1b08df21b0229..a1ead906493e905fd0b853625bf8823116a96f24 100644 (file)
@@ -87,6 +87,7 @@ PTESTS_SLOW = "\
     glib-2.0-ptest \
     gstreamer1.0-ptest \
     libevent-ptest \
+    libgcrypt-ptest \
     lttng-tools-ptest \
     openssh-ptest \
     openssl-ptest \
diff --git a/meta/recipes-support/libgcrypt/files/run-ptest b/meta/recipes-support/libgcrypt/files/run-ptest
new file mode 100644 (file)
index 0000000..4818a06
--- /dev/null
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+make -C build/tests runtest-TESTS
index 251e0d0348abba59acb57e3e78db52d0007b19d7..aa83de226d13fa44f8e32eb2b1355c45205cd97d 100644 (file)
@@ -18,6 +18,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
                     "
 
 DEPENDS = "libgpg-error"
+RDEPENDS:${PN}-ptest = "bash"
 
 UPSTREAM_CHECK_URI = "https://gnupg.org/download/index.html"
 SRC_URI = "${GNUPG_MIRROR}/libgcrypt/libgcrypt-${PV}.tar.bz2 \
@@ -25,6 +26,7 @@ SRC_URI = "${GNUPG_MIRROR}/libgcrypt/libgcrypt-${PV}.tar.bz2 \
            file://0003-tests-bench-slope.c-workaround-ICE-failure-on-mips-w.patch \
            file://0002-libgcrypt-fix-building-error-with-O2-in-sysroot-path.patch \
            file://0004-tests-Makefile.am-fix-undefined-reference-to-pthread.patch \
+           file://run-ptest \
            "
 SRC_URI[sha256sum] = "ef14ae546b0084cd84259f61a55e07a38c3b53afc0f546bffcef2f01baffe9de"
 
@@ -33,11 +35,13 @@ CVE_CHECK_IGNORE += "CVE-2018-12433 CVE-2018-12438"
 
 BINCONFIG = "${bindir}/libgcrypt-config"
 
-inherit autotools texinfo binconfig-disabled pkgconfig
+inherit autotools texinfo binconfig-disabled pkgconfig ptest
 
 EXTRA_OECONF = "--disable-asm"
 EXTRA_OEMAKE:class-target = "LIBTOOLFLAGS='--tag=CC'"
 
+PRIVATE_LIBS:${PN}-ptest:append = " libgcrypt.so.20"
+
 PACKAGECONFIG ??= "capabilities"
 PACKAGECONFIG[capabilities] = "--with-capabilities,--without-capabilities,libcap"
 
@@ -52,6 +56,15 @@ do_install:append() {
        install -m 0644 ${B}/src/libgcrypt.pc ${D}/${libdir}/pkgconfig/
 }
 
+do_install_ptest() {
+    cp -r --preserve=mode,links -v ${S} ${D}${PTEST_PATH}
+    cp -r --preserve=mode,links -v ${B} ${D}${PTEST_PATH}
+    rm ${D}${PTEST_PATH}/build/cipher/gost-s-box
+    rm ${D}${PTEST_PATH}/build/doc/yat2m
+    find ${D}/${PTEST_PATH}/build -name "*.cmake" -or -name "Makefile" \
+    | xargs sed -e "s|${WORKDIR}|${PTEST_PATH}|g" -e "s|${WORKDIR}/recipe-sysroot-native||g" -i
+}
+
 PACKAGES =+ "dumpsexp-dev"
 
 FILES:${PN}-dev += "${bindir}/hmac256"