From 21728b623cfc55fe22740f1cc42ed043ed5a277c Mon Sep 17 00:00:00 2001 From: Yi Zhao Date: Sat, 10 Jan 2026 21:38:08 +0800 Subject: [PATCH] nanomsg: add ptest Ptest results: $ run-ptest PASS: async_shutdown PASS: block PASS: bug328 PASS: bug777 PASS: bus PASS: cmsg PASS: device PASS: device4 PASS: device5 PASS: device6 PASS: device7 PASS: domain PASS: emfile PASS: hash PASS: inproc PASS: inproc_shutdown PASS: iovec PASS: ipc PASS: ipc_shutdown PASS: ipc_stress PASS: list PASS: msg PASS: pair PASS: pipeline PASS: poll PASS: prio PASS: pubsub PASS: reqrep PASS: reqttl PASS: separation PASS: shutdown PASS: stats PASS: survey PASS: surveyttl PASS: symbol PASS: tcp PASS: tcp_shutdown PASS: term PASS: timeo PASS: trie PASS: ws PASS: ws_async_shutdown PASS: zerocopy Signed-off-by: Yi Zhao Signed-off-by: Khem Raj --- .../nanomsg/nanomsg/run-ptest | 16 ++++++++++++++++ .../nanomsg/nanomsg_1.2.2.bb | 17 +++++++++++++++-- 2 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 meta-networking/recipes-connectivity/nanomsg/nanomsg/run-ptest diff --git a/meta-networking/recipes-connectivity/nanomsg/nanomsg/run-ptest b/meta-networking/recipes-connectivity/nanomsg/nanomsg/run-ptest new file mode 100644 index 0000000000..447867aedb --- /dev/null +++ b/meta-networking/recipes-connectivity/nanomsg/nanomsg/run-ptest @@ -0,0 +1,16 @@ +#!/bin/sh + +RET=0 +cd tests + +for t in $(ls *); do + ./$t + if [ $? -eq 0 ]; then + echo PASS: $t + else + echo FAIL: $t + RET=1 + fi +done + +exit $RET diff --git a/meta-networking/recipes-connectivity/nanomsg/nanomsg_1.2.2.bb b/meta-networking/recipes-connectivity/nanomsg/nanomsg_1.2.2.bb index 10ae7a61d7..f291326c80 100644 --- a/meta-networking/recipes-connectivity/nanomsg/nanomsg_1.2.2.bb +++ b/meta-networking/recipes-connectivity/nanomsg/nanomsg_1.2.2.bb @@ -10,19 +10,32 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=587b3fd7fd291e418ff4d2b8f3904755" SECTION = "libs/networking" SRC_URI = "git://github.com/nanomsg/nanomsg.git;protocol=https;branch=master \ + file://run-ptest \ " SRCREV = "ccd7f20c1b756f7041598383baffcdc326246db7" -inherit cmake pkgconfig +inherit cmake pkgconfig ptest # nanomsg documentation generation requires asciidoctor, # not asciidoc, and currently there's no asciidoctor-native # recipe anywhere in openembedded-core or meta-openembedded -EXTRA_OECMAKE = " -DNN_ENABLE_DOC=OFF " +EXTRA_OECMAKE = " -DNN_ENABLE_DOC=OFF \ + ${@bb.utils.contains('PTEST_ENABLED', '1', '-DNN_TESTS=ON', '', d)} \ + " # we don't want nanomsg-tools to be renamed to libnanomsg-tools DEBIAN_NOAUTONAME:${PN}-tools = "1" +do_install_ptest(){ + install -d ${D}/${PTEST_PATH}/tests + find ${B} -maxdepth 1 -type f -executable \ + ! -name "*_lat" \ + ! -name "*_thr" \ + ! -name "nanocat" \ + ! -name "libnanomsg.so*" \ + -exec install {} ${D}${PTEST_PATH}/tests/ \; +} + PACKAGES =+ "${PN}-tools" FILES:${PN}-tools = "${bindir}/*"