diff options
Diffstat (limited to 'meta-networking')
-rw-r--r-- | meta-networking/recipes-connectivity/mbedtls/mbedtls/run-ptest | 17 | ||||
-rw-r--r-- | meta-networking/recipes-connectivity/mbedtls/mbedtls_2.28.2.bb | 18 |
2 files changed, 31 insertions, 4 deletions
diff --git a/meta-networking/recipes-connectivity/mbedtls/mbedtls/run-ptest b/meta-networking/recipes-connectivity/mbedtls/mbedtls/run-ptest new file mode 100644 index 0000000000..059ab4ecbb --- /dev/null +++ b/meta-networking/recipes-connectivity/mbedtls/mbedtls/run-ptest | |||
@@ -0,0 +1,17 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | ptestdir=$(dirname "$(readlink -f "$0")") | ||
4 | cd "$ptestdir"/tests || exit | ||
5 | |||
6 | tests=$(find * -type f -name 'test_suite_*') | ||
7 | |||
8 | for f in $tests | ||
9 | do | ||
10 | if test -x ./"$f"; then | ||
11 | if ./"$f" > ./"$f".out 2> ./"$f".err; then | ||
12 | echo "PASS: $f" | ||
13 | else | ||
14 | echo "FAIL: $f" | ||
15 | fi | ||
16 | fi | ||
17 | done | ||
diff --git a/meta-networking/recipes-connectivity/mbedtls/mbedtls_2.28.2.bb b/meta-networking/recipes-connectivity/mbedtls/mbedtls_2.28.2.bb index e19587ca01..242495e941 100644 --- a/meta-networking/recipes-connectivity/mbedtls/mbedtls_2.28.2.bb +++ b/meta-networking/recipes-connectivity/mbedtls/mbedtls_2.28.2.bb | |||
@@ -24,19 +24,22 @@ SECTION = "libs" | |||
24 | 24 | ||
25 | S = "${WORKDIR}/git" | 25 | S = "${WORKDIR}/git" |
26 | SRCREV = "89f040a5c938985c5f30728baed21e49d0846a53" | 26 | SRCREV = "89f040a5c938985c5f30728baed21e49d0846a53" |
27 | SRC_URI = "git://github.com/ARMmbed/mbedtls.git;protocol=https;branch=mbedtls-2.28" | 27 | SRC_URI = "git://github.com/ARMmbed/mbedtls.git;protocol=https;branch=mbedtls-2.28 \ |
28 | file://run-ptest \ | ||
29 | " | ||
28 | 30 | ||
29 | inherit cmake update-alternatives | 31 | inherit cmake update-alternatives ptest |
30 | 32 | ||
31 | PACKAGECONFIG ??= "shared-libs programs" | 33 | PACKAGECONFIG ??= "shared-libs programs ${@bb.utils.contains('PTEST_ENABLED', '1', 'tests', '', d)}" |
32 | PACKAGECONFIG[shared-libs] = "-DUSE_SHARED_MBEDTLS_LIBRARY=ON,-DUSE_SHARED_MBEDTLS_LIBRARY=OFF" | 34 | PACKAGECONFIG[shared-libs] = "-DUSE_SHARED_MBEDTLS_LIBRARY=ON,-DUSE_SHARED_MBEDTLS_LIBRARY=OFF" |
33 | PACKAGECONFIG[programs] = "-DENABLE_PROGRAMS=ON,-DENABLE_PROGRAMS=OFF" | 35 | PACKAGECONFIG[programs] = "-DENABLE_PROGRAMS=ON,-DENABLE_PROGRAMS=OFF" |
34 | PACKAGECONFIG[werror] = "-DMBEDTLS_FATAL_WARNINGS=ON,-DMBEDTLS_FATAL_WARNINGS=OFF" | 36 | PACKAGECONFIG[werror] = "-DMBEDTLS_FATAL_WARNINGS=ON,-DMBEDTLS_FATAL_WARNINGS=OFF" |
35 | # Make X.509 and TLS calls use PSA | 37 | # Make X.509 and TLS calls use PSA |
36 | # https://github.com/Mbed-TLS/mbedtls/blob/development/docs/use-psa-crypto.md | 38 | # https://github.com/Mbed-TLS/mbedtls/blob/development/docs/use-psa-crypto.md |
37 | PACKAGECONFIG[psa] = "" | 39 | PACKAGECONFIG[psa] = "" |
40 | PACKAGECONFIG[tests] = "-DENABLE_TESTING=ON,-DENABLE_TESTING=OFF" | ||
38 | 41 | ||
39 | EXTRA_OECMAKE = "-DENABLE_TESTING=OFF -DLIB_INSTALL_DIR:STRING=${libdir}" | 42 | EXTRA_OECMAKE = "-DLIB_INSTALL_DIR:STRING=${libdir}" |
40 | 43 | ||
41 | # For now the only way to enable PSA is to explicitly pass a -D via CFLAGS | 44 | # For now the only way to enable PSA is to explicitly pass a -D via CFLAGS |
42 | CFLAGS:append = "${@bb.utils.contains('PACKAGECONFIG', 'psa', ' -DMBEDTLS_USE_PSA_CRYPTO', '', d)}" | 45 | CFLAGS:append = "${@bb.utils.contains('PACKAGECONFIG', 'psa', ' -DMBEDTLS_USE_PSA_CRYPTO', '', d)}" |
@@ -64,3 +67,10 @@ sysroot_stage_all:append() { | |||
64 | sysroot_stage_dir "${S}/library" "${SYSROOT_DESTDIR}/usr/share/mbedtls-source/library" | 67 | sysroot_stage_dir "${S}/library" "${SYSROOT_DESTDIR}/usr/share/mbedtls-source/library" |
65 | sysroot_stage_dir "${S}/include" "${SYSROOT_DESTDIR}/usr/share/mbedtls-source/include" | 68 | sysroot_stage_dir "${S}/include" "${SYSROOT_DESTDIR}/usr/share/mbedtls-source/include" |
66 | } | 69 | } |
70 | |||
71 | do_install_ptest () { | ||
72 | install -d ${D}${PTEST_PATH}/tests | ||
73 | cp -f ${B}/tests/test_suite_* ${D}${PTEST_PATH}/tests/ | ||
74 | find ${D}${PTEST_PATH}/tests/ -type f -name "*.c" -delete | ||
75 | cp -fR ${S}/tests/data_files ${D}${PTEST_PATH}/tests/ | ||
76 | } | ||