diff mbox series

[meta-oe,master] tbb: Add ptest support

Message ID 20260421071052.2385333-1-zeming.liu@windriver.com
State New
Headers show
Series [meta-oe,master] tbb: Add ptest support | expand

Commit Message

Zeming LIU April 21, 2026, 7:10 a.m. UTC
Test result:
root@qemux86-64:/usr/lib/tbb/ptest# ptest-runner tbb
START: ptest-runner
2026-04-21T06:14
BEGIN: /usr/lib/tbb/ptest
PASS: test_tick_count
PASS: test_allocators
PASS: test_arena_priorities
PASS: test_dynamic_link
PASS: test_collaborative_call_once
PASS: test_concurrent_lru_cache
PASS: test_concurrent_unordered_map
PASS: test_concurrent_unordered_set
PASS: test_concurrent_map
PASS: test_concurrent_set
PASS: test_concurrent_priority_queue
PASS: test_partitioner
PASS: test_parallel_for
PASS: test_parallel_for_each
PASS: test_parallel_reduce
PASS: test_parallel_sort
PASS: test_parallel_invoke
PASS: test_parallel_scan
PASS: test_parallel_pipeline
PASS: test_eh_algorithms
PASS: test_blocked_range
PASS: test_concurrent_vector
PASS: test_task_group
PASS: test_concurrent_hash_map
PASS: test_task_arena
PASS: test_parallel_phase
PASS: test_enumerable_thread_specific
PASS: test_concurrent_queue
PASS: test_resumable_tasks
PASS: test_mutex
PASS: test_function_node
PASS: test_multifunction_node
PASS: test_broadcast_node
PASS: test_buffer_node
PASS: test_composite_node
PASS: test_continue_node
PASS: test_eh_flow_graph
PASS: test_flow_graph
PASS: test_flow_graph_priorities
PASS: test_flow_graph_whitebox
PASS: test_indexer_node
PASS: test_join_node
PASS: test_join_node_key_matching
PASS: test_join_node_key_matching_n_args
PASS: test_join_node_msg_key_matching
PASS: test_join_node_msg_key_matching_n_args
PASS: test_join_node_preview
PASS: test_limiter_node
PASS: test_priority_queue_node
PASS: test_queue_node
PASS: test_sequencer_node
PASS: test_split_node
PASS: test_tagged_msg
PASS: test_overwrite_node
PASS: test_write_once_node
PASS: test_async_node
PASS: test_input_node
PASS: test_profiling
PASS: test_concurrent_queue_whitebox
PASS: test_intrusive_list
PASS: test_semaphore
PASS: test_environment_whitebox
PASS: test_hw_concurrency
PASS: test_eh_thread
PASS: test_tbb_version
PASS: test_global_control
PASS: test_task
PASS: test_concurrent_monitor
PASS: test_scheduler_mix
PASS: test_handle_perror
PASS: test_arena_constraints
PASS: test_tbbbind
PASS: test_tbb_fork
PASS: test_tbb_header
PASS: test_openmp
PASS: conformance_tick_count
PASS: conformance_allocators
PASS: conformance_mutex
PASS: conformance_task_group
PASS: conformance_task_group_context
PASS: conformance_task_arena
PASS: conformance_collaborative_call_once
PASS: conformance_concurrent_lru_cache
PASS: conformance_concurrent_unordered_map
PASS: conformance_concurrent_unordered_set
PASS: conformance_concurrent_map
PASS: conformance_concurrent_set
PASS: conformance_concurrent_priority_queue
PASS: conformance_parallel_for
PASS: conformance_parallel_for_each
PASS: conformance_parallel_reduce
PASS: conformance_parallel_scan
PASS: conformance_parallel_sort
PASS: conformance_parallel_pipeline
PASS: conformance_parallel_invoke
PASS: conformance_blocked_range
PASS: conformance_blocked_range2d
PASS: conformance_blocked_range3d
PASS: conformance_blocked_nd_range
PASS: conformance_concurrent_vector
PASS: conformance_global_control
PASS: conformance_concurrent_hash_map
PASS: conformance_enumerable_thread_specific
PASS: conformance_combinable
PASS: conformance_concurrent_queue
PASS: conformance_resumable_tasks
PASS: conformance_version
PASS: conformance_function_node
PASS: conformance_multifunction_node
PASS: conformance_input_node
PASS: conformance_continue_node
PASS: conformance_async_node
PASS: conformance_overwrite_node
PASS: conformance_write_once_node
PASS: conformance_buffer_node
PASS: conformance_queue_node
PASS: conformance_priority_queue_node
PASS: conformance_sequencer_node
PASS: conformance_limiter_node
PASS: conformance_broadcast_node
PASS: conformance_composite_node
PASS: conformance_indexer_node
PASS: conformance_split_node
PASS: conformance_join_node
PASS: conformance_graph
PASS: conformance_arena_constraints
PASS: test_scalable_allocator
PASS: test_malloc_pools
PASS: test_malloc_init_shutdown
PASS: test_malloc_regression
PASS: test_malloc_shutdown_hang
PASS: test_malloc_compliance
PASS: test_malloc_used_by_lib
PASS: test_malloc_lib_unload
PASS: test_malloc_pure_c
PASS: test_malloc_whitebox
PASS: test_malloc_atexit
PASS: test_malloc_overload
PASS: test_malloc_overload_disable
PASS: test_malloc_new_handler
DURATION: 143
END: /usr/lib/tbb/ptest
2026-04-21T06:16
STOP: ptest-runner
TOTAL: 1 FAIL: 0

