Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Omit tests that takes too long for emscripten #1312

Merged
merged 5 commits into from
Feb 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 33 additions & 33 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion test/conformance/conformance_blocked_rangeNd.cpp
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -245,6 +245,7 @@ TEST_CASE("Serial test") {
SerialTest<N>();
}

#if !EMSCRIPTEN
dnmokhov marked this conversation as resolved.
Show resolved Hide resolved
//! Testing blocked_rangeNd interface with parallel_for
//! \brief \ref requirement
TEST_CASE("Parallel test") {
Expand All @@ -253,6 +254,7 @@ TEST_CASE("Parallel test") {
ParallelTest<N>();
}
}
#endif

//! Testing blocked_rangeNd with proportional splitting
//! \brief \ref interface \ref requirement
Expand Down
4 changes: 3 additions & 1 deletion test/conformance/conformance_parallel_for.cpp
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -399,7 +399,9 @@ TEST_CASE("Flog test") {
Flog<parallel_tag, 10>();
Flog<parallel_tag, 100>();
Flog<parallel_tag, 1000>();
#if !EMSCRIPTEN
Flog<parallel_tag, 10000>();
#endif
}

//! Testing parallel for with different types and step
Expand Down
7 changes: 5 additions & 2 deletions test/tbb/test_collaborative_call_once.cpp
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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") {
Expand Down Expand Up @@ -246,7 +247,7 @@ TEST_CASE("only calls once - stress test") {
});
}
}

#endif
#if TBB_USE_EXCEPTIONS

//! Test for collaborative_call_once exception handling
Expand Down Expand Up @@ -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") {
Expand All @@ -341,6 +343,7 @@ TEST_CASE("multiple help") {
});
});
}
#endif

//! Test for collaborative work from different arenas
//! \brief \ref interface \ref requirement
Expand Down
22 changes: 17 additions & 5 deletions test/tbb/test_eh_algorithms.cpp
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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") {
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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") {
Expand All @@ -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
Expand Down Expand Up @@ -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") {
Expand All @@ -1053,6 +1056,7 @@ TEST_CASE("parallel_for_each exception handling test #1") {
}
}
}
#endif

//! Testing parallel_for_each exception handling
//! \brief \ref error_guessing
Expand All @@ -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") {
Expand All @@ -1095,6 +1100,7 @@ TEST_CASE("parallel_for_each exception handling test #3") {
}
}
}
#endif

//! Testing parallel_for_each exception handling
//! \brief \ref error_guessing
Expand All @@ -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") {
Expand All @@ -1139,7 +1146,7 @@ TEST_CASE("parallel_for_each exception handling test #5") {
}
}
}

#endif
#endif /* TBB_USE_EXCEPTIONS */

class ParForEachBodyToCancel {
Expand Down Expand Up @@ -1217,6 +1224,7 @@ void TestCancelation2_parallel_for_each () {
RunCancellationTest<ParForEachWorker<body_to_cancel, Iterator>, Cancellator2>();
}

#if !EMSCRIPTEN
//! Testing parallel_for_each cancellation test
//! \brief \ref error_guessing
TEST_CASE("parallel_for_each cancellation test #1") {
Expand Down Expand Up @@ -1257,6 +1265,7 @@ TEST_CASE("parallel_for_each cancellation test #2") {
}
}
}
#endif

////////////////////////////////////////////////////////////////////////////////
// Tests for tbb::parallel_pipeline
Expand Down Expand Up @@ -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") {
Expand All @@ -1631,7 +1641,7 @@ TEST_CASE("parallel_pipeline exception handling test #3") {
TEST_CASE("parallel_pipeline exception handling test #4") {
TestWithDifferentFiltersAndConcurrency<Test4_pipeline>();
}

#endif
#endif /* TBB_USE_EXCEPTIONS */

class FilterToCancel {
Expand Down Expand Up @@ -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") {
Expand All @@ -1748,3 +1759,4 @@ TEST_CASE("parallel_pipeline cancellation test #2") {
}
}
}
#endif
5 changes: 3 additions & 2 deletions test/tbb/test_eh_flow_graph.cpp
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -2017,6 +2017,7 @@ void TestOneThreadNum(int nThread) {
);
}

#if !EMSCRIPTEN
//! Test exceptions with parallelism
//! \brief \ref error_guessing
TEST_CASE("Testing several threads"){
Expand All @@ -2026,5 +2027,5 @@ TEST_CASE("Testing several threads"){
TestOneThreadNum(nThread);
}
}

#endif
#endif // TBB_USE_EXCEPTIONS
5 changes: 4 additions & 1 deletion test/tbb/test_flow_graph_priorities.cpp
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -842,13 +842,15 @@ TEST_CASE("Priority nodes take precedence"){
}
}

#if !EMSCRIPTEN
//! Test thread eager reaction
//! \brief \ref error_guessing
TEST_CASE("Thread eager reaction"){
for( auto p : utils::concurrency_range() ) {
ThreadsEagerReaction::test( static_cast<int>(p) );
}
}
#endif

//! Test prioritization under concurrency limits
//! \brief \ref error_guessing
Expand Down Expand Up @@ -888,3 +890,4 @@ TEST_CASE("Exceptions") {
Exceptions::test();
}
#endif

4 changes: 3 additions & 1 deletion test/tbb/test_global_control.cpp
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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") {
Expand Down
Loading
Loading