diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 5c6cbb676a..0c59861399 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 Intel Corporation +# Copyright (c) 2020-2024 Intel Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -593,39 +593,39 @@ if (TARGET TBB::tbbmalloc) endif() # ---------------------------------------------------------------------------------------- # Whitebox testing - - add_executable(test_malloc_whitebox tbbmalloc/test_malloc_whitebox.cpp) - - target_include_directories(test_malloc_whitebox - PRIVATE - ${CMAKE_CURRENT_SOURCE_DIR}/../include - ${CMAKE_CURRENT_SOURCE_DIR}/.. - ${CMAKE_CURRENT_SOURCE_DIR}) - target_compile_definitions(test_malloc_whitebox PRIVATE __TBBMALLOC_BUILD) - target_compile_options(test_malloc_whitebox - PRIVATE - ${TBB_CXX_STD_FLAG} - ${TBB_WARNING_SUPPRESS} - ${TBB_TEST_COMPILE_FLAGS} - ${TBB_COMMON_COMPILE_FLAGS} - ${TBBMALLOC_LIB_COMPILE_FLAGS} - ) - if (ANDROID_PLATFORM) - add_test(NAME test_malloc_whitebox - COMMAND ${CMAKE_COMMAND} - -DBINARIES_PATH=${CMAKE_LIBRARY_OUTPUT_DIRECTORY} - -DTEST_NAME=test_malloc_whitebox - -P ${PROJECT_SOURCE_DIR}/cmake/android/test_launcher.cmake) - else() - add_test(NAME test_malloc_whitebox COMMAND test_malloc_whitebox --force-colors=1) - endif() - if (COMMAND target_link_options) - target_link_options(test_malloc_whitebox PRIVATE ${TBB_COMMON_LINK_FLAGS}) - else() - target_link_libraries(test_malloc_whitebox PRIVATE ${TBB_COMMON_LINK_FLAGS}) + if (NOT TBB_EMSCRIPTEN) + add_executable(test_malloc_whitebox tbbmalloc/test_malloc_whitebox.cpp) + + target_include_directories(test_malloc_whitebox + PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR}/../include + ${CMAKE_CURRENT_SOURCE_DIR}/.. + ${CMAKE_CURRENT_SOURCE_DIR}) + target_compile_definitions(test_malloc_whitebox PRIVATE __TBBMALLOC_BUILD) + target_compile_options(test_malloc_whitebox + PRIVATE + ${TBB_CXX_STD_FLAG} + ${TBB_WARNING_SUPPRESS} + ${TBB_TEST_COMPILE_FLAGS} + ${TBB_COMMON_COMPILE_FLAGS} + ${TBBMALLOC_LIB_COMPILE_FLAGS} + ) + if (ANDROID_PLATFORM) + add_test(NAME test_malloc_whitebox + COMMAND ${CMAKE_COMMAND} + -DBINARIES_PATH=${CMAKE_LIBRARY_OUTPUT_DIRECTORY} + -DTEST_NAME=test_malloc_whitebox + -P ${PROJECT_SOURCE_DIR}/cmake/android/test_launcher.cmake) + else() + add_test(NAME test_malloc_whitebox COMMAND test_malloc_whitebox --force-colors=1) + endif() + if (COMMAND target_link_options) + target_link_options(test_malloc_whitebox PRIVATE ${TBB_COMMON_LINK_FLAGS}) + else() + target_link_libraries(test_malloc_whitebox PRIVATE ${TBB_COMMON_LINK_FLAGS}) + endif() + target_link_libraries(test_malloc_whitebox PRIVATE Threads::Threads ${TBB_COMMON_LINK_LIBS}) endif() - target_link_libraries(test_malloc_whitebox PRIVATE Threads::Threads ${TBB_COMMON_LINK_LIBS}) - # ------------------------------------------------------------------------------------------ # Define TBB malloc conformance tests diff --git a/test/conformance/conformance_blocked_rangeNd.cpp b/test/conformance/conformance_blocked_rangeNd.cpp index de54169cd9..52faac52ca 100644 --- a/test/conformance/conformance_blocked_rangeNd.cpp +++ b/test/conformance/conformance_blocked_rangeNd.cpp @@ -1,5 +1,5 @@ /* - Copyright (c) 2017-2021 Intel Corporation + Copyright (c) 2017-2024 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -245,6 +245,7 @@ TEST_CASE("Serial test") { SerialTest(); } +#if !EMSCRIPTEN //! Testing blocked_rangeNd interface with parallel_for //! \brief \ref requirement TEST_CASE("Parallel test") { @@ -253,6 +254,7 @@ TEST_CASE("Parallel test") { ParallelTest(); } } +#endif //! Testing blocked_rangeNd with proportional splitting //! \brief \ref interface \ref requirement diff --git a/test/conformance/conformance_parallel_for.cpp b/test/conformance/conformance_parallel_for.cpp index 44903f06c4..463ea5266d 100644 --- a/test/conformance/conformance_parallel_for.cpp +++ b/test/conformance/conformance_parallel_for.cpp @@ -1,5 +1,5 @@ /* - Copyright (c) 2005-2023 Intel Corporation + Copyright (c) 2005-2024 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -399,7 +399,9 @@ TEST_CASE("Flog test") { Flog(); Flog(); Flog(); +#if !EMSCRIPTEN Flog(); +#endif } //! Testing parallel for with different types and step diff --git a/test/tbb/test_collaborative_call_once.cpp b/test/tbb/test_collaborative_call_once.cpp index d8ee09fda0..11a04a10d3 100644 --- a/test/tbb/test_collaborative_call_once.cpp +++ b/test/tbb/test_collaborative_call_once.cpp @@ -1,5 +1,5 @@ /* - Copyright (c) 2022 Intel Corporation + Copyright (c) 2022-2024 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -206,6 +206,7 @@ TEST_CASE("only calls once - move only argument") { } } +#if !EMSCRIPTEN //! Stress test for functor to be called only once //! \brief \ref interface \ref requirement \ref stress TEST_CASE("only calls once - stress test") { @@ -246,7 +247,7 @@ TEST_CASE("only calls once - stress test") { }); } } - +#endif #if TBB_USE_EXCEPTIONS //! Test for collaborative_call_once exception handling @@ -324,6 +325,7 @@ TEST_CASE("handles exceptions - stress test") { #endif +#if !EMSCRIPTEN //! Test for multiple help from moonlighting threads //! \brief \ref interface \ref requirement TEST_CASE("multiple help") { @@ -341,6 +343,7 @@ TEST_CASE("multiple help") { }); }); } +#endif //! Test for collaborative work from different arenas //! \brief \ref interface \ref requirement diff --git a/test/tbb/test_eh_algorithms.cpp b/test/tbb/test_eh_algorithms.cpp index 75c0381d09..7a2b59b400 100644 --- a/test/tbb/test_eh_algorithms.cpp +++ b/test/tbb/test_eh_algorithms.cpp @@ -1,5 +1,5 @@ /* - Copyright (c) 2005-2023 Intel Corporation + Copyright (c) 2005-2024 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -401,7 +401,7 @@ TEST_CASE("parallel_for and parallel_reduce exception handling test #0") { } } } - +#if !EMSCRIPTEN //! Testing parallel_for and parallel_reduce exception handling //! \brief \ref error_guessing TEST_CASE("parallel_for and parallel_reduce exception handling test #1") { @@ -486,8 +486,8 @@ TEST_CASE("parallel_for and parallel_reduce exception handling test #4") { } } +#endif #endif /* TBB_USE_EXCEPTIONS */ - class ParForBodyToCancel { public: void operator()( const range_type& ) const { @@ -698,6 +698,7 @@ TEST_CASE("parallel_for and parallel_reduce cancellation test #1") { } } +#if !EMSCRIPTEN //! Testing parallel_for and parallel_reduce cancellation //! \brief \ref error_guessing TEST_CASE("parallel_for and parallel_reduce cancellation test #2") { @@ -718,6 +719,7 @@ TEST_CASE("parallel_for and parallel_reduce cancellation test #2") { } } } +#endif //! Testing parallel_for and parallel_reduce cancellation //! \brief \ref error_guessing @@ -1033,6 +1035,7 @@ void Test5_parallel_for_each () { } } // void Test5_parallel_for_each () +#if !EMSCRIPTEN //! Testing parallel_for_each exception handling //! \brief \ref error_guessing TEST_CASE("parallel_for_each exception handling test #1") { @@ -1053,6 +1056,7 @@ TEST_CASE("parallel_for_each exception handling test #1") { } } } +#endif //! Testing parallel_for_each exception handling //! \brief \ref error_guessing @@ -1075,6 +1079,7 @@ TEST_CASE("parallel_for_each exception handling test #2") { } } +#if !EMSCRIPTEN //! Testing parallel_for_each exception handling //! \brief \ref error_guessing TEST_CASE("parallel_for_each exception handling test #3") { @@ -1095,6 +1100,7 @@ TEST_CASE("parallel_for_each exception handling test #3") { } } } +#endif //! Testing parallel_for_each exception handling //! \brief \ref error_guessing @@ -1117,6 +1123,7 @@ TEST_CASE("parallel_for_each exception handling test #4") { } } +#if !EMSCRIPTEN //! Testing parallel_for_each exception handling //! \brief \ref error_guessing TEST_CASE("parallel_for_each exception handling test #5") { @@ -1139,7 +1146,7 @@ TEST_CASE("parallel_for_each exception handling test #5") { } } } - +#endif #endif /* TBB_USE_EXCEPTIONS */ class ParForEachBodyToCancel { @@ -1217,6 +1224,7 @@ void TestCancelation2_parallel_for_each () { RunCancellationTest, Cancellator2>(); } +#if !EMSCRIPTEN //! Testing parallel_for_each cancellation test //! \brief \ref error_guessing TEST_CASE("parallel_for_each cancellation test #1") { @@ -1257,6 +1265,7 @@ TEST_CASE("parallel_for_each cancellation test #2") { } } } +#endif //////////////////////////////////////////////////////////////////////////////// // Tests for tbb::parallel_pipeline @@ -1608,6 +1617,7 @@ void TestWithDifferentFiltersAndConcurrency() { #endif } +#if !EMSCRIPTEN //! Testing parallel_pipeline exception handling //! \brief \ref error_guessing TEST_CASE("parallel_pipeline exception handling test #1") { @@ -1631,7 +1641,7 @@ TEST_CASE("parallel_pipeline exception handling test #3") { TEST_CASE("parallel_pipeline exception handling test #4") { TestWithDifferentFiltersAndConcurrency(); } - +#endif #endif /* TBB_USE_EXCEPTIONS */ class FilterToCancel { @@ -1727,6 +1737,7 @@ TEST_CASE("parallel_pipeline cancellation test #1") { } } +#if !EMSCRIPTEN //! Testing parallel_pipeline cancellation //! \brief \ref error_guessing TEST_CASE("parallel_pipeline cancellation test #2") { @@ -1748,3 +1759,4 @@ TEST_CASE("parallel_pipeline cancellation test #2") { } } } +#endif diff --git a/test/tbb/test_eh_flow_graph.cpp b/test/tbb/test_eh_flow_graph.cpp index 71f381566c..015d196eaf 100644 --- a/test/tbb/test_eh_flow_graph.cpp +++ b/test/tbb/test_eh_flow_graph.cpp @@ -1,5 +1,5 @@ /* - Copyright (c) 2005-2023 Intel Corporation + Copyright (c) 2005-2024 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -2017,6 +2017,7 @@ void TestOneThreadNum(int nThread) { ); } +#if !EMSCRIPTEN //! Test exceptions with parallelism //! \brief \ref error_guessing TEST_CASE("Testing several threads"){ @@ -2026,5 +2027,5 @@ TEST_CASE("Testing several threads"){ TestOneThreadNum(nThread); } } - +#endif #endif // TBB_USE_EXCEPTIONS diff --git a/test/tbb/test_flow_graph_priorities.cpp b/test/tbb/test_flow_graph_priorities.cpp index 5c798063ab..483daadb18 100644 --- a/test/tbb/test_flow_graph_priorities.cpp +++ b/test/tbb/test_flow_graph_priorities.cpp @@ -1,5 +1,5 @@ /* - Copyright (c) 2018-2021 Intel Corporation + Copyright (c) 2018-2024 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -842,6 +842,7 @@ TEST_CASE("Priority nodes take precedence"){ } } +#if !EMSCRIPTEN //! Test thread eager reaction //! \brief \ref error_guessing TEST_CASE("Thread eager reaction"){ @@ -849,6 +850,7 @@ TEST_CASE("Thread eager reaction"){ ThreadsEagerReaction::test( static_cast(p) ); } } +#endif //! Test prioritization under concurrency limits //! \brief \ref error_guessing @@ -888,3 +890,4 @@ TEST_CASE("Exceptions") { Exceptions::test(); } #endif + diff --git a/test/tbb/test_global_control.cpp b/test/tbb/test_global_control.cpp index 0c3df3bf83..fddbbaf691 100644 --- a/test/tbb/test_global_control.cpp +++ b/test/tbb/test_global_control.cpp @@ -1,5 +1,5 @@ /* - Copyright (c) 2005-2023 Intel Corporation + Copyright (c) 2005-2024 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -245,11 +245,13 @@ TEST_CASE("prolong lifetime advanced") { } #endif +#if !EMSCRIPTEN //! Testing multiple wait //! \brief \ref error_guessing TEST_CASE("prolong lifetime multiple wait") { TestBlockingTerminateNS::TestMultpleWait(); } +#endif //! \brief \ref regression TEST_CASE("test concurrent task_scheduler_handle destruction") { diff --git a/test/tbb/test_mutex.cpp b/test/tbb/test_mutex.cpp index bc7b79e334..5b78f17321 100644 --- a/test/tbb/test_mutex.cpp +++ b/test/tbb/test_mutex.cpp @@ -1,5 +1,5 @@ /* - Copyright (c) 2005-2021 Intel Corporation + Copyright (c) 2005-2024 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -109,7 +109,6 @@ void TestTransaction(const char* name) REQUIRE_MESSAGE(n_transactions_attempted.load(std::memory_order_relaxed), "ERROR for " << name << ": transactions were never attempted"); } - //! \brief \ref error_guessing TEST_CASE("Transaction test") { if (have_TSX()) { @@ -119,6 +118,7 @@ TEST_CASE("Transaction test") { } #endif /* __TBB_TSX_TESTING_ENABLED_FOR_THIS_COMPILER */ + //! \brief \ref error_guessing TEST_CASE("test upgrade/downgrade with spin_rw_mutex") { test_rwm_upgrade_downgrade(); @@ -144,10 +144,12 @@ TEST_CASE("test spin_mutex with native threads") { test_with_native_threads::test(); } +#if !EMSCRIPTEN //! \brief \ref error_guessing TEST_CASE("test queuing_mutex with native threads") { test_with_native_threads::test(); } +#endif //! \brief \ref error_guessing TEST_CASE("test mutex with native threads") { @@ -160,11 +162,13 @@ TEST_CASE("test spin_rw_mutex with native threads") { test_with_native_threads::test_rw(); } +#if !EMSCRIPTEN //! \brief \ref error_guessing TEST_CASE("test queuing_rw_mutex with native threads") { test_with_native_threads::test(); test_with_native_threads::test_rw(); } +#endif //! \brief \ref error_guessing TEST_CASE("test rw_mutex with native threads") { @@ -197,3 +201,4 @@ TEST_CASE("internal mutex concepts") { tbb::null_rw_mutex, tbb::queuing_rw_mutex>); } #endif // __TBB_CPP20_CONCEPTS_PRESENT + diff --git a/test/tbb/test_resumable_tasks.cpp b/test/tbb/test_resumable_tasks.cpp index a363a9ca5e..0cba977274 100644 --- a/test/tbb/test_resumable_tasks.cpp +++ b/test/tbb/test_resumable_tasks.cpp @@ -1,5 +1,5 @@ /* - Copyright (c) 2005-2022 Intel Corporation + Copyright (c) 2005-2024 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -423,6 +423,7 @@ class TestCaseGuard { thread_local bool TestCaseGuard::m_local = false; +#if !EMSCRIPTEN //! Nested test for suspend and resume //! \brief \ref error_guessing TEST_CASE("Nested test for suspend and resume") { @@ -436,6 +437,7 @@ TEST_CASE("Nested arena") { TestCaseGuard guard; TestNestedArena(); } +#endif //! Test with external threads //! \brief \ref error_guessing @@ -443,11 +445,13 @@ TEST_CASE("External threads") { TestNativeThread(); } +#if !EMSCRIPTEN //! Stress test with external threads //! \brief \ref stress TEST_CASE("Stress test with external threads") { TestCleanupMaster(); } +#endif //! Test with an arena observer //! \brief \ref error_guessing