Note:
The test is executed on qemu with kvm and qemuparams="-m 2048",
as tbb ptest is thread/mem consuming,  the tbb ptests will fail
or timeout with limited resource.

Signed-off-by: Zeming LIU <zeming.liu@windriver.com>
---
 .../include/ptest-packagelists-meta-oe.inc     |  1 +
 meta-oe/recipes-support/tbb/files/run-ptest    |  3 +++
 meta-oe/recipes-support/tbb/tbb_2022.3.0.bb    | 18 ++++++++++++++++--
 3 files changed, 20 insertions(+), 2 deletions(-)
 create mode 100755 meta-oe/recipes-support/tbb/files/run-ptest

Comments

Gyorgy Sarvari April 21, 2026, 7:23 a.m. UTC | #1
On 4/21/26 09:10, Zeming LIU via lists.openembedded.org wrote:
[...]
> Note:
> The test is executed on qemu with kvm and qemuparams="-m 2048",
> as tbb ptest is thread/mem consuming,  the tbb ptests will fail
> or timeout with limited resource.


You can customize the available memory for each PN in the ptest image
recipe:
https://git.openembedded.org/meta-openembedded/tree/meta-oe/recipes-core/images/meta-oe-image-ptest.bb#n29

Another small note, since I already wrote the above:
"--force-new-ctest-process" flag in the run-ptest script is a no-op:
ctest has been ignoring it since a while:
https://cmake.org/cmake/help/latest/manual/ctest.1.html#cmdoption-ctest-force-new-ctest-process


