From 50544ce18c26099edb54c9ccf23f5095bfe652e9 Mon Sep 17 00:00:00 2001 From: Mingli Yu Date: Mon, 23 Dec 2024 19:39:47 +0800 Subject: asio: Add ptest support # ./run-ptest PASS: address PASS: address_v4 PASS: address_v4_iterator PASS: address_v4_range PASS: address_v6 PASS: address_v6_iterator PASS: address_v6_range PASS: any_completion_executor PASS: any_completion_handler PASS: any_executor PASS: any_io_executor PASS: append PASS: as_tuple PASS: associated_allocator PASS: associated_cancellation_slot PASS: associated_executor PASS: associated_immediate_executor PASS: associator PASS: async_result [snip] Signed-off-by: Mingli Yu Signed-off-by: Khem Raj (master rev: 1274b0df3c126e72dcbfd4678d1c25aadb8607dc) * remove duplicated SRC_URI * refresh 0001-tests-Remove-blocking_adaptation.cpp.patch Signed-off-by: Changqing Li Signed-off-by: Armin Kuster --- ...0001-tests-Remove-blocking_adaptation.cpp.patch | 45 ++++++++++++++++++++++ meta-oe/recipes-support/asio/asio/run-ptest | 19 +++++++++ meta-oe/recipes-support/asio/asio_1.20.0.bb | 21 ++++++++-- 3 files changed, 81 insertions(+), 4 deletions(-) create mode 100644 meta-oe/recipes-support/asio/asio/0001-tests-Remove-blocking_adaptation.cpp.patch create mode 100644 meta-oe/recipes-support/asio/asio/run-ptest diff --git a/meta-oe/recipes-support/asio/asio/0001-tests-Remove-blocking_adaptation.cpp.patch b/meta-oe/recipes-support/asio/asio/0001-tests-Remove-blocking_adaptation.cpp.patch new file mode 100644 index 0000000000..1de0edc05c --- /dev/null +++ b/meta-oe/recipes-support/asio/asio/0001-tests-Remove-blocking_adaptation.cpp.patch @@ -0,0 +1,45 @@ +From 3200dd761894f04f559c3a60b67178a9d40bf34c Mon Sep 17 00:00:00 2001 +From: Mingli Yu +Date: Thu, 10 Oct 2024 13:58:38 +0800 +Subject: [PATCH] tests: Remove blocking_adaptation.cpp + +The test failed to build with clang as below. +../../../asio-1.30.2/src/tests/../../include/asio/execution/blocking_adaptation.hpp:216:13: error: call to 'query' is ambiguous + 216 | conditional_t::query(static_cast(p)) + | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +../../../asio-1.30.2/src/tests/../../include/asio/execution/blocking_adaptation.hpp:213:29: note: in instantiation of exception specification for 'query>' requested here + 213 | static constexpr auto query(P&& p) + | + +We can add the case back once the above build failure resolved then. + +Upstream-Status: Pending + +Signed-off-by: Mingli Yu +--- + src/tests/Makefile.am | 2 -- + 1 file changed, 2 deletions(-) + +diff --git a/src/tests/Makefile.am b/src/tests/Makefile.am +index 7161698..25f3b08 100644 +--- a/src/tests/Makefile.am ++++ b/src/tests/Makefile.am +@@ -51,7 +51,6 @@ check_PROGRAMS = \ + unit/error \ + unit/execution/any_executor \ + unit/execution/blocking \ +- unit/execution/blocking_adaptation \ + unit/execution/bulk_execute \ + unit/execution/bulk_guarantee \ + unit/execution/connect \ +@@ -244,7 +243,6 @@ TESTS = \ + unit/error \ + unit/execution/any_executor \ + unit/execution/blocking \ +- unit/execution/blocking_adaptation \ + unit/execution/bulk_execute \ + unit/execution/bulk_guarantee \ + unit/execution/connect \ +-- +2.25.1 + diff --git a/meta-oe/recipes-support/asio/asio/run-ptest b/meta-oe/recipes-support/asio/asio/run-ptest new file mode 100644 index 0000000000..d37db0b315 --- /dev/null +++ b/meta-oe/recipes-support/asio/asio/run-ptest @@ -0,0 +1,19 @@ +#!/bin/sh + +ptestdir=$(dirname "$(readlink -f "$0")") +cd "$ptestdir"/tests || exit + +tests=$(find * -type f -executable) + +rm -rf test.log + +for f in $tests +do + if test -x ./"$f"; then + if ./"$f" > test.log 2>&1; then + echo "PASS: $f" + else + echo "FAIL: $f" + fi + fi +done diff --git a/meta-oe/recipes-support/asio/asio_1.20.0.bb b/meta-oe/recipes-support/asio/asio_1.20.0.bb index cedcf9fee0..5e7a6e2495 100644 --- a/meta-oe/recipes-support/asio/asio_1.20.0.bb +++ b/meta-oe/recipes-support/asio/asio_1.20.0.bb @@ -9,9 +9,12 @@ LICENSE = "BSL-1.0" DEPENDS = "openssl" -SRC_URI = "${SOURCEFORGE_MIRROR}/asio/${BP}.tar.bz2" +SRC_URI = "${SOURCEFORGE_MIRROR}/asio/${BP}.tar.bz2 \ + file://0001-tests-Remove-blocking_adaptation.cpp.patch \ + file://run-ptest \ +" -inherit autotools +inherit autotools ptest ALLOW_EMPTY:${PN} = "1" @@ -19,10 +22,20 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=416f4cc4f79551b690babb14ef1a5799" SRC_URI[sha256sum] = "204374d3cadff1b57a63f4c343cbadcee28374c072dc04b549d772dbba9f650c" -SRC_URI = "${SOURCEFORGE_MIRROR}/asio/${BP}.tar.bz2" - PACKAGECONFIG ??= "boost" PACKAGECONFIG[boost] = "--with-boost=${STAGING_LIBDIR},--without-boost,boost" +TESTDIR = "src/tests" +do_compile_ptest() { + echo 'buildtest-TESTS: $(check_PROGRAMS)' >> ${TESTDIR}/Makefile + oe_runmake -C ${TESTDIR} buildtest-TESTS +} + +do_install_ptest() { + install -d ${D}${PTEST_PATH}/tests + # copy executables + find ${B}/${TESTDIR}/unit -type f -executable -exec cp {} ${D}${PTEST_PATH}/tests/ \; +} + BBCLASSEXTEND = "native nativesdk" -- cgit v1.2.3-54-g00ecf