summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoss Burton <ross.burton@arm.com>2022-08-26 15:23:37 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-08-30 10:33:35 +0100
commitde284c467a99fa17b98531206b0dc51a4401de64 (patch)
treed097496d992eadf1ae7dfad12d85b03267ce9fbf
parentae0b0649aa6db8045995a6f323a2ad88bb17befa (diff)
downloadpoky-de284c467a99fa17b98531206b0dc51a4401de64.tar.gz
libgcrypt: rewrite ptest
Instead of installing pieces of the build system, we can install the test driver (which can also be used to list the files needed) and run the tests directly. (From OE-Core rev: 5e07e6c376cf46d2788dcef53e9feba890c0236d) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-support/libgcrypt/files/no-native-gpg-error.patch18
-rw-r--r--meta/recipes-support/libgcrypt/files/run-ptest8
-rw-r--r--meta/recipes-support/libgcrypt/libgcrypt_1.10.1.bb19
3 files changed, 29 insertions, 16 deletions
diff --git a/meta/recipes-support/libgcrypt/files/no-native-gpg-error.patch b/meta/recipes-support/libgcrypt/files/no-native-gpg-error.patch
new file mode 100644
index 0000000000..b9a607863d
--- /dev/null
+++ b/meta/recipes-support/libgcrypt/files/no-native-gpg-error.patch
@@ -0,0 +1,18 @@
1Don't depend on a native libgpg-error to build the test driver, as it's
2an optional dependency for some C annotations.
3
4Upstream-Status: Inappropriate
5Signed-off-by: Ross Burton <ross.burton@arm.com>
6
7diff --git a/tests/testdrv.c b/tests/testdrv.c
8index 0ccde326..6d6abd57 100644
9--- a/tests/testdrv.c
10+++ b/tests/testdrv.c
11@@ -32,7 +32,6 @@
12 # include <fcntl.h>
13 # include <sys/wait.h>
14 #endif
15-#include <gpg-error.h> /* For some macros. */
16
17 #include "stopwatch.h"
18
diff --git a/meta/recipes-support/libgcrypt/files/run-ptest b/meta/recipes-support/libgcrypt/files/run-ptest
index 4818a061b4..c349ae1944 100644
--- a/meta/recipes-support/libgcrypt/files/run-ptest
+++ b/meta/recipes-support/libgcrypt/files/run-ptest
@@ -1,3 +1,9 @@
1#!/bin/sh 1#!/bin/sh
2 2
3make -C build/tests runtest-TESTS 3# Run the tests in regression mode so they are quicker
4export GCRYPT_IN_REGRESSION_TEST=1
5# The 'random' test invokes itself, so we need to be sure that the test
6# directory is on PATH.
7export PATH=$PATH:.
8
9./testdrv --verbose
diff --git a/meta/recipes-support/libgcrypt/libgcrypt_1.10.1.bb b/meta/recipes-support/libgcrypt/libgcrypt_1.10.1.bb
index 5047c9075f..b0d88de3aa 100644
--- a/meta/recipes-support/libgcrypt/libgcrypt_1.10.1.bb
+++ b/meta/recipes-support/libgcrypt/libgcrypt_1.10.1.bb
@@ -17,13 +17,13 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
17 " 17 "
18 18
19DEPENDS = "libgpg-error" 19DEPENDS = "libgpg-error"
20RDEPENDS:${PN}-ptest = "bash make"
21 20
22UPSTREAM_CHECK_URI = "https://gnupg.org/download/index.html" 21UPSTREAM_CHECK_URI = "https://gnupg.org/download/index.html"
23SRC_URI = "${GNUPG_MIRROR}/libgcrypt/libgcrypt-${PV}.tar.bz2 \ 22SRC_URI = "${GNUPG_MIRROR}/libgcrypt/libgcrypt-${PV}.tar.bz2 \
24 file://0001-libgcrypt-fix-m4-file-for-oe-core.patch \ 23 file://0001-libgcrypt-fix-m4-file-for-oe-core.patch \
25 file://0002-libgcrypt-fix-building-error-with-O2-in-sysroot-path.patch \ 24 file://0002-libgcrypt-fix-building-error-with-O2-in-sysroot-path.patch \
26 file://0004-tests-Makefile.am-fix-undefined-reference-to-pthread.patch \ 25 file://0004-tests-Makefile.am-fix-undefined-reference-to-pthread.patch \
26 file://no-native-gpg-error.patch \
27 file://run-ptest \ 27 file://run-ptest \
28 " 28 "
29SRC_URI[sha256sum] = "ef14ae546b0084cd84259f61a55e07a38c3b53afc0f546bffcef2f01baffe9de" 29SRC_URI[sha256sum] = "ef14ae546b0084cd84259f61a55e07a38c3b53afc0f546bffcef2f01baffe9de"
@@ -38,8 +38,6 @@ inherit autotools texinfo binconfig-disabled pkgconfig ptest
38EXTRA_OECONF = "--disable-asm" 38EXTRA_OECONF = "--disable-asm"
39EXTRA_OEMAKE:class-target = "LIBTOOLFLAGS='--tag=CC'" 39EXTRA_OEMAKE:class-target = "LIBTOOLFLAGS='--tag=CC'"
40 40
41PRIVATE_LIBS:${PN}-ptest:append = " libgcrypt.so.20"
42
43PACKAGECONFIG ??= "capabilities" 41PACKAGECONFIG ??= "capabilities"
44PACKAGECONFIG[capabilities] = "--with-capabilities,--without-capabilities,libcap" 42PACKAGECONFIG[capabilities] = "--with-capabilities,--without-capabilities,libcap"
45 43
@@ -49,18 +47,9 @@ do_configure:prepend () {
49} 47}
50 48
51do_install_ptest() { 49do_install_ptest() {
52 cp -r --preserve=mode,links -v ${S} ${D}${PTEST_PATH} 50 cd tests
53 cp -r --preserve=mode,links -v ${B} ${D}${PTEST_PATH} 51 oe_runmake testdrv-build testdrv
54 rm ${D}${PTEST_PATH}/build/cipher/gost-s-box 52 install testdrv $(srcdir=${S}/tests ./testdrv-build --files | sort | uniq) ${D}${PTEST_PATH}
55 rm ${D}${PTEST_PATH}/build/doc/yat2m
56 rm ${D}${PTEST_PATH}/build/libtool
57 rm ${D}${PTEST_PATH}/build/config.status
58 rm ${D}${PTEST_PATH}/build/config.log
59 rm ${D}${PTEST_PATH}/build/src/mpicalc
60 rm ${D}${PTEST_PATH}/${BP}/autom4te* -rf
61 sed -i -e 's/Makefile:.*/Makefile-disabled:/' ${D}${PTEST_PATH}/build/Makefile
62 find ${D}/${PTEST_PATH}/build -name "*.cmake" -or -name "Makefile" \
63 | xargs sed -e "s|${WORKDIR}|${PTEST_PATH}|g" -e "s|${WORKDIR}/recipe-sysroot-native||g" -i
64} 53}
65 54
66FILES:${PN}-dev += "${bindir}/hmac256 ${bindir}/dumpsexp" 55FILES:${PN}-dev += "${bindir}/hmac256 ${bindir}/dumpsexp"