> 
> Signed-off-by: Zeming LIU <zeming.liu@windriver.com>
> ---
>  .../include/ptest-packagelists-meta-oe.inc     |  1 +
>  meta-oe/recipes-support/tbb/files/run-ptest    |  3 +++
>  meta-oe/recipes-support/tbb/tbb_2022.3.0.bb    | 18 ++++++++++++++++--
>  3 files changed, 20 insertions(+), 2 deletions(-)
>  create mode 100755 meta-oe/recipes-support/tbb/files/run-ptest
> 
> diff --git a/meta-oe/conf/include/ptest-packagelists-meta-oe.inc b/meta-oe/conf/include/ptest-packagelists-meta-oe.inc
> index b764d5dd58..528ce16191 100644
> --- a/meta-oe/conf/include/ptest-packagelists-meta-oe.inc
> +++ b/meta-oe/conf/include/ptest-packagelists-meta-oe.inc
> @@ -80,6 +80,7 @@ PTESTS_SLOW_META_OE = "\
>      postgresql \
>      re2 \
>      rocksdb \
> +    tbb \
>  "
>  PTESTS_SLOW_META_OE:append:x86 = " kernel-selftest"
>  PTESTS_SLOW_META_OE:append:x86-64 = " kernel-selftest"
> diff --git a/meta-oe/recipes-support/tbb/files/run-ptest b/meta-oe/recipes-support/tbb/files/run-ptest
> new file mode 100755
> index 0000000000..8bd5fd1efb
> --- /dev/null
> +++ b/meta-oe/recipes-support/tbb/files/run-ptest
> @@ -0,0 +1,3 @@
> +#!/bin/sh
> +
> +ctest --force-new-ctest-process | sed -u 's/\*\*\*/   /g' | awk '/Test +#/{gsub(/Passed/,"PASS"); gsub(/Failed/,"FAIL"); gsub(/Skipped/,"SKIP"); print $6": "$4; fflush();}'
> diff --git a/meta-oe/recipes-support/tbb/tbb_2022.3.0.bb b/meta-oe/recipes-support/tbb/tbb_2022.3.0.bb
> index 440b6e0f46..187c2061e5 100644
> --- a/meta-oe/recipes-support/tbb/tbb_2022.3.0.bb
> +++ b/meta-oe/recipes-support/tbb/tbb_2022.3.0.bb
> @@ -15,20 +15,23 @@ PE = "1"
>  BRANCH = "onetbb_2022"
>  SRCREV = "f1862f38f83568d96e814e469ab61f88336cc595"
>  SRC_URI = "git://github.com/oneapi-src/oneTBB.git;protocol=https;branch=${BRANCH} \
> +           file://run-ptest \
>            "
>  
>  LDFLAGS += "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}"
>  
> -inherit cmake pkgconfig
> +inherit cmake pkgconfig ptest
>  
>  # test build fails, error: 'mallinfo mallinfo()' is deprecated
>  EXTRA_OECMAKE += " \
> -                    -DTBB_TEST=OFF \
> +                    -DTBB_TEST=${@bb.utils.contains('PTEST_ENABLED', '1', 'ON', 'OFF', d)} \
>                      -DCMAKE_BUILD_TYPE=Release \
>                      -DTBB_STRICT=OFF \
>                      -DTBB_DISABLE_HWLOC_AUTOMATIC_SEARCH=OFF \
>                  "
>  
> +RDEPENDS:${PN}-ptest += "cmake"
> +
>  # Hard-float 'd' ABI can't be used for a target that doesn't support the D instruction set extension (ignoring target-abi)
>  # tmp-glibc/work/riscv64-oe-linux/tbb/1_2021.7.0-r0/recipe-sysroot-native/usr/bin/riscv64-oe-linux/riscv64-oe-linux-ld: /tmp/lto-llvm-264bc2.o: can't link soft-float modules with double-float modules
>  # tmp-glibc/work/riscv64-oe-linux/tbb/1_2021.7.0-r0/recipe-sysroot-native/usr/bin/riscv64-oe-linux/riscv64-oe-linux-ld: failed to merge target specific data of file /tmp/lto-llvm-264bc2.o
> @@ -60,5 +63,16 @@ do_install:append:class-target() {
>      sed -i "s#${RECIPE_SYSROOT}##g" ${D}${libdir}/cmake/TBB/TBBTargets.cmake
>  }
>  
> +do_install_ptest() {
> +    install -d ${D}${PTEST_PATH}
> +    install ${B}/test/CTestTestfile.cmake ${D}${PTEST_PATH}/
> +    cp -rf ${B}/gnu* ${D}${PTEST_PATH}
> +    rm -rf ${D}${PTEST_PATH}/gnu*/libtbb*
> +    rm -rf ${D}${PTEST_PATH}/gnu*/*.sh
> +    sed -i -e s#${S}#${PTEST_PATH}#g \
> +           -e s#${B}#${PTEST_PATH}#g \
> +            ${D}${PTEST_PATH}/CTestTestfile.cmake
> +}
> +
>  
>  BBCLASSEXTEND = "native nativesdk"
> 
> 
> 
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#126524): https://lists.openembedded.org/g/openembedded-devel/message/126524
> Mute This Topic: https://lists.openembedded.org/mt/118934237/6084445
> Group Owner: openembedded-devel+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [skandigraun@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
Zeming LIU April 21, 2026, 7:53 a.m. UTC | #2
> -----Original Message-----
> From: Gyorgy Sarvari <skandigraun@gmail.com>
> Sent: 2026年4月21日 15:23
> To: Liu, Zeming <Zeming.Liu@windriver.com>;
> openembedded-devel@lists.openembedded.org
> Subject: Re: [oe] [meta-oe][master][PATCH] tbb: Add ptest support
> 
> CAUTION: This email comes from a non Wind River email account!
> Do not click links or open attachments unless you recognize the sender and
> know the content is safe.
> 
> On 4/21/26 09:10, Zeming LIU via lists.openembedded.org wrote:
> [...]
> > Note:
> > The test is executed on qemu with kvm and qemuparams="-m 2048", as tbb
> > ptest is thread/mem consuming,  the tbb ptests will fail or timeout
> > with limited resource.
> 
> 
> You can customize the available memory for each PN in the ptest image
> recipe:
> https://git.openembedded.org/meta-openembedded/tree/meta-oe/recipes-cor
> e/images/meta-oe-image-ptest.bb#n29
> 
> Another small note, since I already wrote the above:
> "--force-new-ctest-process" flag in the run-ptest script is a no-op:
> ctest has been ignoring it since a while:
> https://cmake.org/cmake/help/latest/manual/ctest.1.html#cmdoption-ctest-for
> ce-new-ctest-process

Thanks for the comments, I'll check and send v2.

Regards,
Zeming Liu
> 
> 
> >
> > Signed-off-by: Zeming LIU <zeming.liu@windriver.com>
> > ---
> >  .../include/ptest-packagelists-meta-oe.inc     |  1 +
> >  meta-oe/recipes-support/tbb/files/run-ptest    |  3 +++
> >  meta-oe/recipes-support/tbb/tbb_2022.3.0.bb    | 18
> ++++++++++++++++--
> >  3 files changed, 20 insertions(+), 2 deletions(-)  create mode 100755
> > meta-oe/recipes-support/tbb/files/run-ptest
> >
> > diff --git a/meta-oe/conf/include/ptest-packagelists-meta-oe.inc
> > b/meta-oe/conf/include/ptest-packagelists-meta-oe.inc
> > index b764d5dd58..528ce16191 100644
> > --- a/meta-oe/conf/include/ptest-packagelists-meta-oe.inc
> > +++ b/meta-oe/conf/include/ptest-packagelists-meta-oe.inc
> > @@ -80,6 +80,7 @@ PTESTS_SLOW_META_OE = "\
> >      postgresql \
> >      re2 \
> >      rocksdb \
> > +    tbb \
> >  "
> >  PTESTS_SLOW_META_OE:append:x86 = " kernel-selftest"
> >  PTESTS_SLOW_META_OE:append:x86-64 = " kernel-selftest"
> > diff --git a/meta-oe/recipes-support/tbb/files/run-ptest
> > b/meta-oe/recipes-support/tbb/files/run-ptest
> > new file mode 100755
> > index 0000000000..8bd5fd1efb
> > --- /dev/null
> > +++ b/meta-oe/recipes-support/tbb/files/run-ptest
> > @@ -0,0 +1,3 @@
> > +#!/bin/sh
> > +
> > +ctest --force-new-ctest-process | sed -u 's/\*\*\*/   /g' | awk '/Test
> +#/{gsub(/Passed/,"PASS"); gsub(/Failed/,"FAIL"); gsub(/Skipped/,"SKIP"); print
> $6": "$4; fflush();}'
> > diff --git a/meta-oe/recipes-support/tbb/tbb_2022.3.0.bb
> > b/meta-oe/recipes-support/tbb/tbb_2022.3.0.bb
> > index 440b6e0f46..187c2061e5 100644
> > --- a/meta-oe/recipes-support/tbb/tbb_2022.3.0.bb
> > +++ b/meta-oe/recipes-support/tbb/tbb_2022.3.0.bb
> > @@ -15,20 +15,23 @@ PE = "1"
> >  BRANCH = "onetbb_2022"
> >  SRCREV = "f1862f38f83568d96e814e469ab61f88336cc595"
> >  SRC_URI =
> > "git://github.com/oneapi-src/oneTBB.git;protocol=https;branch=${BRANCH
> > } \
> > +           file://run-ptest \
> >            "
> >
> >  LDFLAGS += "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', '
> -Wl,--undefined-version', '', d)}"
> >
> > -inherit cmake pkgconfig
> > +inherit cmake pkgconfig ptest
> >
> >  # test build fails, error: 'mallinfo mallinfo()' is deprecated
> > EXTRA_OECMAKE += " \
> > -                    -DTBB_TEST=OFF \
> > +                    -DTBB_TEST=${@bb.utils.contains('PTEST_ENABLED',
> > + '1', 'ON', 'OFF', d)} \
> >                      -DCMAKE_BUILD_TYPE=Release \
> >                      -DTBB_STRICT=OFF \
> >                      -DTBB_DISABLE_HWLOC_AUTOMATIC_SEARCH=OFF
> \
> >                  "
> >
> > +RDEPENDS:${PN}-ptest += "cmake"
> > +
> >  # Hard-float 'd' ABI can't be used for a target that doesn't support
> > the D instruction set extension (ignoring target-abi)  #
> > tmp-glibc/work/riscv64-oe-linux/tbb/1_2021.7.0-r0/recipe-sysroot-nativ
> > e/usr/bin/riscv64-oe-linux/riscv64-oe-linux-ld: /tmp/lto-llvm-264bc2.o: can't
> link soft-float modules with double-float modules  #
> tmp-glibc/work/riscv64-oe-linux/tbb/1_2021.7.0-r0/recipe-sysroot-native/usr/
> bin/riscv64-oe-linux/riscv64-oe-linux-ld: failed to merge target specific data of
> file /tmp/lto-llvm-264bc2.o @@ -60,5 +63,16 @@
> do_install:append:class-target() {
> >      sed -i "s#${RECIPE_SYSROOT}##g"
> > ${D}${libdir}/cmake/TBB/TBBTargets.cmake
> >  }
> >
> > +do_install_ptest() {
> > +    install -d ${D}${PTEST_PATH}
> > +    install ${B}/test/CTestTestfile.cmake ${D}${PTEST_PATH}/
> > +    cp -rf ${B}/gnu* ${D}${PTEST_PATH}
> > +    rm -rf ${D}${PTEST_PATH}/gnu*/libtbb*
> > +    rm -rf ${D}${PTEST_PATH}/gnu*/*.sh
> > +    sed -i -e s#${S}#${PTEST_PATH}#g \
> > +           -e s#${B}#${PTEST_PATH}#g \
> > +            ${D}${PTEST_PATH}/CTestTestfile.cmake
> > +}
> > +
> >
> >  BBCLASSEXTEND = "native nativesdk"
> >
> >
> >
> > -=-=-=-=-=-=-=-=-=-=-=-
> > Links: You receive all messages sent to this group.
> > View/Reply Online (#126524):
> > https://lists.openembedded.org/g/openembedded-devel/message/126524
> > Mute This Topic: https://lists.openembedded.org/mt/118934237/6084445
> > Group Owner: openembedded-devel+owner@lists.openembedded.org
> > Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub
> > [skandigraun@gmail.com]
> > -=-=-=-=-=-=-=-=-=-=-=-
> >
diff mbox series

Patch

diff --git a/meta-oe/conf/include/ptest-packagelists-meta-oe.inc b/meta-oe/conf/include/ptest-packagelists-meta-oe.inc
index b764d5dd58..528ce16191 100644
--- a/meta-oe/conf/include/ptest-packagelists-meta-oe.inc
+++ b/meta-oe/conf/include/ptest-packagelists-meta-oe.inc
@@ -80,6 +80,7 @@  PTESTS_SLOW_META_OE = "\
     postgresql \
     re2 \
     rocksdb \
+    tbb \
 "
 PTESTS_SLOW_META_OE:append:x86 = " kernel-selftest"
 PTESTS_SLOW_META_OE:append:x86-64 = " kernel-selftest"
diff --git a/meta-oe/recipes-support/tbb/files/run-ptest b/meta-oe/recipes-support/tbb/files/run-ptest
new file mode 100755
index 0000000000..8bd5fd1efb
--- /dev/null
+++ b/meta-oe/recipes-support/tbb/files/run-ptest
@@ -0,0 +1,3 @@ 
+#!/bin/sh
+
+ctest --force-new-ctest-process | sed -u 's/\*\*\*/   /g' | awk '/Test +#/{gsub(/Passed/,"PASS"); gsub(/Failed/,"FAIL"); gsub(/Skipped/,"SKIP"); print $6": "$4; fflush();}'
diff --git a/meta-oe/recipes-support/tbb/tbb_2022.3.0.bb b/meta-oe/recipes-support/tbb/tbb_2022.3.0.bb
index 440b6e0f46..187c2061e5 100644
--- a/meta-oe/recipes-support/tbb/tbb_2022.3.0.bb
+++ b/meta-oe/recipes-support/tbb/tbb_2022.3.0.bb
@@ -15,20 +15,23 @@  PE = "1"
 BRANCH = "onetbb_2022"
 SRCREV = "f1862f38f83568d96e814e469ab61f88336cc595"
 SRC_URI = "git://github.com/oneapi-src/oneTBB.git;protocol=https;branch=${BRANCH} \
+           file://run-ptest \
           "
 
 LDFLAGS += "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}"
 
-inherit cmake pkgconfig
+inherit cmake pkgconfig ptest
 
 # test build fails, error: 'mallinfo mallinfo()' is deprecated
 EXTRA_OECMAKE += " \
-                    -DTBB_TEST=OFF \
+                    -DTBB_TEST=${@bb.utils.contains('PTEST_ENABLED', '1', 'ON', 'OFF', d)} \
                     -DCMAKE_BUILD_TYPE=Release \
                     -DTBB_STRICT=OFF \
                     -DTBB_DISABLE_HWLOC_AUTOMATIC_SEARCH=OFF \
                 "
 
+RDEPENDS:${PN}-ptest += "cmake"
+
 # Hard-float 'd' ABI can't be used for a target that doesn't support the D instruction set extension (ignoring target-abi)
 # tmp-glibc/work/riscv64-oe-linux/tbb/1_2021.7.0-r0/recipe-sysroot-native/usr/bin/riscv64-oe-linux/riscv64-oe-linux-ld: /tmp/lto-llvm-264bc2.o: can't link soft-float modules with double-float modules
 # tmp-glibc/work/riscv64-oe-linux/tbb/1_2021.7.0-r0/recipe-sysroot-native/usr/bin/riscv64-oe-linux/riscv64-oe-linux-ld: failed to merge target specific data of file /tmp/lto-llvm-264bc2.o
@@ -60,5 +63,16 @@  do_install:append:class-target() {
     sed -i "s#${RECIPE_SYSROOT}##g" ${D}${libdir}/cmake/TBB/TBBTargets.cmake
 }
 
+do_install_ptest() {
+    install -d ${D}${PTEST_PATH}
+    install ${B}/test/CTestTestfile.cmake ${D}${PTEST_PATH}/
+    cp -rf ${B}/gnu* ${D}${PTEST_PATH}
+    rm -rf ${D}${PTEST_PATH}/gnu*/libtbb*
+    rm -rf ${D}${PTEST_PATH}/gnu*/*.sh
+    sed -i -e s#${S}#${PTEST_PATH}#g \
+           -e s#${B}#${PTEST_PATH}#g \
+            ${D}${PTEST_PATH}/CTestTestfile.cmake
+}
+
 
 BBCLASSEXTEND = "native nativesdk"