diff --git a/tests/clds_hash_table_int/CMakeLists.txt b/tests/clds_hash_table_int/CMakeLists.txt index 28899162..6ee1148f 100644 --- a/tests/clds_hash_table_int/CMakeLists.txt +++ b/tests/clds_hash_table_int/CMakeLists.txt @@ -12,4 +12,4 @@ set(${theseTestsName}_c_files set(${theseTestsName}_h_files ) -build_test_artifacts(${theseTestsName} "tests/clds" ADDITIONAL_LIBS clds) +build_test_artifacts(${theseTestsName} "tests/clds" ADDITIONAL_LIBS c_pal clds) diff --git a/tests/clds_hash_table_int/clds_hash_table_int.c b/tests/clds_hash_table_int/clds_hash_table_int.c index 8b89f418..db0064fa 100644 --- a/tests/clds_hash_table_int/clds_hash_table_int.c +++ b/tests/clds_hash_table_int/clds_hash_table_int.c @@ -27,6 +27,7 @@ #include "c_util/cancellation_token.h" #include "c_pal/tqueue.h" +#include "c_pal/timed_test_suite.h" #include "clds/clds_hazard_pointers.h" #include "clds/clds_hash_table.h" @@ -567,12 +568,12 @@ MU_DEFINE_ENUM_STRINGS_WITHOUT_INVALID(CHAOS_TEST_ACTION, CHAOS_TEST_ACTION_VALU BEGIN_TEST_SUITE(TEST_SUITE_NAME_FROM_CMAKE) -TEST_SUITE_INITIALIZE(suite_init) +TIMED_TEST_SUITE_INITIALIZE(suite_init, TIMED_TEST_DEFAULT_TIMEOUT_MS) { gballoc_hl_init(NULL, NULL); } -TEST_SUITE_CLEANUP(suite_cleanup) +TIMED_TEST_SUITE_CLEANUP(suite_cleanup) { gballoc_hl_deinit(); } @@ -2458,4 +2459,4 @@ TEST_FUNCTION(clds_hash_table_chaos_knight_test_with_get_snapshot) clds_hazard_pointers_destroy(hazard_pointers); } -END_TEST_SUITE(TEST_SUITE_NAME_FROM_CMAKE) +END_TEST_SUITE(TEST_SUITE_NAME_FROM_CMAKE) \ No newline at end of file diff --git a/tests/clds_hash_table_snapshot_perf/CMakeLists.txt b/tests/clds_hash_table_snapshot_perf/CMakeLists.txt index 954e456e..91018bc7 100644 --- a/tests/clds_hash_table_snapshot_perf/CMakeLists.txt +++ b/tests/clds_hash_table_snapshot_perf/CMakeLists.txt @@ -12,7 +12,7 @@ set(${theseTestsName}_c_files set(${theseTestsName}_h_files ) -build_test_artifacts(${theseTestsName} "tests/clds" ADDITIONAL_LIBS clds) +build_test_artifacts(${theseTestsName} "tests/clds" ADDITIONAL_LIBS c_pal clds) if("${building}" STREQUAL "exe") copy_thread_notifications_lackey_outputs(${theseTestsName}_exe_${CMAKE_PROJECT_NAME} "$") diff --git a/tests/clds_hash_table_snapshot_perf/clds_hash_table_snapshot_perf.c b/tests/clds_hash_table_snapshot_perf/clds_hash_table_snapshot_perf.c index 035c6a9c..3a6b7f30 100644 --- a/tests/clds_hash_table_snapshot_perf/clds_hash_table_snapshot_perf.c +++ b/tests/clds_hash_table_snapshot_perf/clds_hash_table_snapshot_perf.c @@ -27,13 +27,13 @@ TEST_DEFINE_ENUM_TYPE(CLDS_HASH_TABLE_SNAPSHOT_RESULT, CLDS_HASH_TABLE_SNAPSHOT_ BEGIN_TEST_SUITE(TEST_SUITE_NAME_FROM_CMAKE) -TEST_SUITE_INITIALIZE(suite_init) +TIMED_TEST_SUITE_INITIALIZE(suite_init, TIMED_TEST_DEFAULT_TIMEOUT_MS) { gballoc_hl_init(NULL, NULL); ASSERT_ARE_EQUAL(int, 0, thread_notifications_dispatcher_init()); } -TEST_SUITE_CLEANUP(suite_cleanup) +TIMED_TEST_SUITE_CLEANUP(suite_cleanup) { thread_notifications_dispatcher_deinit(); gballoc_hl_deinit(); diff --git a/tests/clds_hash_table_ut/clds_hash_table_ut.c b/tests/clds_hash_table_ut/clds_hash_table_ut.c index 64217fdf..c3956567 100644 --- a/tests/clds_hash_table_ut/clds_hash_table_ut.c +++ b/tests/clds_hash_table_ut/clds_hash_table_ut.c @@ -80,7 +80,7 @@ DECLARE_HASH_TABLE_NODE_TYPE(TEST_ITEM) BEGIN_TEST_SUITE(TEST_SUITE_NAME_FROM_CMAKE) -TEST_SUITE_INITIALIZE(suite_init) +TIMED_TEST_SUITE_INITIALIZE(suite_init, TIMED_TEST_DEFAULT_TIMEOUT_MS) { ASSERT_ARE_EQUAL(int, 0, real_gballoc_hl_init(NULL, NULL)); @@ -128,7 +128,7 @@ TEST_SUITE_INITIALIZE(suite_init) ASSERT_ARE_EQUAL(int, 0, umock_c_negative_tests_init()); } -TEST_SUITE_CLEANUP(suite_cleanup) +TIMED_TEST_SUITE_CLEANUP(suite_cleanup) { umock_c_negative_tests_deinit(); umock_c_deinit(); diff --git a/tests/clds_hash_table_ut/clds_hash_table_ut_pch.h b/tests/clds_hash_table_ut/clds_hash_table_ut_pch.h index 5bfd15ff..b94a0bac 100644 --- a/tests/clds_hash_table_ut/clds_hash_table_ut_pch.h +++ b/tests/clds_hash_table_ut/clds_hash_table_ut_pch.h @@ -22,6 +22,8 @@ #include "c_pal/interlocked.h" +#include "c_pal/timed_test_suite.h" + #include "umock_c/umock_c_ENABLE_MOCKS.h" // ============================== ENABLE_MOCKS #include "c_pal/gballoc_hl.h" #include "c_pal/gballoc_hl_redirect.h" @@ -45,4 +47,4 @@ #include "clds/clds_hash_table.h" -#endif // CLDS_HASH_TABLE_UT_PCH_H +#endif // CLDS_HASH_TABLE_UT_PCH_H \ No newline at end of file diff --git a/tests/clds_hash_table_with_memory_limit_int/CMakeLists.txt b/tests/clds_hash_table_with_memory_limit_int/CMakeLists.txt index ad0923de..9f98b71b 100644 --- a/tests/clds_hash_table_with_memory_limit_int/CMakeLists.txt +++ b/tests/clds_hash_table_with_memory_limit_int/CMakeLists.txt @@ -12,4 +12,4 @@ set(${theseTestsName}_c_files set(${theseTestsName}_h_files ) -build_test_artifacts(${theseTestsName} "tests/clds" ADDITIONAL_LIBS clds) +build_test_artifacts(${theseTestsName} "tests/clds" ADDITIONAL_LIBS c_pal clds) diff --git a/tests/clds_hash_table_with_memory_limit_int/clds_hash_table_with_memory_limit_int.c b/tests/clds_hash_table_with_memory_limit_int/clds_hash_table_with_memory_limit_int.c index 803c0480..9c581f0f 100644 --- a/tests/clds_hash_table_with_memory_limit_int/clds_hash_table_with_memory_limit_int.c +++ b/tests/clds_hash_table_with_memory_limit_int/clds_hash_table_with_memory_limit_int.c @@ -19,6 +19,7 @@ #include "c_pal/gballoc_hl_redirect.h" #include "c_pal/thandle.h" #include "c_pal/job_object_helper.h" +#include "c_pal/timed_test_suite.h" #include "clds/clds_hazard_pointers.h" #include "clds/clds_hash_table.h" @@ -68,12 +69,12 @@ static void test_skipped_seq_no_ignore(void* context, int64_t skipped_sequence_n BEGIN_TEST_SUITE(TEST_SUITE_NAME_FROM_CMAKE) -TEST_SUITE_INITIALIZE(suite_init) +TIMED_TEST_SUITE_INITIALIZE(suite_init, TIMED_TEST_DEFAULT_TIMEOUT_MS) { gballoc_hl_init(NULL, NULL); } -TEST_SUITE_CLEANUP(suite_cleanup) +TIMED_TEST_SUITE_CLEANUP(suite_cleanup) { gballoc_hl_deinit(); } @@ -164,4 +165,4 @@ TEST_FUNCTION(clds_hash_table_insert_same_block_again_does_not_leak_item_count) THANDLE_ASSIGN(JOB_OBJECT_HELPER)(&job_object_helper, NULL); } -END_TEST_SUITE(TEST_SUITE_NAME_FROM_CMAKE) +END_TEST_SUITE(TEST_SUITE_NAME_FROM_CMAKE) \ No newline at end of file diff --git a/tests/clds_hazard_pointers_thread_helper_perf/CMakeLists.txt b/tests/clds_hazard_pointers_thread_helper_perf/CMakeLists.txt index 667e48b9..5a1dee42 100644 --- a/tests/clds_hazard_pointers_thread_helper_perf/CMakeLists.txt +++ b/tests/clds_hazard_pointers_thread_helper_perf/CMakeLists.txt @@ -12,7 +12,7 @@ set(${theseTestsName}_c_files set(${theseTestsName}_h_files ) -build_test_artifacts(${theseTestsName} "tests/clds" ADDITIONAL_LIBS clds) +build_test_artifacts(${theseTestsName} "tests/clds" ADDITIONAL_LIBS c_pal clds) if("${building}" STREQUAL "exe") copy_thread_notifications_lackey_outputs(${theseTestsName}_exe_${CMAKE_PROJECT_NAME} "$") diff --git a/tests/clds_hazard_pointers_thread_helper_perf/clds_hazard_pointers_thread_helper_perf.c b/tests/clds_hazard_pointers_thread_helper_perf/clds_hazard_pointers_thread_helper_perf.c index 005f9ff2..5815d3eb 100644 --- a/tests/clds_hazard_pointers_thread_helper_perf/clds_hazard_pointers_thread_helper_perf.c +++ b/tests/clds_hazard_pointers_thread_helper_perf/clds_hazard_pointers_thread_helper_perf.c @@ -37,13 +37,13 @@ TEST_DEFINE_ENUM_TYPE(INTERLOCKED_HL_RESULT, INTERLOCKED_HL_RESULT_VALUES); BEGIN_TEST_SUITE(TEST_SUITE_NAME_FROM_CMAKE) -TEST_SUITE_INITIALIZE(suite_init) +TIMED_TEST_SUITE_INITIALIZE(suite_init, TIMED_TEST_DEFAULT_TIMEOUT_MS) { gballoc_hl_init(NULL, NULL); ASSERT_ARE_EQUAL(int, 0, thread_notifications_dispatcher_init()); } -TEST_SUITE_CLEANUP(suite_cleanup) +TIMED_TEST_SUITE_CLEANUP(suite_cleanup) { thread_notifications_dispatcher_deinit(); gballoc_hl_deinit(); diff --git a/tests/clds_hazard_pointers_thread_helper_ut/CMakeLists.txt b/tests/clds_hazard_pointers_thread_helper_ut/CMakeLists.txt index 00a5e9d2..117e024d 100644 --- a/tests/clds_hazard_pointers_thread_helper_ut/CMakeLists.txt +++ b/tests/clds_hazard_pointers_thread_helper_ut/CMakeLists.txt @@ -1,4 +1,4 @@ -#Copyright (c) Microsoft. All rights reserved. +#Copyright (c) Microsoft. All rights reserved. set(theseTestsName clds_hazard_pointers_thread_helper_ut) @@ -14,5 +14,5 @@ set(${theseTestsName}_h_files ../../inc/clds/clds_hazard_pointers_thread_helper.h ) -build_test_artifacts(${theseTestsName} "tests/clds" ADDITIONAL_LIBS c_pal_reals c_pal_umocktypes thread_notifications_lackey_dll clds_reals +build_test_artifacts(${theseTestsName} "tests/clds" ADDITIONAL_LIBS c_pal c_pal_reals c_pal_umocktypes thread_notifications_lackey_dll clds_reals ENABLE_TEST_FILES_PRECOMPILED_HEADERS "${CMAKE_CURRENT_LIST_DIR}/clds_hazard_pointers_thread_helper_ut_pch.h") diff --git a/tests/clds_hazard_pointers_thread_helper_ut/clds_hazard_pointers_thread_helper_ut.c b/tests/clds_hazard_pointers_thread_helper_ut/clds_hazard_pointers_thread_helper_ut.c index 2c7e5c76..5bb94506 100644 --- a/tests/clds_hazard_pointers_thread_helper_ut/clds_hazard_pointers_thread_helper_ut.c +++ b/tests/clds_hazard_pointers_thread_helper_ut/clds_hazard_pointers_thread_helper_ut.c @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All rights reserved. +// Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license.See LICENSE file in the project root for full license information. #include "clds_hazard_pointers_thread_helper_ut_pch.h" @@ -99,7 +99,7 @@ static TCALL_DISPATCHER(THREAD_NOTIFICATION_CALL) hook_thread_notifications_disp BEGIN_TEST_SUITE(TEST_SUITE_NAME_FROM_CMAKE) -TEST_SUITE_INITIALIZE(suite_init) +TIMED_TEST_SUITE_INITIALIZE(suite_init, TIMED_TEST_DEFAULT_TIMEOUT_MS) { ASSERT_ARE_EQUAL(int, 0, real_gballoc_hl_init(NULL, NULL)); @@ -129,7 +129,7 @@ TEST_SUITE_INITIALIZE(suite_init) REGISTER_UMOCKC_PAIRED_CREATE_DESTROY_CALLS(mocked_TlsAlloc, mocked_TlsFree); } -TEST_SUITE_CLEANUP(suite_cleanup) +TIMED_TEST_SUITE_CLEANUP(suite_cleanup) { TCALL_DISPATCHER_ASSIGN(real_THREAD_NOTIFICATION_CALL)(&g.thread_notification_call_dispatcher, NULL); diff --git a/tests/clds_hazard_pointers_thread_helper_ut/clds_hazard_pointers_thread_helper_ut_pch.h b/tests/clds_hazard_pointers_thread_helper_ut/clds_hazard_pointers_thread_helper_ut_pch.h index 78e2449e..935cf988 100644 --- a/tests/clds_hazard_pointers_thread_helper_ut/clds_hazard_pointers_thread_helper_ut_pch.h +++ b/tests/clds_hazard_pointers_thread_helper_ut/clds_hazard_pointers_thread_helper_ut_pch.h @@ -21,6 +21,8 @@ #include "c_pal/interlocked.h" /*included for mocking reasons - it will prohibit creation of mocks belonging to interlocked.h - at the moment verified through int tests - this is porting legacy code, temporary solution*/ +#include "c_pal/timed_test_suite.h" + #include "umock_c/umock_c_ENABLE_MOCKS.h" // ============================== ENABLE_MOCKS #include "c_pal/gballoc_hl.h" #include "c_pal/gballoc_hl_redirect.h" @@ -38,4 +40,4 @@ #include "clds/clds_hazard_pointers_thread_helper.h" -#endif // CLDS_HAZARD_POINTERS_THREAD_HELPER_UT_PCH_H +#endif // CLDS_HAZARD_POINTERS_THREAD_HELPER_UT_PCH_H \ No newline at end of file diff --git a/tests/clds_hazard_pointers_ut/clds_hazard_pointers_ut.c b/tests/clds_hazard_pointers_ut/clds_hazard_pointers_ut.c index 9ad247c3..9fe0060b 100644 --- a/tests/clds_hazard_pointers_ut/clds_hazard_pointers_ut.c +++ b/tests/clds_hazard_pointers_ut/clds_hazard_pointers_ut.c @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All rights reserved. +// Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license.See LICENSE file in the project root for full license information. #include "clds_hazard_pointers_ut_pch.h" @@ -27,7 +27,7 @@ static WORKER_THREAD_HANDLE test_worker_thread = (WORKER_THREAD_HANDLE)0x4242; BEGIN_TEST_SUITE(TEST_SUITE_NAME_FROM_CMAKE) -TEST_SUITE_INITIALIZE(suite_init) +TIMED_TEST_SUITE_INITIALIZE(suite_init, TIMED_TEST_DEFAULT_TIMEOUT_MS) { ASSERT_ARE_EQUAL(int, 0, real_gballoc_hl_init(NULL, NULL)); @@ -47,7 +47,7 @@ TEST_SUITE_INITIALIZE(suite_init) REGISTER_UMOCK_ALIAS_TYPE(WORKER_THREAD_HANDLE, void*); } -TEST_SUITE_CLEANUP(suite_cleanup) +TIMED_TEST_SUITE_CLEANUP(suite_cleanup) { umock_c_deinit(); diff --git a/tests/clds_hazard_pointers_ut/clds_hazard_pointers_ut_pch.h b/tests/clds_hazard_pointers_ut/clds_hazard_pointers_ut_pch.h index d96acf44..49cf6f0f 100644 --- a/tests/clds_hazard_pointers_ut/clds_hazard_pointers_ut_pch.h +++ b/tests/clds_hazard_pointers_ut/clds_hazard_pointers_ut_pch.h @@ -20,6 +20,8 @@ #include "clds/clds_hazard_pointers.h" +#include "c_pal/timed_test_suite.h" + #include "umock_c/umock_c_ENABLE_MOCKS.h" // ============================== ENABLE_MOCKS #include "c_pal/gballoc_hl.h" @@ -34,4 +36,4 @@ #include "real_gballoc_hl.h" #include "real_inactive_hp_thread_queue.h" -#endif // CLDS_HAZARD_POINTERS_UT_PCH_H +#endif // CLDS_HAZARD_POINTERS_UT_PCH_H \ No newline at end of file diff --git a/tests/clds_singly_linked_list_int/CMakeLists.txt b/tests/clds_singly_linked_list_int/CMakeLists.txt index 537bcf56..f7825393 100644 --- a/tests/clds_singly_linked_list_int/CMakeLists.txt +++ b/tests/clds_singly_linked_list_int/CMakeLists.txt @@ -12,4 +12,4 @@ set(${theseTestsName}_c_files set(${theseTestsName}_h_files ) -build_test_artifacts(${theseTestsName} "tests/clds" ADDITIONAL_LIBS clds) +build_test_artifacts(${theseTestsName} "tests/clds" ADDITIONAL_LIBS c_pal clds) diff --git a/tests/clds_singly_linked_list_int/clds_singly_linked_list_int.c b/tests/clds_singly_linked_list_int/clds_singly_linked_list_int.c index 497a0b50..547e46f3 100644 --- a/tests/clds_singly_linked_list_int/clds_singly_linked_list_int.c +++ b/tests/clds_singly_linked_list_int/clds_singly_linked_list_int.c @@ -17,6 +17,7 @@ #include "c_pal/gballoc_hl_redirect.h" #include "c_pal/interlocked.h" #include "c_pal/threadapi.h" +#include "c_pal/timed_test_suite.h" #include "clds/clds_hazard_pointers.h" @@ -91,12 +92,12 @@ MU_DEFINE_ENUM_WITHOUT_INVALID(CHAOS_TEST_ACTION, CHAOS_TEST_ACTION_VALUES); BEGIN_TEST_SUITE(TEST_SUITE_NAME_FROM_CMAKE) -TEST_SUITE_INITIALIZE(suite_init) +TIMED_TEST_SUITE_INITIALIZE(suite_init, TIMED_TEST_DEFAULT_TIMEOUT_MS) { ASSERT_ARE_EQUAL(int, 0, gballoc_hl_init(NULL, NULL)); } -TEST_SUITE_CLEANUP(suite_cleanup) +TIMED_TEST_SUITE_CLEANUP(suite_cleanup) { gballoc_hl_deinit(); } @@ -319,4 +320,4 @@ TEST_FUNCTION(clds_singly_linked_list_chaos_knight_test) } #endif -END_TEST_SUITE(TEST_SUITE_NAME_FROM_CMAKE) +END_TEST_SUITE(TEST_SUITE_NAME_FROM_CMAKE) \ No newline at end of file diff --git a/tests/clds_singly_linked_list_ut/clds_singly_linked_list_ut.c b/tests/clds_singly_linked_list_ut/clds_singly_linked_list_ut.c index a10bc200..0f108aee 100644 --- a/tests/clds_singly_linked_list_ut/clds_singly_linked_list_ut.c +++ b/tests/clds_singly_linked_list_ut/clds_singly_linked_list_ut.c @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All rights reserved. +// Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license.See LICENSE file in the project root for full license information. #include "clds_singly_linked_list_ut_pch.h" @@ -57,7 +57,7 @@ DECLARE_SINGLY_LINKED_LIST_NODE_TYPE(TEST_ITEM) BEGIN_TEST_SUITE(TEST_SUITE_NAME_FROM_CMAKE) -TEST_SUITE_INITIALIZE(suite_init) +TIMED_TEST_SUITE_INITIALIZE(suite_init, TIMED_TEST_DEFAULT_TIMEOUT_MS) { int result; @@ -83,7 +83,7 @@ TEST_SUITE_INITIALIZE(suite_init) REGISTER_UMOCK_ALIAS_TYPE(CLDS_ST_HASH_SET_KEY_COMPARE_FUNC, void*); } -TEST_SUITE_CLEANUP(suite_cleanup) +TIMED_TEST_SUITE_CLEANUP(suite_cleanup) { umock_c_deinit(); diff --git a/tests/clds_singly_linked_list_ut/clds_singly_linked_list_ut_pch.h b/tests/clds_singly_linked_list_ut/clds_singly_linked_list_ut_pch.h index 262c28a2..1cd228b6 100644 --- a/tests/clds_singly_linked_list_ut/clds_singly_linked_list_ut_pch.h +++ b/tests/clds_singly_linked_list_ut/clds_singly_linked_list_ut_pch.h @@ -16,6 +16,8 @@ #include "umock_c/umock_c.h" #include "umock_c/umocktypes_stdint.h" +#include "c_pal/timed_test_suite.h" + #include "umock_c/umock_c_ENABLE_MOCKS.h" // ============================== ENABLE_MOCKS #include "c_pal/gballoc_hl.h" @@ -31,4 +33,4 @@ #include "clds/clds_singly_linked_list.h" -#endif // CLDS_SINGLY_LINKED_LIST_UT_PCH_H +#endif // CLDS_SINGLY_LINKED_LIST_UT_PCH_H \ No newline at end of file diff --git a/tests/clds_sorted_list_int/CMakeLists.txt b/tests/clds_sorted_list_int/CMakeLists.txt index 842b50a9..61068b71 100644 --- a/tests/clds_sorted_list_int/CMakeLists.txt +++ b/tests/clds_sorted_list_int/CMakeLists.txt @@ -12,4 +12,4 @@ set(${theseTestsName}_c_files set(${theseTestsName}_h_files ) -build_test_artifacts(${theseTestsName} "tests/clds" ADDITIONAL_LIBS clds) +build_test_artifacts(${theseTestsName} "tests/clds" ADDITIONAL_LIBS c_pal clds) diff --git a/tests/clds_sorted_list_int/clds_sorted_list_int.c b/tests/clds_sorted_list_int/clds_sorted_list_int.c index 11a7ee80..d51d4527 100644 --- a/tests/clds_sorted_list_int/clds_sorted_list_int.c +++ b/tests/clds_sorted_list_int/clds_sorted_list_int.c @@ -21,6 +21,7 @@ #include "c_pal/uuid.h" #include "c_pal/interlocked_hl.h" +#include "c_pal/timed_test_suite.h" #include "c_util/uuid_string.h" #include "clds/clds_hazard_pointers.h" @@ -201,12 +202,12 @@ MU_DEFINE_ENUM_WITHOUT_INVALID(CHAOS_TEST_ACTION, CHAOS_TEST_ACTION_VALUES); BEGIN_TEST_SUITE(TEST_SUITE_NAME_FROM_CMAKE) -TEST_SUITE_INITIALIZE(suite_init) +TIMED_TEST_SUITE_INITIALIZE(suite_init, TIMED_TEST_DEFAULT_TIMEOUT_MS) { ASSERT_ARE_EQUAL(int, 0, gballoc_hl_init(NULL, NULL)); } -TEST_SUITE_CLEANUP(suite_cleanup) +TIMED_TEST_SUITE_CLEANUP(suite_cleanup) { gballoc_hl_deinit(); } @@ -1877,4 +1878,4 @@ TEST_FUNCTION(clds_sorted_list_chaos_knight_test) clds_hazard_pointers_destroy(hazard_pointers); } -END_TEST_SUITE(TEST_SUITE_NAME_FROM_CMAKE) +END_TEST_SUITE(TEST_SUITE_NAME_FROM_CMAKE) \ No newline at end of file diff --git a/tests/clds_sorted_list_ut/clds_sorted_list_ut.c b/tests/clds_sorted_list_ut/clds_sorted_list_ut.c index 40f78b8b..dfe64fa5 100644 --- a/tests/clds_sorted_list_ut/clds_sorted_list_ut.c +++ b/tests/clds_sorted_list_ut/clds_sorted_list_ut.c @@ -80,7 +80,7 @@ static int test_key_compare(void* context, void* key1, void* key2) BEGIN_TEST_SUITE(TEST_SUITE_NAME_FROM_CMAKE) -TEST_SUITE_INITIALIZE(suite_init) +TIMED_TEST_SUITE_INITIALIZE(suite_init, TIMED_TEST_DEFAULT_TIMEOUT_MS) { int result; @@ -113,7 +113,7 @@ TEST_SUITE_INITIALIZE(suite_init) REGISTER_UMOCK_ALIAS_TYPE(CLDS_ST_HASH_SET_KEY_COMPARE_FUNC, void*); } -TEST_SUITE_CLEANUP(suite_cleanup) +TIMED_TEST_SUITE_CLEANUP(suite_cleanup) { umock_c_deinit(); diff --git a/tests/clds_sorted_list_ut/clds_sorted_list_ut_pch.h b/tests/clds_sorted_list_ut/clds_sorted_list_ut_pch.h index 9d2bfb04..5792bcd3 100644 --- a/tests/clds_sorted_list_ut/clds_sorted_list_ut_pch.h +++ b/tests/clds_sorted_list_ut/clds_sorted_list_ut_pch.h @@ -18,6 +18,8 @@ #include "umock_c/umocktypes_stdint.h" #include "c_pal/interlocked.h" +#include "c_pal/timed_test_suite.h" + #include "umock_c/umock_c_ENABLE_MOCKS.h" // ============================== ENABLE_MOCKS #include "c_pal/gballoc_hl.h" @@ -33,4 +35,4 @@ #include "../reals/real_clds_st_hash_set.h" #include "../reals/real_clds_hazard_pointers.h" -#endif // CLDS_SORTED_LIST_UT_PCH_H +#endif // CLDS_SORTED_LIST_UT_PCH_H \ No newline at end of file diff --git a/tests/clds_st_hash_set_ut/CMakeLists.txt b/tests/clds_st_hash_set_ut/CMakeLists.txt index 389d8158..e8d19341 100644 --- a/tests/clds_st_hash_set_ut/CMakeLists.txt +++ b/tests/clds_st_hash_set_ut/CMakeLists.txt @@ -1,4 +1,4 @@ -#Licensed under the MIT license. See LICENSE file in the project root for full license information. +#Licensed under the MIT license. See LICENSE file in the project root for full license information. set(theseTestsName clds_st_hash_set_ut) @@ -14,5 +14,5 @@ set(${theseTestsName}_h_files ../../inc/clds/clds_st_hash_set.h ) -build_test_artifacts(${theseTestsName} "tests/clds" ADDITIONAL_LIBS c_pal_reals +build_test_artifacts(${theseTestsName} "tests/clds" ADDITIONAL_LIBS c_pal c_pal_reals ENABLE_TEST_FILES_PRECOMPILED_HEADERS "${CMAKE_CURRENT_LIST_DIR}/clds_st_hash_set_ut_pch.h") diff --git a/tests/clds_st_hash_set_ut/clds_st_hash_set_ut.c b/tests/clds_st_hash_set_ut/clds_st_hash_set_ut.c index 2f5ba554..5c1d14bf 100644 --- a/tests/clds_st_hash_set_ut/clds_st_hash_set_ut.c +++ b/tests/clds_st_hash_set_ut/clds_st_hash_set_ut.c @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All rights reserved. +// Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license.See LICENSE file in the project root for full license information. #include "clds_st_hash_set_ut_pch.h" @@ -35,7 +35,7 @@ MOCK_FUNCTION_END(0) BEGIN_TEST_SUITE(TEST_SUITE_NAME_FROM_CMAKE) -TEST_SUITE_INITIALIZE(suite_init) +TIMED_TEST_SUITE_INITIALIZE(suite_init, TIMED_TEST_DEFAULT_TIMEOUT_MS) { int result; @@ -56,7 +56,7 @@ TEST_SUITE_INITIALIZE(suite_init) REGISTER_TYPE(CLDS_ST_HASH_SET_FIND_RESULT, CLDS_ST_HASH_SET_FIND_RESULT); } -TEST_SUITE_CLEANUP(suite_cleanup) +TIMED_TEST_SUITE_CLEANUP(suite_cleanup) { umock_c_deinit(); diff --git a/tests/clds_st_hash_set_ut/clds_st_hash_set_ut_pch.h b/tests/clds_st_hash_set_ut/clds_st_hash_set_ut_pch.h index 61e7d600..a231b454 100644 --- a/tests/clds_st_hash_set_ut/clds_st_hash_set_ut_pch.h +++ b/tests/clds_st_hash_set_ut/clds_st_hash_set_ut_pch.h @@ -16,6 +16,8 @@ #include "umock_c/umock_c.h" #include "umock_c/umocktypes_stdint.h" +#include "c_pal/timed_test_suite.h" + #include "umock_c/umock_c_ENABLE_MOCKS.h" // ============================== ENABLE_MOCKS #include "c_pal/gballoc_hl.h" @@ -27,4 +29,4 @@ #include "clds/clds_st_hash_set.h" -#endif // CLDS_ST_HASH_SET_UT_PCH_H +#endif // CLDS_ST_HASH_SET_UT_PCH_H \ No newline at end of file diff --git a/tests/lock_free_set_int/lock_free_set_int.c b/tests/lock_free_set_int/lock_free_set_int.c index 59dbb555..be09a670 100644 --- a/tests/lock_free_set_int/lock_free_set_int.c +++ b/tests/lock_free_set_int/lock_free_set_int.c @@ -9,6 +9,7 @@ #include "c_pal/gballoc_hl.h" #include "c_pal/gballoc_hl_redirect.h" #include "c_pal/threadapi.h" +#include "c_pal/timed_test_suite.h" #include "clds/lock_free_set.h" @@ -55,12 +56,12 @@ TEST_DEFINE_ENUM_TYPE(THREADAPI_RESULT, THREADAPI_RESULT_VALUES); BEGIN_TEST_SUITE(TEST_SUITE_NAME_FROM_CMAKE) -TEST_SUITE_INITIALIZE(suite_init) +TIMED_TEST_SUITE_INITIALIZE(suite_init, TIMED_TEST_DEFAULT_TIMEOUT_MS) { ASSERT_ARE_EQUAL(int, 0, gballoc_hl_init(NULL, NULL)); } -TEST_SUITE_CLEANUP(suite_cleanup) +TIMED_TEST_SUITE_CLEANUP(suite_cleanup) { gballoc_hl_deinit(); } @@ -129,4 +130,4 @@ TEST_FUNCTION(lock_free_set_insert_remove_succeeds) free(thread_data); } -END_TEST_SUITE(TEST_SUITE_NAME_FROM_CMAKE) +END_TEST_SUITE(TEST_SUITE_NAME_FROM_CMAKE) \ No newline at end of file diff --git a/tests/lock_free_set_ut/lock_free_set_ut.c b/tests/lock_free_set_ut/lock_free_set_ut.c index 40608008..e0f3064a 100644 --- a/tests/lock_free_set_ut/lock_free_set_ut.c +++ b/tests/lock_free_set_ut/lock_free_set_ut.c @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All rights reserved. +// Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license.See LICENSE file in the project root for full license information. #include "lock_free_set_ut_pch.h" @@ -24,7 +24,7 @@ MOCK_FUNCTION_END() BEGIN_TEST_SUITE(TEST_SUITE_NAME_FROM_CMAKE) -TEST_SUITE_INITIALIZE(suite_init) +TIMED_TEST_SUITE_INITIALIZE(suite_init, TIMED_TEST_DEFAULT_TIMEOUT_MS) { int result; @@ -38,7 +38,7 @@ TEST_SUITE_INITIALIZE(suite_init) REGISTER_GBALLOC_HL_GLOBAL_MOCK_HOOK(); } -TEST_SUITE_CLEANUP(suite_cleanup) +TIMED_TEST_SUITE_CLEANUP(suite_cleanup) { umock_c_deinit(); diff --git a/tests/lock_free_set_ut/lock_free_set_ut_pch.h b/tests/lock_free_set_ut/lock_free_set_ut_pch.h index 847e7857..06e0b049 100644 --- a/tests/lock_free_set_ut/lock_free_set_ut_pch.h +++ b/tests/lock_free_set_ut/lock_free_set_ut_pch.h @@ -18,6 +18,8 @@ #include "umock_c/umocktypes_bool.h" #include "c_pal/interlocked.h" +#include "c_pal/timed_test_suite.h" + #include "umock_c/umock_c_ENABLE_MOCKS.h" // ============================== ENABLE_MOCKS #include "c_pal/gballoc_hl.h" @@ -29,4 +31,4 @@ #include "clds/lock_free_set.h" -#endif // LOCK_FREE_SET_UT_PCH_H +#endif // LOCK_FREE_SET_UT_PCH_H \ No newline at end of file diff --git a/tests/lru_cache_int/CMakeLists.txt b/tests/lru_cache_int/CMakeLists.txt index 370eee49..b49bd189 100644 --- a/tests/lru_cache_int/CMakeLists.txt +++ b/tests/lru_cache_int/CMakeLists.txt @@ -12,7 +12,7 @@ set(${theseTestsName}_c_files set(${theseTestsName}_h_files ) -build_test_artifacts(${theseTestsName} "tests/clds" ADDITIONAL_LIBS clds) +build_test_artifacts(${theseTestsName} "tests/clds" ADDITIONAL_LIBS c_pal clds) if("${building}" STREQUAL "exe") copy_thread_notifications_lackey_outputs(${theseTestsName}_exe_${CMAKE_PROJECT_NAME} "$") diff --git a/tests/lru_cache_int/lru_cache_int.c b/tests/lru_cache_int/lru_cache_int.c index 9fdd4f06..45a20566 100644 --- a/tests/lru_cache_int/lru_cache_int.c +++ b/tests/lru_cache_int/lru_cache_int.c @@ -21,6 +21,7 @@ #include "c_pal/sync.h" #include "c_pal/gballoc_hl.h" #include "c_pal/gballoc_hl_redirect.h" +#include "c_pal/timed_test_suite.h" #include "clds/clds_hazard_pointers.h" #include "clds/clds_hash_table.h" @@ -171,12 +172,12 @@ static int key_compare(void* key_1, void* key_2) BEGIN_TEST_SUITE(TEST_SUITE_NAME_FROM_CMAKE) -TEST_SUITE_INITIALIZE(suite_init) +TIMED_TEST_SUITE_INITIALIZE(suite_init, TIMED_TEST_DEFAULT_TIMEOUT_MS) { ASSERT_ARE_EQUAL(int, 0, gballoc_hl_init(NULL, NULL)); } -TEST_SUITE_CLEANUP(suite_cleanup) +TIMED_TEST_SUITE_CLEANUP(suite_cleanup) { gballoc_hl_deinit(); } @@ -1437,4 +1438,4 @@ TEST_FUNCTION(test_lru_cache_evict_does_not_change_order_when_head_key_is_remove clds_hazard_pointers_destroy(hazard_pointers); } -END_TEST_SUITE(TEST_SUITE_NAME_FROM_CMAKE) +END_TEST_SUITE(TEST_SUITE_NAME_FROM_CMAKE) \ No newline at end of file diff --git a/tests/lru_cache_ut/lru_cache_ut.c b/tests/lru_cache_ut/lru_cache_ut.c index cbc0ab92..217e3543 100644 --- a/tests/lru_cache_ut/lru_cache_ut.c +++ b/tests/lru_cache_ut/lru_cache_ut.c @@ -85,7 +85,7 @@ MOCK_FUNCTION_END() BEGIN_TEST_SUITE(TEST_SUITE_NAME_FROM_CMAKE) -TEST_SUITE_INITIALIZE(suite_init) +TIMED_TEST_SUITE_INITIALIZE(suite_init, TIMED_TEST_DEFAULT_TIMEOUT_MS) { ASSERT_ARE_EQUAL(int, 0, real_gballoc_hl_init(NULL, NULL)); @@ -137,7 +137,7 @@ TEST_SUITE_INITIALIZE(suite_init) } -TEST_SUITE_CLEANUP(suite_cleanup) +TIMED_TEST_SUITE_CLEANUP(suite_cleanup) { real_clds_hazard_pointers_thread_helper_destroy(test_clds_hazard_pointers_thread_helper); real_clds_hazard_pointers_destroy(test_clds_hazard_pointers); diff --git a/tests/lru_cache_ut/lru_cache_ut_pch.h b/tests/lru_cache_ut/lru_cache_ut_pch.h index 223b6042..e08ec616 100644 --- a/tests/lru_cache_ut/lru_cache_ut_pch.h +++ b/tests/lru_cache_ut/lru_cache_ut_pch.h @@ -22,6 +22,8 @@ // Task 25774695: Fix mocking for interlocked when using reals hazard pointers #include "c_pal/interlocked.h" +#include "c_pal/timed_test_suite.h" + #include "umock_c/umock_c_ENABLE_MOCKS.h" // ============================== ENABLE_MOCKS #include "c_pal/gballoc_hl.h" @@ -49,4 +51,4 @@ #include "clds/lru_cache.h" -#endif // LRU_CACHE_UT_PCH_H +#endif // LRU_CACHE_UT_PCH_H \ No newline at end of file diff --git a/tests/mpsc_lock_free_queue_int/CMakeLists.txt b/tests/mpsc_lock_free_queue_int/CMakeLists.txt index d50afc70..bab20589 100644 --- a/tests/mpsc_lock_free_queue_int/CMakeLists.txt +++ b/tests/mpsc_lock_free_queue_int/CMakeLists.txt @@ -13,4 +13,4 @@ set(${theseTestsName}_c_files set(${theseTestsName}_h_files ) -build_test_artifacts(${theseTestsName} "tests/clds" ADDITIONAL_LIBS c_util) +build_test_artifacts(${theseTestsName} "tests/clds" ADDITIONAL_LIBS c_pal c_util) diff --git a/tests/mpsc_lock_free_queue_int/mpsc_lock_free_queue_int.c b/tests/mpsc_lock_free_queue_int/mpsc_lock_free_queue_int.c index aeb1a7f9..157742ed 100644 --- a/tests/mpsc_lock_free_queue_int/mpsc_lock_free_queue_int.c +++ b/tests/mpsc_lock_free_queue_int/mpsc_lock_free_queue_int.c @@ -9,6 +9,7 @@ #include "c_pal/gballoc_hl.h" #include "c_pal/gballoc_hl_redirect.h" #include "c_pal/threadapi.h" +#include "c_pal/timed_test_suite.h" #include "clds/mpsc_lock_free_queue.h" @@ -69,12 +70,12 @@ TEST_DEFINE_ENUM_TYPE(THREADAPI_RESULT, THREADAPI_RESULT_VALUES); BEGIN_TEST_SUITE(TEST_SUITE_NAME_FROM_CMAKE) -TEST_SUITE_INITIALIZE(suite_init) +TIMED_TEST_SUITE_INITIALIZE(suite_init, TIMED_TEST_DEFAULT_TIMEOUT_MS) { ASSERT_ARE_EQUAL(int, 0, gballoc_hl_init(NULL, NULL)); } -TEST_SUITE_CLEANUP(suite_cleanup) +TIMED_TEST_SUITE_CLEANUP(suite_cleanup) { gballoc_hl_deinit(); } @@ -150,4 +151,4 @@ TEST_FUNCTION(multiple_threads_adding_and_one_consuming_succeeds) free(thread_data); } -END_TEST_SUITE(TEST_SUITE_NAME_FROM_CMAKE) +END_TEST_SUITE(TEST_SUITE_NAME_FROM_CMAKE) \ No newline at end of file diff --git a/tests/mpsc_lock_free_queue_ut/mpsc_lock_free_queue_ut.c b/tests/mpsc_lock_free_queue_ut/mpsc_lock_free_queue_ut.c index 9a686a9a..e908fc2b 100644 --- a/tests/mpsc_lock_free_queue_ut/mpsc_lock_free_queue_ut.c +++ b/tests/mpsc_lock_free_queue_ut/mpsc_lock_free_queue_ut.c @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All rights reserved. +// Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license.See LICENSE file in the project root for full license information. #include "mpsc_lock_free_queue_ut_pch.h" @@ -21,7 +21,7 @@ static void on_umock_c_error(UMOCK_C_ERROR_CODE error_code) BEGIN_TEST_SUITE(TEST_SUITE_NAME_FROM_CMAKE) -TEST_SUITE_INITIALIZE(suite_init) +TIMED_TEST_SUITE_INITIALIZE(suite_init, TIMED_TEST_DEFAULT_TIMEOUT_MS) { int result; @@ -36,7 +36,7 @@ TEST_SUITE_INITIALIZE(suite_init) REGISTER_GLOBAL_MOCK_HOOK(free, real_free); } -TEST_SUITE_CLEANUP(suite_cleanup) +TIMED_TEST_SUITE_CLEANUP(suite_cleanup) { umock_c_deinit(); diff --git a/tests/mpsc_lock_free_queue_ut/mpsc_lock_free_queue_ut_pch.h b/tests/mpsc_lock_free_queue_ut/mpsc_lock_free_queue_ut_pch.h index fb7ae8a9..64ac218a 100644 --- a/tests/mpsc_lock_free_queue_ut/mpsc_lock_free_queue_ut_pch.h +++ b/tests/mpsc_lock_free_queue_ut/mpsc_lock_free_queue_ut_pch.h @@ -17,6 +17,8 @@ #include "umock_c/umock_c.h" #include "umock_c/umocktypes_bool.h" +#include "c_pal/timed_test_suite.h" + #include "umock_c/umock_c_ENABLE_MOCKS.h" // ============================== ENABLE_MOCKS #include "c_pal/gballoc_hl.h" @@ -28,4 +30,4 @@ #include "clds/mpsc_lock_free_queue.h" -#endif // MPSC_LOCK_FREE_QUEUE_UT_PCH_H +#endif // MPSC_LOCK_FREE_QUEUE_UT_PCH_H \ No newline at end of file diff --git a/tests/reals_ut/CMakeLists.txt b/tests/reals_ut/CMakeLists.txt index c417ea49..deb3a97b 100644 --- a/tests/reals_ut/CMakeLists.txt +++ b/tests/reals_ut/CMakeLists.txt @@ -1,4 +1,4 @@ -#Copyright (c) Microsoft. All rights reserved. +#Copyright (c) Microsoft. All rights reserved. #Licensed under the MIT license. See LICENSE file in the project root for full license information. set(theseTestsName clds_reals_ut) @@ -13,7 +13,7 @@ set(${theseTestsName}_c_files set(${theseTestsName}_h_files ) -build_test_artifacts(${theseTestsName} "tests/clds" ADDITIONAL_LIBS c_pal_reals clds_reals +build_test_artifacts(${theseTestsName} "tests/clds" ADDITIONAL_LIBS c_pal c_pal_reals clds_reals ENABLE_TEST_FILES_PRECOMPILED_HEADERS "${CMAKE_CURRENT_LIST_DIR}/clds_reals_ut_pch.h") if(WIN32) diff --git a/tests/reals_ut/clds_reals_ut_pch.h b/tests/reals_ut/clds_reals_ut_pch.h index 072a4518..1c7f7b6e 100644 --- a/tests/reals_ut/clds_reals_ut_pch.h +++ b/tests/reals_ut/clds_reals_ut_pch.h @@ -9,6 +9,8 @@ #include "testrunnerswitcher.h" #include "umock_c/umock_c.h" +#include "c_pal/timed_test_suite.h" + #include "umock_c/umock_c_ENABLE_MOCKS.h" // ============================== ENABLE_MOCKS #if WIN32 @@ -37,4 +39,4 @@ #include "../tests/reals/real_mpsc_lock_free_queue.h" #include "../tests/reals/real_inactive_hp_thread_queue.h" -#endif // CLDS_REALS_UT_PCH_H +#endif // CLDS_REALS_UT_PCH_H \ No newline at end of file