diff --git a/build_functions/c_util_suppressions.sup b/build_functions/c_util_suppressions.sup index 011144a2..1cfa49a9 100644 --- a/build_functions/c_util_suppressions.sup +++ b/build_functions/c_util_suppressions.sup @@ -6,6 +6,19 @@ fun:timer_create@@GLIBC_2.3.3 ... } +{ + + Memcheck:Leak + match-leak-kinds: possible + fun:calloc + ... + fun:allocate_dtv + fun:_dl_allocate_tls + fun:allocate_stack + fun:pthread_create@@GLIBC_* + fun:timer_helper_thread + fun:start_thread +} { Helgrind:Race diff --git a/samples/async_op_samples_int/CMakeLists.txt b/samples/async_op_samples_int/CMakeLists.txt index 7caf66c0..3f15c3e1 100644 --- a/samples/async_op_samples_int/CMakeLists.txt +++ b/samples/async_op_samples_int/CMakeLists.txt @@ -28,4 +28,4 @@ set(${theseTestsName}_h_files ml_async_op_module_with_retries.h ) -build_test_artifacts(${theseTestsName} "samples" ADDITIONAL_LIBS c_util) +build_test_artifacts(${theseTestsName} "samples" ADDITIONAL_LIBS c_pal c_util) diff --git a/samples/async_op_samples_int/async_op_samples_int.c b/samples/async_op_samples_int/async_op_samples_int.c index 72ef93e6..1b0bc971 100644 --- a/samples/async_op_samples_int/async_op_samples_int.c +++ b/samples/async_op_samples_int/async_op_samples_int.c @@ -16,6 +16,7 @@ #include "c_pal/sync.h" #include "c_pal/thandle.h" #include "c_pal/threadapi.h" +#include "c_pal/timed_test_suite.h" #include "c_util/async_op.h" @@ -366,12 +367,12 @@ static void test_ASYNC_OP_MODULE_CALLBACK(void* context, COMMON_ASYNC_OP_MODULE_ BEGIN_TEST_SUITE(TEST_SUITE_NAME_FROM_CMAKE) -TEST_SUITE_INITIALIZE(TestClassInit) +TIMED_TEST_SUITE_INITIALIZE(TestClassInit, TIMED_TEST_DEFAULT_TIMEOUT_MS) { ASSERT_ARE_EQUAL(int, 0, gballoc_hl_init(NULL, NULL)); } -TEST_SUITE_CLEANUP(TestClassCleanup) +TIMED_TEST_SUITE_CLEANUP(TestClassCleanup) { gballoc_hl_deinit(); } diff --git a/tests/async_op_int/CMakeLists.txt b/tests/async_op_int/CMakeLists.txt index d1e64a6f..da79dbee 100644 --- a/tests/async_op_int/CMakeLists.txt +++ b/tests/async_op_int/CMakeLists.txt @@ -13,4 +13,4 @@ set(${theseTestsName}_c_files set(${theseTestsName}_h_files ) -build_test_artifacts(${theseTestsName} "tests/c_util" ADDITIONAL_LIBS c_util) +build_test_artifacts(${theseTestsName} "tests/c_util" ADDITIONAL_LIBS c_pal c_util) diff --git a/tests/async_op_int/async_op_int.c b/tests/async_op_int/async_op_int.c index 6c30ad86..8db355e9 100644 --- a/tests/async_op_int/async_op_int.c +++ b/tests/async_op_int/async_op_int.c @@ -15,6 +15,7 @@ #include "c_pal/gballoc_hl_redirect.h" #include "c_pal/thandle.h" +#include "c_pal/timed_test_suite.h" #include "c_util/async_op.h" @@ -84,12 +85,12 @@ static ASYNC_OP_DISPOSE disposes[] = BEGIN_TEST_SUITE(TEST_SUITE_NAME_FROM_CMAKE) -TEST_SUITE_INITIALIZE(setsBufferTempSize) +TIMED_TEST_SUITE_INITIALIZE(setsBufferTempSize, TIMED_TEST_DEFAULT_TIMEOUT_MS) { ASSERT_ARE_EQUAL(int, 0, gballoc_hl_init(NULL, NULL)); } -TEST_SUITE_CLEANUP(TestClassCleanup) +TIMED_TEST_SUITE_CLEANUP(TestClassCleanup) { gballoc_hl_deinit(); } diff --git a/tests/async_op_ut/CMakeLists.txt b/tests/async_op_ut/CMakeLists.txt index 73777125..6b44c906 100644 --- a/tests/async_op_ut/CMakeLists.txt +++ b/tests/async_op_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 async_op_ut) @@ -15,6 +15,6 @@ set(${theseTestsName}_h_files ) build_test_artifacts(${theseTestsName} "tests/c_util" - ADDITIONAL_LIBS c_pal c_pal_reals + ADDITIONAL_LIBS real_process_watchdog c_pal c_pal c_pal_reals ENABLE_TEST_FILES_PRECOMPILED_HEADERS "${CMAKE_CURRENT_LIST_DIR}/async_op_ut_pch.h" ) \ No newline at end of file diff --git a/tests/async_op_ut/async_op_ut.c b/tests/async_op_ut/async_op_ut.c index 4b486e34..c0817431 100644 --- a/tests/async_op_ut/async_op_ut.c +++ b/tests/async_op_ut/async_op_ut.c @@ -22,7 +22,7 @@ static void on_umock_c_error(UMOCK_C_ERROR_CODE error_code) BEGIN_TEST_SUITE(TEST_SUITE_NAME_FROM_CMAKE) -TEST_SUITE_INITIALIZE(setsBufferTempSize) +TIMED_TEST_SUITE_INITIALIZE(setsBufferTempSize, TIMED_TEST_DEFAULT_TIMEOUT_MS) { ASSERT_ARE_EQUAL(int, 0, real_gballoc_hl_init(NULL, NULL)); @@ -33,7 +33,7 @@ TEST_SUITE_INITIALIZE(setsBufferTempSize) REGISTER_GLOBAL_MOCK_FAIL_RETURN(realloc, NULL); } -TEST_SUITE_CLEANUP(TestClassCleanup) +TIMED_TEST_SUITE_CLEANUP(TestClassCleanup) { umock_c_deinit(); diff --git a/tests/async_op_ut/async_op_ut_pch.h b/tests/async_op_ut/async_op_ut_pch.h index e1544d70..be4ea198 100644 --- a/tests/async_op_ut/async_op_ut_pch.h +++ b/tests/async_op_ut/async_op_ut_pch.h @@ -13,6 +13,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 #include "c_pal/gballoc_hl.h" diff --git a/tests/async_retry_wrapper_ut/CMakeLists.txt b/tests/async_retry_wrapper_ut/CMakeLists.txt index 54814fd1..d3350150 100644 --- a/tests/async_retry_wrapper_ut/CMakeLists.txt +++ b/tests/async_retry_wrapper_ut/CMakeLists.txt @@ -1,4 +1,4 @@ -#Copyright (c) Microsoft. All rights reserved. +#Copyright (c) Microsoft. All rights reserved. set(theseTestsName async_retry_wrapper_ut) @@ -25,6 +25,6 @@ set(${theseTestsName}_h_files include_directories(../../inc) build_test_artifacts(${theseTestsName} "tests/c_util" - ADDITIONAL_LIBS c_util c_pal_reals + ADDITIONAL_LIBS real_process_watchdog c_pal c_util c_pal_reals ENABLE_TEST_FILES_PRECOMPILED_HEADERS "${CMAKE_CURRENT_LIST_DIR}/async_retry_wrapper_ut_pch.h" ) \ No newline at end of file diff --git a/tests/async_retry_wrapper_ut/async_retry_wrapper_ut.c b/tests/async_retry_wrapper_ut/async_retry_wrapper_ut.c index 30a569b9..58728952 100644 --- a/tests/async_retry_wrapper_ut/async_retry_wrapper_ut.c +++ b/tests/async_retry_wrapper_ut/async_retry_wrapper_ut.c @@ -205,7 +205,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) { ASSERT_ARE_EQUAL(int, 0, real_gballoc_hl_init(NULL, NULL)); @@ -258,7 +258,7 @@ TEST_SUITE_INITIALIZE(suite_init) REGISTER_TYPE(TEST_ASYNC_API_SYNC_MULTIPLE_RESULT, TEST_ASYNC_API_SYNC_MULTIPLE_RESULT); } -TEST_SUITE_CLEANUP(suite_cleanup) +TIMED_TEST_SUITE_CLEANUP(suite_cleanup) { THANDLE_ASSIGN(REAL_THREADPOOL)(&g.test_threadpool, NULL); umock_c_deinit(); diff --git a/tests/async_retry_wrapper_ut/async_retry_wrapper_ut_pch.h b/tests/async_retry_wrapper_ut/async_retry_wrapper_ut_pch.h index be1c02d9..264b0d9c 100644 --- a/tests/async_retry_wrapper_ut/async_retry_wrapper_ut_pch.h +++ b/tests/async_retry_wrapper_ut/async_retry_wrapper_ut_pch.h @@ -19,6 +19,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 #define GBALLOC_HL_REDIRECT_H #undef GBALLOC_HL_REDIRECT_H diff --git a/tests/async_type_helper_copy_value_handler_ut/CMakeLists.txt b/tests/async_type_helper_copy_value_handler_ut/CMakeLists.txt index a0297034..3c407fa7 100644 --- a/tests/async_type_helper_copy_value_handler_ut/CMakeLists.txt +++ b/tests/async_type_helper_copy_value_handler_ut/CMakeLists.txt @@ -1,4 +1,4 @@ -#Copyright (c) Microsoft. All rights reserved. +#Copyright (c) Microsoft. All rights reserved. set(theseTestsName async_type_helper_copy_value_handler_ut) @@ -14,6 +14,6 @@ set(${theseTestsName}_h_files ) build_test_artifacts(${theseTestsName} "tests/c_util" - ADDITIONAL_LIBS c_util c_pal_reals + ADDITIONAL_LIBS real_process_watchdog c_pal c_util c_pal_reals ENABLE_TEST_FILES_PRECOMPILED_HEADERS "${CMAKE_CURRENT_LIST_DIR}/async_type_helper_copy_value_handler_ut_pch.h" ) \ No newline at end of file diff --git a/tests/async_type_helper_copy_value_handler_ut/async_type_helper_copy_value_handler_ut.c b/tests/async_type_helper_copy_value_handler_ut/async_type_helper_copy_value_handler_ut.c index 202bd1c5..44cf9be4 100644 --- a/tests/async_type_helper_copy_value_handler_ut/async_type_helper_copy_value_handler_ut.c +++ b/tests/async_type_helper_copy_value_handler_ut/async_type_helper_copy_value_handler_ut.c @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All rights reserved. +// Copyright (c) Microsoft. All rights reserved. @@ -27,7 +27,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) { ASSERT_ARE_EQUAL(int, 0, real_gballoc_hl_init(NULL, NULL)); @@ -38,7 +38,7 @@ TEST_SUITE_INITIALIZE(suite_init) } -TEST_SUITE_CLEANUP(suite_cleanup) +TIMED_TEST_SUITE_CLEANUP(suite_cleanup) { umock_c_deinit(); diff --git a/tests/async_type_helper_copy_value_handler_ut/async_type_helper_copy_value_handler_ut_pch.h b/tests/async_type_helper_copy_value_handler_ut/async_type_helper_copy_value_handler_ut_pch.h index 85dfdf5a..399cb24c 100644 --- a/tests/async_type_helper_copy_value_handler_ut/async_type_helper_copy_value_handler_ut_pch.h +++ b/tests/async_type_helper_copy_value_handler_ut/async_type_helper_copy_value_handler_ut_pch.h @@ -17,6 +17,8 @@ #include "c_pal/interlocked.h" /*included for mocking reasons - it will prohibit creation of mocks belonging to this interlocked.h, 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" diff --git a/tests/async_type_helper_ref_counted_handler_ut/CMakeLists.txt b/tests/async_type_helper_ref_counted_handler_ut/CMakeLists.txt index 88f15e2c..fc1a62ff 100644 --- a/tests/async_type_helper_ref_counted_handler_ut/CMakeLists.txt +++ b/tests/async_type_helper_ref_counted_handler_ut/CMakeLists.txt @@ -1,4 +1,4 @@ -#Copyright (c) Microsoft. All rights reserved. +#Copyright (c) Microsoft. All rights reserved. set(theseTestsName async_type_helper_ref_counted_handler_ut) @@ -16,6 +16,6 @@ set(${theseTestsName}_h_files ) build_test_artifacts(${theseTestsName} "tests/c_util" - ADDITIONAL_LIBS c_util c_pal_reals + ADDITIONAL_LIBS real_process_watchdog c_pal c_util c_pal_reals ENABLE_TEST_FILES_PRECOMPILED_HEADERS "${CMAKE_CURRENT_LIST_DIR}/async_type_helper_ref_counted_handler_ut_pch.h" ) \ No newline at end of file diff --git a/tests/async_type_helper_ref_counted_handler_ut/async_type_helper_ref_counted_handler_ut.c b/tests/async_type_helper_ref_counted_handler_ut/async_type_helper_ref_counted_handler_ut.c index 0b086f4f..3c62c0d1 100644 --- a/tests/async_type_helper_ref_counted_handler_ut/async_type_helper_ref_counted_handler_ut.c +++ b/tests/async_type_helper_ref_counted_handler_ut/async_type_helper_ref_counted_handler_ut.c @@ -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) { ASSERT_ARE_EQUAL(int, 0, real_gballoc_hl_init(NULL, NULL)); @@ -38,7 +38,7 @@ TEST_SUITE_INITIALIZE(suite_init) REGISTER_UMOCK_ALIAS_TYPE(TEST_REFCOUNTED_HANDLE, void*); } -TEST_SUITE_CLEANUP(suite_cleanup) +TIMED_TEST_SUITE_CLEANUP(suite_cleanup) { umock_c_deinit(); diff --git a/tests/async_type_helper_ref_counted_handler_ut/async_type_helper_ref_counted_handler_ut_pch.h b/tests/async_type_helper_ref_counted_handler_ut/async_type_helper_ref_counted_handler_ut_pch.h index e642862e..0c7eaecd 100644 --- a/tests/async_type_helper_ref_counted_handler_ut/async_type_helper_ref_counted_handler_ut_pch.h +++ b/tests/async_type_helper_ref_counted_handler_ut/async_type_helper_ref_counted_handler_ut_pch.h @@ -17,6 +17,8 @@ #include "c_pal/interlocked.h" /*included for mocking reasons - it will prohibit creation of mocks belonging to this interlocked.h, 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" diff --git a/tests/async_type_helper_thandle_handler_ut/CMakeLists.txt b/tests/async_type_helper_thandle_handler_ut/CMakeLists.txt index 8a2c64d8..3a838311 100644 --- a/tests/async_type_helper_thandle_handler_ut/CMakeLists.txt +++ b/tests/async_type_helper_thandle_handler_ut/CMakeLists.txt @@ -1,4 +1,4 @@ -#Copyright (c) Microsoft. All rights reserved. +#Copyright (c) Microsoft. All rights reserved. set(theseTestsName async_type_helper_thandle_handler_ut) @@ -16,6 +16,6 @@ set(${theseTestsName}_h_files ) build_test_artifacts(${theseTestsName} "tests/c_util" - ADDITIONAL_LIBS c_util c_pal_reals + ADDITIONAL_LIBS real_process_watchdog c_pal c_util c_pal_reals ENABLE_TEST_FILES_PRECOMPILED_HEADERS "${CMAKE_CURRENT_LIST_DIR}/async_type_helper_thandle_handler_ut_pch.h" ) \ No newline at end of file diff --git a/tests/async_type_helper_thandle_handler_ut/async_type_helper_thandle_handler_ut.c b/tests/async_type_helper_thandle_handler_ut/async_type_helper_thandle_handler_ut.c index de787392..15232345 100644 --- a/tests/async_type_helper_thandle_handler_ut/async_type_helper_thandle_handler_ut.c +++ b/tests/async_type_helper_thandle_handler_ut/async_type_helper_thandle_handler_ut.c @@ -27,7 +27,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) { ASSERT_ARE_EQUAL(int, 0, real_gballoc_hl_init(NULL, NULL)); @@ -43,7 +43,7 @@ TEST_SUITE_INITIALIZE(suite_init) REGISTER_UMOCK_ALIAS_TYPE(THANDLE(TEST_THANDLE), void*); } -TEST_SUITE_CLEANUP(suite_cleanup) +TIMED_TEST_SUITE_CLEANUP(suite_cleanup) { umock_c_deinit(); diff --git a/tests/async_type_helper_thandle_handler_ut/async_type_helper_thandle_handler_ut_pch.h b/tests/async_type_helper_thandle_handler_ut/async_type_helper_thandle_handler_ut_pch.h index 3e88e1dc..1fa2c4a6 100644 --- a/tests/async_type_helper_thandle_handler_ut/async_type_helper_thandle_handler_ut_pch.h +++ b/tests/async_type_helper_thandle_handler_ut/async_type_helper_thandle_handler_ut_pch.h @@ -17,6 +17,8 @@ #include "c_pal/interlocked.h" /*included for mocking reasons - it will prohibit creation of mocks belonging to this interlocked.h, 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" diff --git a/tests/async_type_helper_ut/CMakeLists.txt b/tests/async_type_helper_ut/CMakeLists.txt index 8790965c..0a37ad50 100644 --- a/tests/async_type_helper_ut/CMakeLists.txt +++ b/tests/async_type_helper_ut/CMakeLists.txt @@ -1,4 +1,4 @@ -#Copyright (c) Microsoft. All rights reserved. +#Copyright (c) Microsoft. All rights reserved. set(theseTestsName async_type_helper_ut) @@ -15,6 +15,6 @@ set(${theseTestsName}_h_files ) build_test_artifacts(${theseTestsName} "tests/c_util" - ADDITIONAL_LIBS c_util c_pal_reals c_util_reals + ADDITIONAL_LIBS real_process_watchdog c_pal c_util c_pal_reals c_util_reals ENABLE_TEST_FILES_PRECOMPILED_HEADERS "${CMAKE_CURRENT_LIST_DIR}/async_type_helper_ut_pch.h" ) \ No newline at end of file diff --git a/tests/async_type_helper_ut/async_type_helper_ut.c b/tests/async_type_helper_ut/async_type_helper_ut.c index 1207f620..8e95d7d0 100644 --- a/tests/async_type_helper_ut/async_type_helper_ut.c +++ b/tests/async_type_helper_ut/async_type_helper_ut.c @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All rights reserved. +// Copyright (c) Microsoft. All rights reserved. #include "async_type_helper_ut_pch.h" @@ -18,7 +18,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) { ASSERT_ARE_EQUAL(int, 0, real_gballoc_hl_init(NULL, NULL)); @@ -44,7 +44,7 @@ TEST_SUITE_INITIALIZE(suite_init) REGISTER_UMOCK_ALIAS_TYPE(constbuffer_array_ptr, CONSTBUFFER_ARRAY_HANDLE*); } -TEST_SUITE_CLEANUP(suite_cleanup) +TIMED_TEST_SUITE_CLEANUP(suite_cleanup) { umock_c_deinit(); diff --git a/tests/async_type_helper_ut/async_type_helper_ut_pch.h b/tests/async_type_helper_ut/async_type_helper_ut_pch.h index 31ff59be..133753ad 100644 --- a/tests/async_type_helper_ut/async_type_helper_ut_pch.h +++ b/tests/async_type_helper_ut/async_type_helper_ut_pch.h @@ -19,6 +19,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" diff --git a/tests/azure_base64_ut/CMakeLists.txt b/tests/azure_base64_ut/CMakeLists.txt index 9f4196ed..cd8ef168 100644 --- a/tests/azure_base64_ut/CMakeLists.txt +++ b/tests/azure_base64_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 azure_base64_ut) @@ -17,6 +17,6 @@ set(${theseTestsName}_h_files ) build_test_artifacts(${theseTestsName} "tests/c_util" - ADDITIONAL_LIBS c_pal c_pal_reals + ADDITIONAL_LIBS real_process_watchdog c_pal c_pal c_pal_reals ENABLE_TEST_FILES_PRECOMPILED_HEADERS "${CMAKE_CURRENT_LIST_DIR}/azure_base64_ut_pch.h" ) \ No newline at end of file diff --git a/tests/azure_base64_ut/azure_base64_ut.c b/tests/azure_base64_ut/azure_base64_ut.c index 5ec640c3..5a0bc32f 100644 --- a/tests/azure_base64_ut/azure_base64_ut.c +++ b/tests/azure_base64_ut/azure_base64_ut.c @@ -1444,7 +1444,7 @@ static void on_umock_c_error(UMOCK_C_ERROR_CODE error_code) BEGIN_TEST_SUITE(TEST_SUITE_NAME_FROM_CMAKE) -TEST_SUITE_INITIALIZE(TestSuiteInitialize) +TIMED_TEST_SUITE_INITIALIZE(TestSuiteInitialize, TIMED_TEST_DEFAULT_TIMEOUT_MS) { ASSERT_ARE_EQUAL(int, 0, real_gballoc_hl_init(NULL, NULL)); @@ -1453,7 +1453,7 @@ TEST_SUITE_INITIALIZE(TestSuiteInitialize) REGISTER_GBALLOC_HL_GLOBAL_MOCK_HOOK(); } -TEST_SUITE_CLEANUP(TestClassCleanup) +TIMED_TEST_SUITE_CLEANUP(TestClassCleanup) { umock_c_deinit(); diff --git a/tests/azure_base64_ut/azure_base64_ut_pch.h b/tests/azure_base64_ut/azure_base64_ut_pch.h index 3ca6b052..cf7cd737 100644 --- a/tests/azure_base64_ut/azure_base64_ut_pch.h +++ b/tests/azure_base64_ut/azure_base64_ut_pch.h @@ -15,6 +15,8 @@ #include "umock_c/umock_c.h" #include "umock_c/umock_c_negative_tests.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" diff --git a/tests/buffer_ut/CMakeLists.txt b/tests/buffer_ut/CMakeLists.txt index d06f6402..cdad16b5 100644 --- a/tests/buffer_ut/CMakeLists.txt +++ b/tests/buffer_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 buffer_ut) @@ -15,6 +15,6 @@ set(${theseTestsName}_h_files ) build_test_artifacts(${theseTestsName} "tests/c_util" - ADDITIONAL_LIBS c_pal c_pal_reals + ADDITIONAL_LIBS real_process_watchdog c_pal c_pal c_pal_reals ENABLE_TEST_FILES_PRECOMPILED_HEADERS "${CMAKE_CURRENT_LIST_DIR}/buffer_ut_pch.h" ) \ No newline at end of file diff --git a/tests/buffer_ut/buffer_ut.c b/tests/buffer_ut/buffer_ut.c index 4893df8a..5adc0fc1 100644 --- a/tests/buffer_ut/buffer_ut.c +++ b/tests/buffer_ut/buffer_ut.c @@ -31,7 +31,7 @@ static void on_umock_c_error(UMOCK_C_ERROR_CODE error_code) BEGIN_TEST_SUITE(TEST_SUITE_NAME_FROM_CMAKE) - TEST_SUITE_INITIALIZE(setsBufferTempSize) + TIMED_TEST_SUITE_INITIALIZE(setsBufferTempSize, TIMED_TEST_DEFAULT_TIMEOUT_MS) { ASSERT_ARE_EQUAL(int, 0, real_gballoc_hl_init(NULL, NULL)); @@ -44,7 +44,7 @@ BEGIN_TEST_SUITE(TEST_SUITE_NAME_FROM_CMAKE) REGISTER_GLOBAL_MOCK_FAIL_RETURN(realloc, NULL); } - TEST_SUITE_CLEANUP(TestClassCleanup) + TIMED_TEST_SUITE_CLEANUP(TestClassCleanup) { umock_c_deinit(); diff --git a/tests/buffer_ut/buffer_ut_pch.h b/tests/buffer_ut/buffer_ut_pch.h index cf352d7f..3787f1ac 100644 --- a/tests/buffer_ut/buffer_ut_pch.h +++ b/tests/buffer_ut/buffer_ut_pch.h @@ -17,6 +17,8 @@ #include "real_gballoc_ll.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" diff --git a/tests/cancellation_token_ut/CMakeLists.txt b/tests/cancellation_token_ut/CMakeLists.txt index 51c20599..00ac72ca 100644 --- a/tests/cancellation_token_ut/CMakeLists.txt +++ b/tests/cancellation_token_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 cancellation_token_ut) @@ -15,6 +15,6 @@ set(${theseTestsName}_h_files ) build_test_artifacts(${theseTestsName} "tests/c_util" - ADDITIONAL_LIBS c_pal c_pal_reals c_util c_util_reals + ADDITIONAL_LIBS real_process_watchdog c_pal c_pal c_pal_reals c_util c_util_reals ENABLE_TEST_FILES_PRECOMPILED_HEADERS "${CMAKE_CURRENT_LIST_DIR}/cancellation_token_ut_pch.h" ) \ No newline at end of file diff --git a/tests/cancellation_token_ut/cancellation_token_ut.c b/tests/cancellation_token_ut/cancellation_token_ut.c index f41bb5e0..6e0cc6b3 100644 --- a/tests/cancellation_token_ut/cancellation_token_ut.c +++ b/tests/cancellation_token_ut/cancellation_token_ut.c @@ -20,7 +20,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) { ASSERT_ARE_EQUAL(int, 0, real_gballoc_hl_init(NULL, NULL)); @@ -40,7 +40,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/cancellation_token_ut/cancellation_token_ut_pch.h b/tests/cancellation_token_ut/cancellation_token_ut_pch.h index 4cd118c1..1f2d17f9 100644 --- a/tests/cancellation_token_ut/cancellation_token_ut_pch.h +++ b/tests/cancellation_token_ut/cancellation_token_ut_pch.h @@ -18,6 +18,8 @@ #include "umock_c/umocktypes_bool.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" #include "c_pal/gballoc_hl_redirect.h" diff --git a/tests/channel_int/channel_int.c b/tests/channel_int/channel_int.c index 325b77bc..893180ee 100644 --- a/tests/channel_int/channel_int.c +++ b/tests/channel_int/channel_int.c @@ -18,6 +18,7 @@ #include "c_pal/threadapi.h" #include "c_pal/sync.h" #include "c_pal/srw_lock.h" +#include "c_pal/timed_test_suite.h" #include "c_util/rc_ptr.h" #include "c_util/channel.h" @@ -350,7 +351,7 @@ static int push_data(void* context) BEGIN_TEST_SUITE(TEST_SUITE_NAME_FROM_CMAKE) -TEST_SUITE_INITIALIZE(suite_init) +TIMED_TEST_SUITE_INITIALIZE(suite_init, 20 * 60 * 1000) { void* execution_engine_parameters = NULL; @@ -374,7 +375,7 @@ TEST_SUITE_INITIALIZE(suite_init) ASSERT_IS_NOT_NULL(g.g_push_correlation_id); } -TEST_SUITE_CLEANUP(suite_cleanup) +TIMED_TEST_SUITE_CLEANUP(suite_cleanup) { THANDLE_ASSIGN(RC_STRING)(&g.g_push_correlation_id, NULL); THANDLE_ASSIGN(RC_STRING)(&g.g_pull_correlation_id, NULL); diff --git a/tests/channel_ut/CMakeLists.txt b/tests/channel_ut/CMakeLists.txt index 7aa28b54..844d5cf1 100644 --- a/tests/channel_ut/CMakeLists.txt +++ b/tests/channel_ut/CMakeLists.txt @@ -1,4 +1,4 @@ -#Copyright (c) Microsoft. All rights reserved. +#Copyright (c) Microsoft. All rights reserved. set(theseTestsName channel_ut) @@ -15,6 +15,6 @@ set(${theseTestsName}_h_files ) build_test_artifacts(${theseTestsName} "tests/c_util" - ADDITIONAL_LIBS c_util c_pal c_util_reals c_pal_reals + ADDITIONAL_LIBS real_process_watchdog c_pal c_util c_pal c_util_reals c_pal_reals ENABLE_TEST_FILES_PRECOMPILED_HEADERS "${CMAKE_CURRENT_LIST_DIR}/channel_ut_pch.h" ) \ No newline at end of file diff --git a/tests/channel_ut/channel_ut.c b/tests/channel_ut/channel_ut.c index 8eb0f4b3..fff818b7 100644 --- a/tests/channel_ut/channel_ut.c +++ b/tests/channel_ut/channel_ut.c @@ -272,7 +272,7 @@ static int hook_threadpool_schedule_work_do_nothing(THANDLE(THREADPOOL) threadpo } 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, umock_c_init(on_umock_c_error), "umock_c_init failed"); ASSERT_ARE_EQUAL(int, 0, umocktypes_bool_register_types(), "umocktypes_bool_register_types"); @@ -349,7 +349,7 @@ TEST_SUITE_INITIALIZE(suite_init) } } -TEST_SUITE_CLEANUP(suite_cleanup) +TIMED_TEST_SUITE_CLEANUP(suite_cleanup) { THANDLE_ASSIGN(REAL_THREADPOOL)(&g.g_threadpool, NULL); THANDLE_ASSIGN(real_RC_STRING)((THANDLE(RC_STRING)*) & g.g_push_correlation_id, NULL); diff --git a/tests/channel_ut/channel_ut_pch.h b/tests/channel_ut/channel_ut_pch.h index 7bb31552..bb31ac9c 100644 --- a/tests/channel_ut/channel_ut_pch.h +++ b/tests/channel_ut/channel_ut_pch.h @@ -22,6 +22,8 @@ #include "c_pal/execution_engine.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" #include "c_pal/gballoc_hl_redirect.h" diff --git a/tests/constbuffer_array_batcher_nv_ut/CMakeLists.txt b/tests/constbuffer_array_batcher_nv_ut/CMakeLists.txt index 0dfa80f3..b7ebdc0c 100644 --- a/tests/constbuffer_array_batcher_nv_ut/CMakeLists.txt +++ b/tests/constbuffer_array_batcher_nv_ut/CMakeLists.txt @@ -1,4 +1,4 @@ -#Copyright (c) Microsoft. All rights reserved. +#Copyright (c) Microsoft. All rights reserved. set(theseTestsName constbuffer_array_batcher_nv_ut) @@ -15,6 +15,6 @@ set(${theseTestsName}_h_files ) build_test_artifacts(${theseTestsName} "tests/c_util" - ADDITIONAL_LIBS c_pal c_pal_reals c_util_reals + ADDITIONAL_LIBS real_process_watchdog c_pal c_pal c_pal_reals c_util_reals ENABLE_TEST_FILES_PRECOMPILED_HEADERS "${CMAKE_CURRENT_LIST_DIR}/constbuffer_array_batcher_nv_ut_pch.h" ) \ No newline at end of file diff --git a/tests/constbuffer_array_batcher_nv_ut/constbuffer_array_batcher_nv_ut.c b/tests/constbuffer_array_batcher_nv_ut/constbuffer_array_batcher_nv_ut.c index 8ad82175..53feb205 100644 --- a/tests/constbuffer_array_batcher_nv_ut/constbuffer_array_batcher_nv_ut.c +++ b/tests/constbuffer_array_batcher_nv_ut/constbuffer_array_batcher_nv_ut.c @@ -13,7 +13,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; @@ -41,7 +41,7 @@ TEST_SUITE_INITIALIZE(suite_init) REGISTER_UMOCK_ALIAS_TYPE(CONSTBUFFER_ARRAY_HANDLE, void*); } -TEST_SUITE_CLEANUP(suite_cleanup) +TIMED_TEST_SUITE_CLEANUP(suite_cleanup) { umock_c_deinit(); diff --git a/tests/constbuffer_array_batcher_nv_ut/constbuffer_array_batcher_nv_ut_pch.h b/tests/constbuffer_array_batcher_nv_ut/constbuffer_array_batcher_nv_ut_pch.h index 819b75a4..4984e561 100644 --- a/tests/constbuffer_array_batcher_nv_ut/constbuffer_array_batcher_nv_ut_pch.h +++ b/tests/constbuffer_array_batcher_nv_ut/constbuffer_array_batcher_nv_ut_pch.h @@ -17,6 +17,8 @@ #include "umock_c/umocktypes_stdint.h" #include "umock_c/umock_c_negative_tests.h" +#include "c_pal/timed_test_suite.h" + #include "umock_c/umock_c_ENABLE_MOCKS.h" // ============================== ENABLE_MOCKS #include "c_util/constbuffer.h" diff --git a/tests/constbuffer_array_int/CMakeLists.txt b/tests/constbuffer_array_int/CMakeLists.txt index 768f867b..9112f826 100644 --- a/tests/constbuffer_array_int/CMakeLists.txt +++ b/tests/constbuffer_array_int/CMakeLists.txt @@ -13,4 +13,4 @@ set(${theseTestsName}_c_files set(${theseTestsName}_h_files ) -build_test_artifacts(${theseTestsName} "tests/c_util" ADDITIONAL_LIBS c_util) \ No newline at end of file +build_test_artifacts(${theseTestsName} "tests/c_util" ADDITIONAL_LIBS c_pal c_util) \ No newline at end of file diff --git a/tests/constbuffer_array_int/constbuffer_array_int.c b/tests/constbuffer_array_int/constbuffer_array_int.c index a0327787..85eb62ce 100644 --- a/tests/constbuffer_array_int/constbuffer_array_int.c +++ b/tests/constbuffer_array_int/constbuffer_array_int.c @@ -12,18 +12,19 @@ #include "c_pal/gballoc_hl.h" #include "c_pal/gballoc_hl_redirect.h" +#include "c_pal/timed_test_suite.h" #include "c_util/constbuffer.h" #include "c_util/constbuffer_array.h" BEGIN_TEST_SUITE(constbuffer_array_int) -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(); } diff --git a/tests/constbuffer_array_splitter_ut/CMakeLists.txt b/tests/constbuffer_array_splitter_ut/CMakeLists.txt index f8c3fba0..a6a94720 100644 --- a/tests/constbuffer_array_splitter_ut/CMakeLists.txt +++ b/tests/constbuffer_array_splitter_ut/CMakeLists.txt @@ -1,4 +1,4 @@ -#Copyright (c) Microsoft. All rights reserved. +#Copyright (c) Microsoft. All rights reserved. set(theseTestsName constbuffer_array_splitter_ut) @@ -15,6 +15,6 @@ set(${theseTestsName}_h_files ) build_test_artifacts(${theseTestsName} "tests/c_util" - ADDITIONAL_LIBS c_util_reals + ADDITIONAL_LIBS real_process_watchdog c_pal c_util_reals ENABLE_TEST_FILES_PRECOMPILED_HEADERS "${CMAKE_CURRENT_LIST_DIR}/constbuffer_array_splitter_ut_pch.h" ) \ No newline at end of file diff --git a/tests/constbuffer_array_splitter_ut/constbuffer_array_splitter_ut.c b/tests/constbuffer_array_splitter_ut/constbuffer_array_splitter_ut.c index 2f1968d7..c498c6e0 100644 --- a/tests/constbuffer_array_splitter_ut/constbuffer_array_splitter_ut.c +++ b/tests/constbuffer_array_splitter_ut/constbuffer_array_splitter_ut.c @@ -68,7 +68,7 @@ static CONSTBUFFER_ARRAY_HANDLE generate_test_buffer_array(uint32_t buffer_count 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)); @@ -101,7 +101,7 @@ TEST_SUITE_INITIALIZE(suite_init) REGISTER_UMOCK_ALIAS_TYPE(TARRAY(CONSTBUFFER_ARRAY_HANDLE), void*); } -TEST_SUITE_CLEANUP(suite_cleanup) +TIMED_TEST_SUITE_CLEANUP(suite_cleanup) { umock_c_deinit(); diff --git a/tests/constbuffer_array_splitter_ut/constbuffer_array_splitter_ut_pch.h b/tests/constbuffer_array_splitter_ut/constbuffer_array_splitter_ut_pch.h index 5def8c45..3b530847 100644 --- a/tests/constbuffer_array_splitter_ut/constbuffer_array_splitter_ut_pch.h +++ b/tests/constbuffer_array_splitter_ut/constbuffer_array_splitter_ut_pch.h @@ -18,6 +18,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" diff --git a/tests/constbuffer_array_ut/CMakeLists.txt b/tests/constbuffer_array_ut/CMakeLists.txt index d9c6a649..e622dd0f 100644 --- a/tests/constbuffer_array_ut/CMakeLists.txt +++ b/tests/constbuffer_array_ut/CMakeLists.txt @@ -1,4 +1,4 @@ -#Copyright (c) Microsoft. All rights reserved. +#Copyright (c) Microsoft. All rights reserved. set(theseTestsName constbuffer_array_ut) @@ -15,6 +15,6 @@ set(${theseTestsName}_h_files ) build_test_artifacts(${theseTestsName} "tests/c_util" - ADDITIONAL_LIBS c_pal c_pal_reals c_util_reals + ADDITIONAL_LIBS real_process_watchdog c_pal c_pal c_pal_reals c_util_reals ENABLE_TEST_FILES_PRECOMPILED_HEADERS "${CMAKE_CURRENT_LIST_DIR}/constbuffer_array_ut_pch.h" ) \ No newline at end of file diff --git a/tests/constbuffer_array_ut/constbuffer_array_ut.c b/tests/constbuffer_array_ut/constbuffer_array_ut.c index 3557de3f..b61b776b 100644 --- a/tests/constbuffer_array_ut/constbuffer_array_ut.c +++ b/tests/constbuffer_array_ut/constbuffer_array_ut.c @@ -262,7 +262,7 @@ static void validate_sorted_constbuffer_array(CONSTBUFFER_ARRAY_HANDLE constbuff 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; @@ -292,7 +292,7 @@ TEST_SUITE_INITIALIZE(suite_init) REGISTER_INTERLOCKED_GLOBAL_MOCK_HOOK(); } -TEST_SUITE_CLEANUP(suite_cleanup) +TIMED_TEST_SUITE_CLEANUP(suite_cleanup) { umock_c_deinit(); diff --git a/tests/constbuffer_array_ut/constbuffer_array_ut_pch.h b/tests/constbuffer_array_ut/constbuffer_array_ut_pch.h index 60a17b7d..07e4a90d 100644 --- a/tests/constbuffer_array_ut/constbuffer_array_ut_pch.h +++ b/tests/constbuffer_array_ut/constbuffer_array_ut_pch.h @@ -19,6 +19,8 @@ #include "umock_c/umocktypes_bool.h" #include "umock_c/umock_c_negative_tests.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" diff --git a/tests/constbuffer_thandle_int/CMakeLists.txt b/tests/constbuffer_thandle_int/CMakeLists.txt index 96d20b09..d6f01b79 100644 --- a/tests/constbuffer_thandle_int/CMakeLists.txt +++ b/tests/constbuffer_thandle_int/CMakeLists.txt @@ -13,4 +13,4 @@ set(${theseTestsName}_c_files set(${theseTestsName}_h_files ) -build_test_artifacts(${theseTestsName} "tests/c_util" ADDITIONAL_LIBS c_util) +build_test_artifacts(${theseTestsName} "tests/c_util" ADDITIONAL_LIBS c_pal c_util) diff --git a/tests/constbuffer_thandle_int/constbuffer_thandle_int.c b/tests/constbuffer_thandle_int/constbuffer_thandle_int.c index d3581a9d..2c7b6518 100644 --- a/tests/constbuffer_thandle_int/constbuffer_thandle_int.c +++ b/tests/constbuffer_thandle_int/constbuffer_thandle_int.c @@ -13,18 +13,19 @@ #include "c_pal/gballoc_hl.h" #include "c_pal/gballoc_hl_redirect.h" #include "c_pal/thandle.h" +#include "c_pal/timed_test_suite.h" #include "c_util/constbuffer_thandle.h" BEGIN_TEST_SUITE(constbuffer_thandle_int) -TEST_SUITE_INITIALIZE(suite_init) +TIMED_TEST_SUITE_INITIALIZE(suite_init, TIMED_TEST_DEFAULT_TIMEOUT_MS) { int result = gballoc_hl_init(NULL, NULL); ASSERT_ARE_EQUAL(int, 0, result); } -TEST_SUITE_CLEANUP(suite_cleanup) +TIMED_TEST_SUITE_CLEANUP(suite_cleanup) { gballoc_hl_deinit(); } diff --git a/tests/constbuffer_thandle_ut/CMakeLists.txt b/tests/constbuffer_thandle_ut/CMakeLists.txt index f6f043f9..73f66100 100644 --- a/tests/constbuffer_thandle_ut/CMakeLists.txt +++ b/tests/constbuffer_thandle_ut/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.18) +cmake_minimum_required(VERSION 3.18) set(theseTestsName constbuffer_thandle_ut) @@ -15,6 +15,6 @@ set(${theseTestsName}_h_files ) build_test_artifacts(${theseTestsName} "tests/c_util" - ADDITIONAL_LIBS c_pal c_pal_reals + ADDITIONAL_LIBS real_process_watchdog c_pal c_pal c_pal_reals ENABLE_TEST_FILES_PRECOMPILED_HEADERS "${CMAKE_CURRENT_LIST_DIR}/constbuffer_thandle_ut_pch.h" ) \ No newline at end of file diff --git a/tests/constbuffer_thandle_ut/constbuffer_thandle_ut.c b/tests/constbuffer_thandle_ut/constbuffer_thandle_ut.c index be48fe12..9c7ff0c1 100644 --- a/tests/constbuffer_thandle_ut/constbuffer_thandle_ut.c +++ b/tests/constbuffer_thandle_ut/constbuffer_thandle_ut.c @@ -62,7 +62,7 @@ static void on_umock_c_error(UMOCK_C_ERROR_CODE error_code) BEGIN_TEST_SUITE(constbuffer_thandle_ut) -TEST_SUITE_INITIALIZE(suite_init) +TIMED_TEST_SUITE_INITIALIZE(suite_init, TIMED_TEST_DEFAULT_TIMEOUT_MS) { int result = real_gballoc_hl_init(NULL, NULL); ASSERT_ARE_EQUAL(int, 0, result); @@ -85,7 +85,7 @@ TEST_SUITE_INITIALIZE(suite_init) REGISTER_GLOBAL_MOCK_HOOK(BUFFER_length, my_BUFFER_length); } -TEST_SUITE_CLEANUP(suite_cleanup) +TIMED_TEST_SUITE_CLEANUP(suite_cleanup) { umock_c_deinit(); real_gballoc_hl_deinit(); diff --git a/tests/constbuffer_thandle_ut/constbuffer_thandle_ut_pch.h b/tests/constbuffer_thandle_ut/constbuffer_thandle_ut_pch.h index 77d5cd53..714ba121 100644 --- a/tests/constbuffer_thandle_ut/constbuffer_thandle_ut_pch.h +++ b/tests/constbuffer_thandle_ut/constbuffer_thandle_ut_pch.h @@ -25,6 +25,8 @@ #include "umock_c/umocktypes_charptr.h" #include "umock_c/umock_c_negative_tests.h" +#include "c_pal/timed_test_suite.h" + #include "umock_c/umock_c_ENABLE_MOCKS.h" // ============================== ENABLE_MOCKS #include "c_util/buffer_.h" #include "c_pal/gballoc_hl.h" diff --git a/tests/constbuffer_ut/CMakeLists.txt b/tests/constbuffer_ut/CMakeLists.txt index 198bb547..c1545838 100644 --- a/tests/constbuffer_ut/CMakeLists.txt +++ b/tests/constbuffer_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 constbuffer_ut) @@ -16,6 +16,6 @@ set(${theseTestsName}_h_files ) build_test_artifacts(${theseTestsName} "tests/c_util" - ADDITIONAL_LIBS c_pal c_pal_reals + ADDITIONAL_LIBS real_process_watchdog c_pal c_pal c_pal_reals ENABLE_TEST_FILES_PRECOMPILED_HEADERS "${CMAKE_CURRENT_LIST_DIR}/constbuffer_ut_pch.h" ) \ No newline at end of file diff --git a/tests/constbuffer_ut/constbuffer_ut.c b/tests/constbuffer_ut/constbuffer_ut.c index 512dd4cf..2478942f 100644 --- a/tests/constbuffer_ut/constbuffer_ut.c +++ b/tests/constbuffer_ut/constbuffer_ut.c @@ -92,7 +92,7 @@ static void on_umock_c_error(UMOCK_C_ERROR_CODE error_code) BEGIN_TEST_SUITE(TEST_SUITE_NAME_FROM_CMAKE) - TEST_SUITE_INITIALIZE(setsBufferTempSize) + TIMED_TEST_SUITE_INITIALIZE(setsBufferTempSize, TIMED_TEST_DEFAULT_TIMEOUT_MS) { ASSERT_ARE_EQUAL(int, 0, real_gballoc_hl_init(NULL, NULL)); @@ -110,7 +110,7 @@ BEGIN_TEST_SUITE(TEST_SUITE_NAME_FROM_CMAKE) REGISTER_GLOBAL_MOCK_HOOK(test_alloc, test_alloc_impl); } - TEST_SUITE_CLEANUP(TestClassCleanup) + TIMED_TEST_SUITE_CLEANUP(TestClassCleanup) { umock_c_deinit(); diff --git a/tests/constbuffer_ut/constbuffer_ut_pch.h b/tests/constbuffer_ut/constbuffer_ut_pch.h index b786dadc..3ac680f8 100644 --- a/tests/constbuffer_ut/constbuffer_ut_pch.h +++ b/tests/constbuffer_ut/constbuffer_ut_pch.h @@ -17,6 +17,8 @@ #include "macro_utils/macro_utils.h" #include "testrunnerswitcher.h" +#include "c_pal/timed_test_suite.h" + #include "umock_c/umock_c_ENABLE_MOCKS.h" // ============================== ENABLE_MOCKS #include "c_util/buffer_.h" #include "c_pal/gballoc_hl.h" diff --git a/tests/critical_section_ut/CMakeLists.txt b/tests/critical_section_ut/CMakeLists.txt index aed37b5e..e37aaaa3 100644 --- a/tests/critical_section_ut/CMakeLists.txt +++ b/tests/critical_section_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 critical_section_ut) @@ -15,6 +15,6 @@ set(${theseTestsName}_h_files ) build_test_artifacts(${theseTestsName} "tests/c_util" - ADDITIONAL_LIBS c_pal c_pal_reals + ADDITIONAL_LIBS real_process_watchdog c_pal c_pal c_pal_reals ENABLE_TEST_FILES_PRECOMPILED_HEADERS "${CMAKE_CURRENT_LIST_DIR}/critical_section_ut_pch.h" ) \ No newline at end of file diff --git a/tests/critical_section_ut/critical_section_ut.c b/tests/critical_section_ut/critical_section_ut.c index 91061c70..e2633751 100644 --- a/tests/critical_section_ut/critical_section_ut.c +++ b/tests/critical_section_ut/critical_section_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 "critical_section_ut_pch.h" @@ -14,13 +14,13 @@ static void on_umock_c_error(UMOCK_C_ERROR_CODE error_code) BEGIN_TEST_SUITE(TEST_SUITE_NAME_FROM_CMAKE) - TEST_SUITE_INITIALIZE(test_suite_intialize) + TIMED_TEST_SUITE_INITIALIZE(test_suite_intialize, TIMED_TEST_DEFAULT_TIMEOUT_MS) { ASSERT_ARE_EQUAL(int, 0, umock_c_init(on_umock_c_error), "umock_c_init failed"); ASSERT_ARE_EQUAL(int, 0, umocktypes_stdint_register_types(), "umocktypes_stdint_register_types failed"); } - TEST_SUITE_CLEANUP(test_class_cleanup) + TIMED_TEST_SUITE_CLEANUP(test_class_cleanup) { umock_c_deinit(); } diff --git a/tests/critical_section_ut/critical_section_ut_pch.h b/tests/critical_section_ut/critical_section_ut_pch.h index 87003176..faf9d29e 100644 --- a/tests/critical_section_ut/critical_section_ut_pch.h +++ b/tests/critical_section_ut/critical_section_ut_pch.h @@ -15,6 +15,8 @@ #include "umock_c/umocktypes.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/sync.h" diff --git a/tests/doublylinkedlist_ut/CMakeLists.txt b/tests/doublylinkedlist_ut/CMakeLists.txt index 3155bcd9..f267fd05 100644 --- a/tests/doublylinkedlist_ut/CMakeLists.txt +++ b/tests/doublylinkedlist_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 doublylinkedlist_ut) @@ -14,6 +14,6 @@ set(${theseTestsName}_c_files set(${theseTestsName}_h_files ) -build_test_artifacts(${theseTestsName} "tests/c_util" ADDITIONAL_LIBS c_pal_reals +build_test_artifacts(${theseTestsName} "tests/c_util" ADDITIONAL_LIBS real_process_watchdog c_pal c_pal_reals ENABLE_TEST_FILES_PRECOMPILED_HEADERS "${CMAKE_CURRENT_LIST_DIR}/doublylinkedlist_ut_pch.h" ) \ No newline at end of file diff --git a/tests/doublylinkedlist_ut/doublylinkedlist_ut.c b/tests/doublylinkedlist_ut/doublylinkedlist_ut.c index fa8918ba..4193c0fa 100644 --- a/tests/doublylinkedlist_ut/doublylinkedlist_ut.c +++ b/tests/doublylinkedlist_ut/doublylinkedlist_ut.c @@ -57,7 +57,7 @@ static void on_umock_c_error(UMOCK_C_ERROR_CODE error_code) BEGIN_TEST_SUITE(TEST_SUITE_NAME_FROM_CMAKE) -TEST_SUITE_INITIALIZE(TestClassInitialize) +TIMED_TEST_SUITE_INITIALIZE(TestClassInitialize, TIMED_TEST_DEFAULT_TIMEOUT_MS) { ASSERT_ARE_EQUAL(int, 0, umock_c_init(on_umock_c_error), "umock_c_init"); ASSERT_ARE_EQUAL(int, 0, umocktypes_charptr_register_types(), "umocktypes_charptr_register_types"); @@ -65,7 +65,7 @@ TEST_SUITE_INITIALIZE(TestClassInitialize) REGISTER_UMOCK_ALIAS_TYPE(PDLIST_ENTRY, void*); } -TEST_SUITE_CLEANUP(TestClassCleanup) +TIMED_TEST_SUITE_CLEANUP(TestClassCleanup) { umock_c_deinit(); } diff --git a/tests/doublylinkedlist_ut/doublylinkedlist_ut_pch.h b/tests/doublylinkedlist_ut/doublylinkedlist_ut_pch.h index 30465faa..701195b9 100644 --- a/tests/doublylinkedlist_ut/doublylinkedlist_ut_pch.h +++ b/tests/doublylinkedlist_ut/doublylinkedlist_ut_pch.h @@ -11,6 +11,7 @@ #include "umock_c/umocktypes_charptr.h" #include "c_pal/containing_record.h" +#include "c_pal/timed_test_suite.h" #include "c_util/doublylinkedlist.h" #include "testrunnerswitcher.h" diff --git a/tests/external_command_helper_int/external_command_helper_int.c b/tests/external_command_helper_int/external_command_helper_int.c index 05288960..3afc49f9 100644 --- a/tests/external_command_helper_int/external_command_helper_int.c +++ b/tests/external_command_helper_int/external_command_helper_int.c @@ -12,6 +12,7 @@ #include "macro_utils/macro_utils.h" #include "c_pal/gballoc_hl.h" +#include "c_pal/timed_test_suite.h" #include "c_logging/logger.h" #include "c_util/rc_string_array.h" @@ -42,12 +43,12 @@ TEST_DEFINE_ENUM_TYPE(EXTERNAL_COMMAND_RESULT, EXTERNAL_COMMAND_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(); } diff --git a/tests/external_command_helper_ut/CMakeLists.txt b/tests/external_command_helper_ut/CMakeLists.txt index 53e715eb..3695e816 100644 --- a/tests/external_command_helper_ut/CMakeLists.txt +++ b/tests/external_command_helper_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 external_command_helper_ut) @@ -16,6 +16,6 @@ set(${theseTestsName}_h_files ) build_test_artifacts(${theseTestsName} "tests/c_util" - ADDITIONAL_LIBS c_pal_reals c_util_reals + ADDITIONAL_LIBS real_process_watchdog c_pal c_pal_reals c_util_reals ENABLE_TEST_FILES_PRECOMPILED_HEADERS "${CMAKE_CURRENT_LIST_DIR}/external_command_helper_ut_pch.h" ) \ No newline at end of file diff --git a/tests/external_command_helper_ut/external_command_helper_ut.c b/tests/external_command_helper_ut/external_command_helper_ut.c index 984d6e77..a932e335 100644 --- a/tests/external_command_helper_ut/external_command_helper_ut.c +++ b/tests/external_command_helper_ut/external_command_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 "external_command_helper_ut_pch.h" @@ -105,7 +105,7 @@ static void expect_store_lines(uint32_t line_count) 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_UMOCK_ALIAS_TYPE(THANDLE(RC_STRING), void*); } -TEST_SUITE_CLEANUP(suite_cleanup) +TIMED_TEST_SUITE_CLEANUP(suite_cleanup) { umock_c_deinit(); diff --git a/tests/external_command_helper_ut/external_command_helper_ut_pch.h b/tests/external_command_helper_ut/external_command_helper_ut_pch.h index eda02d8b..f058340c 100644 --- a/tests/external_command_helper_ut/external_command_helper_ut_pch.h +++ b/tests/external_command_helper_ut/external_command_helper_ut_pch.h @@ -22,6 +22,8 @@ #include "c_logging/logger.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" diff --git a/tests/filename_helper_ut/CMakeLists.txt b/tests/filename_helper_ut/CMakeLists.txt index c533b8f6..8ccc7de3 100644 --- a/tests/filename_helper_ut/CMakeLists.txt +++ b/tests/filename_helper_ut/CMakeLists.txt @@ -1,4 +1,4 @@ -#Copyright (c) Microsoft. All rights reserved. +#Copyright (c) Microsoft. All rights reserved. set(theseTestsName filename_helper_ut) @@ -14,6 +14,6 @@ set(${theseTestsName}_h_files ../../inc/c_util/filename_helper.h ) -build_test_artifacts(${theseTestsName} "tests/c_util" ADDITIONAL_LIBS c_pal_reals +build_test_artifacts(${theseTestsName} "tests/c_util" ADDITIONAL_LIBS real_process_watchdog c_pal c_pal_reals ENABLE_TEST_FILES_PRECOMPILED_HEADERS "${CMAKE_CURRENT_LIST_DIR}/filename_helper_ut_pch.h" ) \ No newline at end of file diff --git a/tests/filename_helper_ut/filename_helper_ut.c b/tests/filename_helper_ut/filename_helper_ut.c index 26f0bf9a..0376aa2e 100644 --- a/tests/filename_helper_ut/filename_helper_ut.c +++ b/tests/filename_helper_ut/filename_helper_ut.c @@ -82,7 +82,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) { ASSERT_ARE_EQUAL(int, 0, real_gballoc_hl_init(NULL, NULL)); @@ -97,7 +97,7 @@ TEST_SUITE_INITIALIZE(suite_init) REGISTER_UMOCK_VALUE_TYPE(va_list, umockvalue_stringify_va_list, umockvalue_are_equal_va_list, umockvalue_copy_va_list, umockvalue_free_va_list); } -TEST_SUITE_CLEANUP(suite_cleanup) +TIMED_TEST_SUITE_CLEANUP(suite_cleanup) { umock_c_deinit(); diff --git a/tests/filename_helper_ut/filename_helper_ut_pch.h b/tests/filename_helper_ut/filename_helper_ut_pch.h index 7a7acad1..33e7fcc4 100644 --- a/tests/filename_helper_ut/filename_helper_ut_pch.h +++ b/tests/filename_helper_ut/filename_helper_ut_pch.h @@ -19,6 +19,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" diff --git a/tests/flags_to_string_int/flags_to_string_int.c b/tests/flags_to_string_int/flags_to_string_int.c index d5339610..6ddf4b8a 100644 --- a/tests/flags_to_string_int/flags_to_string_int.c +++ b/tests/flags_to_string_int/flags_to_string_int.c @@ -7,6 +7,7 @@ #include "c_pal/gballoc_hl.h" #include "c_pal/gballoc_hl_redirect.h" +#include "c_pal/timed_test_suite.h" #include "c_util/flags_to_string.h" @@ -15,11 +16,11 @@ BEGIN_TEST_SUITE(TEST_SUITE_NAME_FROM_CMAKE) -TEST_SUITE_INITIALIZE(it_does_something) +TIMED_TEST_SUITE_INITIALIZE(it_does_something, TIMED_TEST_DEFAULT_TIMEOUT_MS) { } -TEST_SUITE_CLEANUP(TestClassCleanup) +TIMED_TEST_SUITE_CLEANUP(TestClassCleanup) { } diff --git a/tests/flags_to_string_ut/CMakeLists.txt b/tests/flags_to_string_ut/CMakeLists.txt index e8dce123..00c3d644 100644 --- a/tests/flags_to_string_ut/CMakeLists.txt +++ b/tests/flags_to_string_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 flags_to_string_ut) @@ -15,6 +15,6 @@ set(${theseTestsName}_h_files flags_to_string_helper.h ) -build_test_artifacts(${theseTestsName} "tests/c_util" ADDITIONAL_LIBS c_util_reals +build_test_artifacts(${theseTestsName} "tests/c_util" ADDITIONAL_LIBS real_process_watchdog c_pal c_util_reals ENABLE_TEST_FILES_PRECOMPILED_HEADERS "${CMAKE_CURRENT_LIST_DIR}/flags_to_string_ut_pch.h" ) \ No newline at end of file diff --git a/tests/flags_to_string_ut/flags_to_string_ut.c b/tests/flags_to_string_ut/flags_to_string_ut.c index 03cd94fb..b7613010 100644 --- a/tests/flags_to_string_ut/flags_to_string_ut.c +++ b/tests/flags_to_string_ut/flags_to_string_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 "flags_to_string_ut_pch.h" @@ -51,7 +51,7 @@ static void umockvalue_free_va_list(void* value) 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)); @@ -68,7 +68,7 @@ TEST_SUITE_INITIALIZE(suite_init) } -TEST_SUITE_CLEANUP(suite_cleanup) +TIMED_TEST_SUITE_CLEANUP(suite_cleanup) { umock_c_deinit(); diff --git a/tests/flags_to_string_ut/flags_to_string_ut_pch.h b/tests/flags_to_string_ut/flags_to_string_ut_pch.h index 28916836..089b4d99 100644 --- a/tests/flags_to_string_ut/flags_to_string_ut_pch.h +++ b/tests/flags_to_string_ut/flags_to_string_ut_pch.h @@ -19,6 +19,8 @@ #include "umock_c/umocktypes_windows.h" #include "umock_c/umock_c_negative_tests.h" +#include "c_pal/timed_test_suite.h" + #include "umock_c/umock_c_ENABLE_MOCKS.h" // ============================== ENABLE_MOCKS #include "c_pal/string_utils.h" #include "c_pal/gballoc_hl.h" diff --git a/tests/for_each_in_folder_ut/CMakeLists.txt b/tests/for_each_in_folder_ut/CMakeLists.txt index a3696660..f4031fc9 100644 --- a/tests/for_each_in_folder_ut/CMakeLists.txt +++ b/tests/for_each_in_folder_ut/CMakeLists.txt @@ -1,4 +1,4 @@ -#Copyright (c) Microsoft. All rights reserved. +#Copyright (c) Microsoft. All rights reserved. set(theseTestsName for_each_in_folder_ut) @@ -16,6 +16,6 @@ set(${theseTestsName}_h_files ) build_test_artifacts(${theseTestsName} "tests/c_util" - ADDITIONAL_LIBS c_pal_reals c_util_reals + ADDITIONAL_LIBS real_process_watchdog c_pal c_pal_reals c_util_reals ENABLE_TEST_FILES_PRECOMPILED_HEADERS "${CMAKE_CURRENT_LIST_DIR}/for_each_in_folder_ut_pch.h" ) \ No newline at end of file diff --git a/tests/for_each_in_folder_ut/for_each_in_folder_ut.c b/tests/for_each_in_folder_ut/for_each_in_folder_ut.c index e164b27b..d0201b9b 100644 --- a/tests/for_each_in_folder_ut/for_each_in_folder_ut.c +++ b/tests/for_each_in_folder_ut/for_each_in_folder_ut.c @@ -74,7 +74,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) { ASSERT_ARE_EQUAL(int, 0, real_gballoc_hl_init(NULL, NULL)); @@ -105,7 +105,7 @@ TEST_SUITE_INITIALIZE(suite_init) REGISTER_GLOBAL_MOCK_RETURNS(mocked_GetLastError, ERROR_SUCCESS, ERROR_ACCESS_DENIED); } -TEST_SUITE_CLEANUP(suite_cleanup) +TIMED_TEST_SUITE_CLEANUP(suite_cleanup) { umock_c_deinit(); diff --git a/tests/for_each_in_folder_ut/for_each_in_folder_ut_pch.h b/tests/for_each_in_folder_ut/for_each_in_folder_ut_pch.h index 8857a629..6c91bbb7 100644 --- a/tests/for_each_in_folder_ut/for_each_in_folder_ut_pch.h +++ b/tests/for_each_in_folder_ut/for_each_in_folder_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" diff --git a/tests/for_each_in_sub_folder_ut/CMakeLists.txt b/tests/for_each_in_sub_folder_ut/CMakeLists.txt index 695b2a6c..a1e29f40 100644 --- a/tests/for_each_in_sub_folder_ut/CMakeLists.txt +++ b/tests/for_each_in_sub_folder_ut/CMakeLists.txt @@ -1,4 +1,4 @@ -#Copyright (c) Microsoft. All rights reserved. +#Copyright (c) Microsoft. All rights reserved. set(theseTestsName for_each_in_sub_folder_ut) @@ -16,6 +16,6 @@ set(${theseTestsName}_h_files ) build_test_artifacts(${theseTestsName} "tests/c_util" - ADDITIONAL_LIBS c_pal_reals c_util_reals + ADDITIONAL_LIBS real_process_watchdog c_pal c_pal_reals c_util_reals ENABLE_TEST_FILES_PRECOMPILED_HEADERS "${CMAKE_CURRENT_LIST_DIR}/for_each_in_sub_folder_ut_pch.h" ) \ No newline at end of file diff --git a/tests/for_each_in_sub_folder_ut/for_each_in_sub_folder_ut.c b/tests/for_each_in_sub_folder_ut/for_each_in_sub_folder_ut.c index 579a6eff..9f10a53f 100644 --- a/tests/for_each_in_sub_folder_ut/for_each_in_sub_folder_ut.c +++ b/tests/for_each_in_sub_folder_ut/for_each_in_sub_folder_ut.c @@ -237,7 +237,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) { ASSERT_ARE_EQUAL(int, 0, real_gballoc_hl_init(NULL, NULL)); @@ -266,7 +266,7 @@ TEST_SUITE_INITIALIZE(suite_init) REGISTER_UMOCK_ALIAS_TYPE(va_list, void*); } -TEST_SUITE_CLEANUP(suite_cleanup) +TIMED_TEST_SUITE_CLEANUP(suite_cleanup) { umock_c_deinit(); diff --git a/tests/for_each_in_sub_folder_ut/for_each_in_sub_folder_ut_pch.h b/tests/for_each_in_sub_folder_ut/for_each_in_sub_folder_ut_pch.h index 208b352e..becc88c4 100644 --- a/tests/for_each_in_sub_folder_ut/for_each_in_sub_folder_ut_pch.h +++ b/tests/for_each_in_sub_folder_ut/for_each_in_sub_folder_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" diff --git a/tests/hash_ut/CMakeLists.txt b/tests/hash_ut/CMakeLists.txt index c7bf3095..fe93118d 100644 --- a/tests/hash_ut/CMakeLists.txt +++ b/tests/hash_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 hash_ut) @@ -16,6 +16,6 @@ set(${theseTestsName}_h_files ../../deps/smhasher/src/MurmurHash2.h ) -build_test_artifacts(${theseTestsName} "tests/c_util" ADDITIONAL_LIBS c_util +build_test_artifacts(${theseTestsName} "tests/c_util" ADDITIONAL_LIBS real_process_watchdog c_pal c_util ENABLE_TEST_FILES_PRECOMPILED_HEADERS "${CMAKE_CURRENT_LIST_DIR}/hash_ut_pch.h" ) \ No newline at end of file diff --git a/tests/hash_ut/hash_ut.c b/tests/hash_ut/hash_ut.c index 1c5aafb4..a3d9c515 100644 --- a/tests/hash_ut/hash_ut.c +++ b/tests/hash_ut/hash_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 "hash_ut_pch.h" @@ -17,14 +17,14 @@ MOCK_FUNCTION_END(0x42) 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, umock_c_init(on_umock_c_error), "umock_c_init"); ASSERT_ARE_EQUAL(int, 0, umocktypes_stdint_register_types(), "umocktypes_stdint_register_types"); } -TEST_SUITE_CLEANUP(suite_cleanup) +TIMED_TEST_SUITE_CLEANUP(suite_cleanup) { umock_c_deinit(); } diff --git a/tests/hash_ut/hash_ut_pch.h b/tests/hash_ut/hash_ut_pch.h index 503c4072..07269c1f 100644 --- a/tests/hash_ut/hash_ut_pch.h +++ b/tests/hash_ut/hash_ut_pch.h @@ -12,6 +12,7 @@ #include "macro_utils/macro_utils.h" #include "testrunnerswitcher.h" +#include "c_pal/timed_test_suite.h" #include "umock_c/umock_c.h" #include "umock_c/umocktypes_stdint.h" #include "umock_c/umocktypes.h" diff --git a/tests/map_ut/CMakeLists.txt b/tests/map_ut/CMakeLists.txt index fa918f2c..fb7cea27 100644 --- a/tests/map_ut/CMakeLists.txt +++ b/tests/map_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 map_ut) @@ -14,6 +14,6 @@ set(${theseTestsName}_c_files set(${theseTestsName}_h_files ) -build_test_artifacts(${theseTestsName} "tests/c_util" ADDITIONAL_LIBS c_pal c_pal_reals +build_test_artifacts(${theseTestsName} "tests/c_util" ADDITIONAL_LIBS real_process_watchdog c_pal c_pal c_pal_reals ENABLE_TEST_FILES_PRECOMPILED_HEADERS "${CMAKE_CURRENT_LIST_DIR}/map_ut_pch.h" ) \ No newline at end of file diff --git a/tests/map_ut/map_ut.c b/tests/map_ut/map_ut.c index f9237662..a0bbb1e2 100644 --- a/tests/map_ut/map_ut.c +++ b/tests/map_ut/map_ut.c @@ -77,7 +77,7 @@ static void on_umock_c_error(UMOCK_C_ERROR_CODE error_code) BEGIN_TEST_SUITE(TEST_SUITE_NAME_FROM_CMAKE) - TEST_SUITE_INITIALIZE(TestClassInitialize) + TIMED_TEST_SUITE_INITIALIZE(TestClassInitialize, TIMED_TEST_DEFAULT_TIMEOUT_MS) { int result; @@ -97,7 +97,7 @@ BEGIN_TEST_SUITE(TEST_SUITE_NAME_FROM_CMAKE) REGISTER_GLOBAL_MOCK_HOOK(STRING_new_JSON, my_STRING_new_JSON); } - TEST_SUITE_CLEANUP(TestClassCleanup) + TIMED_TEST_SUITE_CLEANUP(TestClassCleanup) { umock_c_deinit(); diff --git a/tests/map_ut/map_ut_pch.h b/tests/map_ut/map_ut_pch.h index 87672a91..f368697f 100644 --- a/tests/map_ut/map_ut_pch.h +++ b/tests/map_ut/map_ut_pch.h @@ -14,6 +14,8 @@ #include "umock_c/umock_c.h" #include "umock_c/umocktypes_charptr.h" +#include "c_pal/timed_test_suite.h" + #include "umock_c/umock_c_ENABLE_MOCKS.h" // ============================== ENABLE_MOCKS #include "c_util/strings.h" diff --git a/tests/memory_data_ut/CMakeLists.txt b/tests/memory_data_ut/CMakeLists.txt index 7d7cece2..e5f3e3f5 100644 --- a/tests/memory_data_ut/CMakeLists.txt +++ b/tests/memory_data_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 memory_data_ut) @@ -14,6 +14,6 @@ set(${theseTestsName}_c_files set(${theseTestsName}_h_files ) -build_test_artifacts(${theseTestsName} "tests/c_util" ADDITIONAL_LIBS c_util c_pal c_pal_reals +build_test_artifacts(${theseTestsName} "tests/c_util" ADDITIONAL_LIBS real_process_watchdog c_pal c_util c_pal c_pal_reals ENABLE_TEST_FILES_PRECOMPILED_HEADERS "${CMAKE_CURRENT_LIST_DIR}/memory_data_ut_pch.h" ) \ No newline at end of file diff --git a/tests/memory_data_ut/memory_data_ut.c b/tests/memory_data_ut/memory_data_ut.c index bef7f289..eebbecab 100644 --- a/tests/memory_data_ut/memory_data_ut.c +++ b/tests/memory_data_ut/memory_data_ut.c @@ -11,14 +11,14 @@ static void on_umock_c_error(UMOCK_C_ERROR_CODE error_code) BEGIN_TEST_SUITE(TEST_SUITE_NAME_FROM_CMAKE) -TEST_SUITE_INITIALIZE(a) +TIMED_TEST_SUITE_INITIALIZE(a, TIMED_TEST_DEFAULT_TIMEOUT_MS) { umock_c_init(on_umock_c_error); (void)umocktypes_stdint_register_types(); } -TEST_SUITE_CLEANUP(b) +TIMED_TEST_SUITE_CLEANUP(b) { umock_c_deinit(); } diff --git a/tests/memory_data_ut/memory_data_ut_pch.h b/tests/memory_data_ut/memory_data_ut_pch.h index c221b657..926b8436 100644 --- a/tests/memory_data_ut/memory_data_ut_pch.h +++ b/tests/memory_data_ut/memory_data_ut_pch.h @@ -15,6 +15,7 @@ #include "c_pal/gballoc_hl.h" #include "c_pal/gballoc_hl_redirect.h" +#include "c_pal/timed_test_suite.h" #include "c_util/uuid_string.h" diff --git a/tests/object_lifetime_tracker_ut/CMakeLists.txt b/tests/object_lifetime_tracker_ut/CMakeLists.txt index 9bc26846..732b972b 100644 --- a/tests/object_lifetime_tracker_ut/CMakeLists.txt +++ b/tests/object_lifetime_tracker_ut/CMakeLists.txt @@ -1,4 +1,4 @@ -#Copyright (c) Microsoft. All rights reserved. +#Copyright (c) Microsoft. All rights reserved. set(theseTestsName object_lifetime_tracker_ut) @@ -14,6 +14,6 @@ set(${theseTestsName}_h_files ../../inc/c_util/object_lifetime_tracker.h ) -build_test_artifacts(${theseTestsName} "tests/c_util" ADDITIONAL_LIBS c_util_reals c_pal_reals +build_test_artifacts(${theseTestsName} "tests/c_util" ADDITIONAL_LIBS real_process_watchdog c_pal c_util_reals c_pal_reals ENABLE_TEST_FILES_PRECOMPILED_HEADERS "${CMAKE_CURRENT_LIST_DIR}/object_lifetime_tracker_ut_pch.h" ) \ No newline at end of file diff --git a/tests/object_lifetime_tracker_ut/object_lifetime_tracker_ut.c b/tests/object_lifetime_tracker_ut/object_lifetime_tracker_ut.c index bfa87a3e..a02112c7 100644 --- a/tests/object_lifetime_tracker_ut/object_lifetime_tracker_ut.c +++ b/tests/object_lifetime_tracker_ut/object_lifetime_tracker_ut.c @@ -173,7 +173,7 @@ static void setup_object_lifetime_tracker_destroy_all_objects_for_key_expectatio 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, umock_c_init(on_umock_c_error), "umock_c_init failed"); ASSERT_ARE_EQUAL(int, 0, umocktypes_bool_register_types(), "umocktypes_bool_register_types"); @@ -200,7 +200,7 @@ TEST_SUITE_INITIALIZE(suite_init) REGISTER_TYPE(OBJECT_LIFETIME_TRACKER_ACT_RESULT, OBJECT_LIFETIME_TRACKER_ACT_RESULT); } -TEST_SUITE_CLEANUP(suite_cleanup) +TIMED_TEST_SUITE_CLEANUP(suite_cleanup) { umock_c_deinit(); } diff --git a/tests/object_lifetime_tracker_ut/object_lifetime_tracker_ut_pch.h b/tests/object_lifetime_tracker_ut/object_lifetime_tracker_ut_pch.h index e89c426b..5b3c1044 100644 --- a/tests/object_lifetime_tracker_ut/object_lifetime_tracker_ut_pch.h +++ b/tests/object_lifetime_tracker_ut/object_lifetime_tracker_ut_pch.h @@ -18,6 +18,8 @@ #include "umock_c/umocktypes_stdint.h" #include "umock_c/umock_c_negative_tests.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" diff --git a/tests/paged_sparse_array_int/paged_sparse_array_int.c b/tests/paged_sparse_array_int/paged_sparse_array_int.c index f82c6ab4..9583cd12 100644 --- a/tests/paged_sparse_array_int/paged_sparse_array_int.c +++ b/tests/paged_sparse_array_int/paged_sparse_array_int.c @@ -15,6 +15,7 @@ #include "c_pal/interlocked.h" #include "c_pal/thandle.h" #include "c_pal/threadapi.h" +#include "c_pal/timed_test_suite.h" #include "c_util/paged_sparse_array.h" @@ -68,14 +69,14 @@ TEST_DEFINE_ENUM_TYPE(PAGED_SPARSE_ARRAY_GET_RESULT, PAGED_SPARSE_ARRAY_GET_RESU BEGIN_TEST_SUITE(TEST_SUITE_NAME_FROM_CMAKE) -TEST_SUITE_INITIALIZE(suite_init) +TIMED_TEST_SUITE_INITIALIZE(suite_init, TIMED_TEST_DEFAULT_TIMEOUT_MS) { time_t seed = time(NULL); LogInfo("Test using random seed=%u", (unsigned int)seed); srand((unsigned int)seed); } -TEST_SUITE_CLEANUP(suite_cleanup) +TIMED_TEST_SUITE_CLEANUP(suite_cleanup) { } diff --git a/tests/paged_sparse_array_ut/CMakeLists.txt b/tests/paged_sparse_array_ut/CMakeLists.txt index 5e5b3ff9..dad93738 100644 --- a/tests/paged_sparse_array_ut/CMakeLists.txt +++ b/tests/paged_sparse_array_ut/CMakeLists.txt @@ -14,6 +14,6 @@ set(${theseTestsName}_h_files ../../inc/c_util/paged_sparse_array.h ) -build_test_artifacts(${theseTestsName} "tests/c_util" ADDITIONAL_LIBS c_pal c_pal_reals c_util c_util_reals +build_test_artifacts(${theseTestsName} "tests/c_util" ADDITIONAL_LIBS real_process_watchdog c_pal c_pal c_pal_reals c_util c_util_reals ENABLE_TEST_FILES_PRECOMPILED_HEADERS "${CMAKE_CURRENT_LIST_DIR}/paged_sparse_array_ut_pch.h" ) diff --git a/tests/paged_sparse_array_ut/paged_sparse_array_ut.c b/tests/paged_sparse_array_ut/paged_sparse_array_ut.c index b112c568..24a68498 100644 --- a/tests/paged_sparse_array_ut/paged_sparse_array_ut.c +++ b/tests/paged_sparse_array_ut/paged_sparse_array_ut.c @@ -53,7 +53,7 @@ static void on_umock_c_error(UMOCK_C_ERROR_CODE error_code) BEGIN_TEST_SUITE(TEST_SUITE_NAME_FROM_CMAKE) -TEST_SUITE_INITIALIZE(it_does_something) +TIMED_TEST_SUITE_INITIALIZE(it_does_something, TIMED_TEST_DEFAULT_TIMEOUT_MS) { ASSERT_ARE_EQUAL(int, 0, real_gballoc_hl_init(NULL, NULL)); @@ -62,7 +62,7 @@ TEST_SUITE_INITIALIZE(it_does_something) REGISTER_GBALLOC_HL_GLOBAL_MOCK_HOOK(); } -TEST_SUITE_CLEANUP(TestClassCleanup) +TIMED_TEST_SUITE_CLEANUP(TestClassCleanup) { umock_c_deinit(); diff --git a/tests/paged_sparse_array_ut/paged_sparse_array_ut_pch.h b/tests/paged_sparse_array_ut/paged_sparse_array_ut_pch.h index 81b9eb8a..c57cc88c 100644 --- a/tests/paged_sparse_array_ut/paged_sparse_array_ut_pch.h +++ b/tests/paged_sparse_array_ut/paged_sparse_array_ut_pch.h @@ -19,6 +19,8 @@ #include "umock_c/umock_c.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" diff --git a/tests/rc_ptr_ut/CMakeLists.txt b/tests/rc_ptr_ut/CMakeLists.txt index 20e4924f..81bae635 100644 --- a/tests/rc_ptr_ut/CMakeLists.txt +++ b/tests/rc_ptr_ut/CMakeLists.txt @@ -1,4 +1,4 @@ -#Copyright (c) Microsoft. All rights reserved. +#Copyright (c) Microsoft. All rights reserved. set(theseTestsName rc_ptr_ut) @@ -15,6 +15,6 @@ set(${theseTestsName}_h_files ) build_test_artifacts(${theseTestsName} "tests/c_util" - ADDITIONAL_LIBS c_util_reals c_pal_reals c_pal + ADDITIONAL_LIBS real_process_watchdog c_pal c_util_reals c_pal_reals c_pal ENABLE_TEST_FILES_PRECOMPILED_HEADERS "${CMAKE_CURRENT_LIST_DIR}/rc_ptr_ut_pch.h" ) \ No newline at end of file diff --git a/tests/rc_ptr_ut/rc_ptr_ut.c b/tests/rc_ptr_ut/rc_ptr_ut.c index ad52e026..0b8513c4 100644 --- a/tests/rc_ptr_ut/rc_ptr_ut.c +++ b/tests/rc_ptr_ut/rc_ptr_ut.c @@ -27,7 +27,7 @@ static void check_free_func_called(void* context, void* ptr) 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, umock_c_init(on_umock_c_error), "umock_c_init failed"); ASSERT_ARE_EQUAL(int, 0, umocktypes_bool_register_types(), "umocktypes_bool_register_types"); @@ -38,7 +38,7 @@ TEST_SUITE_INITIALIZE(suite_init) REGISTER_GLOBAL_MOCK_FAIL_RETURN(malloc, NULL); } -TEST_SUITE_CLEANUP(suite_cleanup) +TIMED_TEST_SUITE_CLEANUP(suite_cleanup) { umock_c_deinit(); } diff --git a/tests/rc_ptr_ut/rc_ptr_ut_pch.h b/tests/rc_ptr_ut/rc_ptr_ut_pch.h index 4de339ef..e43b5145 100644 --- a/tests/rc_ptr_ut/rc_ptr_ut_pch.h +++ b/tests/rc_ptr_ut/rc_ptr_ut_pch.h @@ -20,6 +20,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" diff --git a/tests/rc_string_array_ut/CMakeLists.txt b/tests/rc_string_array_ut/CMakeLists.txt index 4f8b9532..3b8d0bbe 100644 --- a/tests/rc_string_array_ut/CMakeLists.txt +++ b/tests/rc_string_array_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 rc_string_array_ut) @@ -15,6 +15,6 @@ set(${theseTestsName}_h_files ../../inc/c_util/rc_string_array.h ) -build_test_artifacts(${theseTestsName} "tests/c_util" ADDITIONAL_LIBS c_pal c_util_reals c_pal_reals +build_test_artifacts(${theseTestsName} "tests/c_util" ADDITIONAL_LIBS real_process_watchdog c_pal c_pal c_util_reals c_pal_reals ENABLE_TEST_FILES_PRECOMPILED_HEADERS "${CMAKE_CURRENT_LIST_DIR}/rc_string_array_ut_pch.h" ) \ No newline at end of file diff --git a/tests/rc_string_array_ut/rc_string_array_ut.c b/tests/rc_string_array_ut/rc_string_array_ut.c index 1617944b..bfc696f2 100644 --- a/tests/rc_string_array_ut/rc_string_array_ut.c +++ b/tests/rc_string_array_ut/rc_string_array_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 "rc_string_array_ut_pch.h" @@ -12,7 +12,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) { ASSERT_ARE_EQUAL(int, 0, real_gballoc_hl_init(NULL, NULL)); @@ -27,7 +27,7 @@ TEST_SUITE_INITIALIZE(suite_init) REGISTER_UMOCK_ALIAS_TYPE(THANDLE(RC_STRING), void*); } -TEST_SUITE_CLEANUP(suite_cleanup) +TIMED_TEST_SUITE_CLEANUP(suite_cleanup) { umock_c_deinit(); diff --git a/tests/rc_string_array_ut/rc_string_array_ut_pch.h b/tests/rc_string_array_ut/rc_string_array_ut_pch.h index ddf84076..e78e5257 100644 --- a/tests/rc_string_array_ut/rc_string_array_ut_pch.h +++ b/tests/rc_string_array_ut/rc_string_array_ut_pch.h @@ -19,6 +19,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" diff --git a/tests/rc_string_ut/CMakeLists.txt b/tests/rc_string_ut/CMakeLists.txt index 87663810..61d66c18 100644 --- a/tests/rc_string_ut/CMakeLists.txt +++ b/tests/rc_string_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 rc_string_ut) @@ -15,6 +15,6 @@ set(${theseTestsName}_h_files ../../inc/c_util/rc_string.h ) -build_test_artifacts(${theseTestsName} "tests/c_util" ADDITIONAL_LIBS c_pal c_pal_reals +build_test_artifacts(${theseTestsName} "tests/c_util" ADDITIONAL_LIBS real_process_watchdog c_pal c_pal c_pal_reals ENABLE_TEST_FILES_PRECOMPILED_HEADERS "${CMAKE_CURRENT_LIST_DIR}/rc_string_ut_pch.h" ) \ No newline at end of file diff --git a/tests/rc_string_ut/rc_string_ut.c b/tests/rc_string_ut/rc_string_ut.c index b4afe2be..0cfe3136 100644 --- a/tests/rc_string_ut/rc_string_ut.c +++ b/tests/rc_string_ut/rc_string_ut.c @@ -77,7 +77,7 @@ MOCK_FUNCTION_END() BEGIN_TEST_SUITE(TEST_SUITE_NAME_FROM_CMAKE) -TEST_SUITE_INITIALIZE(suite_initialize) +TIMED_TEST_SUITE_INITIALIZE(suite_initialize, TIMED_TEST_DEFAULT_TIMEOUT_MS) { ASSERT_ARE_EQUAL(int, 0, real_gballoc_hl_init(NULL, NULL)); @@ -97,7 +97,7 @@ TEST_SUITE_INITIALIZE(suite_initialize) REGISTER_GLOBAL_MOCK_FAIL_RETURN(malloc, NULL); } -TEST_SUITE_CLEANUP(suite_cleanup) +TIMED_TEST_SUITE_CLEANUP(suite_cleanup) { umock_c_deinit(); diff --git a/tests/rc_string_ut/rc_string_ut_pch.h b/tests/rc_string_ut/rc_string_ut_pch.h index ff1de471..d5bb63ac 100644 --- a/tests/rc_string_ut/rc_string_ut_pch.h +++ b/tests/rc_string_ut/rc_string_ut_pch.h @@ -20,6 +20,8 @@ #include "umock_c/umock_c_negative_tests.h" #include "umock_c/umocktypes_charptr.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" diff --git a/tests/rc_string_utils_ut/CMakeLists.txt b/tests/rc_string_utils_ut/CMakeLists.txt index 3f2c74ee..d0fb3055 100644 --- a/tests/rc_string_utils_ut/CMakeLists.txt +++ b/tests/rc_string_utils_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 rc_string_utils_ut) @@ -15,6 +15,6 @@ set(${theseTestsName}_h_files ../../inc/c_util/rc_string_utils.h ) -build_test_artifacts(${theseTestsName} "tests/c_util" ADDITIONAL_LIBS c_pal c_util_reals c_pal_reals c_util_test_helpers +build_test_artifacts(${theseTestsName} "tests/c_util" ADDITIONAL_LIBS real_process_watchdog c_pal c_pal c_util_reals c_pal_reals c_util_test_helpers ENABLE_TEST_FILES_PRECOMPILED_HEADERS "${CMAKE_CURRENT_LIST_DIR}/rc_string_utils_ut_pch.h" ) \ No newline at end of file diff --git a/tests/rc_string_utils_ut/rc_string_utils_ut.c b/tests/rc_string_utils_ut/rc_string_utils_ut.c index 96278e9a..116daf98 100644 --- a/tests/rc_string_utils_ut/rc_string_utils_ut.c +++ b/tests/rc_string_utils_ut/rc_string_utils_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 "rc_string_utils_ut_pch.h" @@ -35,7 +35,7 @@ static void validate_split(RC_STRING_ARRAY* result, uint32_t count, const char** 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)); @@ -53,7 +53,7 @@ TEST_SUITE_INITIALIZE(suite_init) REGISTER_UMOCK_ALIAS_TYPE(THANDLE(RC_STRING), void*); } -TEST_SUITE_CLEANUP(suite_cleanup) +TIMED_TEST_SUITE_CLEANUP(suite_cleanup) { umock_c_deinit(); diff --git a/tests/rc_string_utils_ut/rc_string_utils_ut_pch.h b/tests/rc_string_utils_ut/rc_string_utils_ut_pch.h index 9c6e35d6..909fe761 100644 --- a/tests/rc_string_utils_ut/rc_string_utils_ut_pch.h +++ b/tests/rc_string_utils_ut/rc_string_utils_ut_pch.h @@ -17,6 +17,8 @@ #include "umock_c/umocktypes.h" #include "umock_c/umock_c_negative_tests.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" diff --git a/tests/reals_ut/CMakeLists.txt b/tests/reals_ut/CMakeLists.txt index 30447392..f954387c 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 c_util_reals_ut) @@ -7,7 +7,7 @@ set(${theseTestsName}_test_files ${theseTestsName}.c ) -build_test_artifacts(${theseTestsName} "tests/c_util" ADDITIONAL_LIBS c_util c_util_reals c_pal +build_test_artifacts(${theseTestsName} "tests/c_util" ADDITIONAL_LIBS real_process_watchdog c_pal c_util c_util_reals c_pal ENABLE_TEST_FILES_PRECOMPILED_HEADERS "${CMAKE_CURRENT_LIST_DIR}/c_util_reals_ut_pch.h" ) diff --git a/tests/reals_ut/c_util_reals_ut_pch.h b/tests/reals_ut/c_util_reals_ut_pch.h index 3481a464..7a29f850 100644 --- a/tests/reals_ut/c_util_reals_ut_pch.h +++ b/tests/reals_ut/c_util_reals_ut_pch.h @@ -7,6 +7,7 @@ #define C_UTIL_REALS_UT_PCH_H #include "testrunnerswitcher.h" +#include "c_pal/timed_test_suite.h" #define REGISTER_GLOBAL_MOCK_HOOK(original, real) \ (original == real) ? (void)0 : (void)1; diff --git a/tests/singlylinkedlist_ut/CMakeLists.txt b/tests/singlylinkedlist_ut/CMakeLists.txt index c5b0cbe3..7f7071f7 100644 --- a/tests/singlylinkedlist_ut/CMakeLists.txt +++ b/tests/singlylinkedlist_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 singlylinkedlist_ut) @@ -15,6 +15,6 @@ set(${theseTestsName}_h_files ) build_test_artifacts(${theseTestsName} "tests/c_util" - ADDITIONAL_LIBS c_pal c_pal_reals + ADDITIONAL_LIBS real_process_watchdog c_pal c_pal c_pal_reals ENABLE_TEST_FILES_PRECOMPILED_HEADERS "${CMAKE_CURRENT_LIST_DIR}/singlylinkedlist_ut_pch.h" ) \ No newline at end of file diff --git a/tests/singlylinkedlist_ut/singlylinkedlist_ut.c b/tests/singlylinkedlist_ut/singlylinkedlist_ut.c index ffc78a9d..6451142c 100644 --- a/tests/singlylinkedlist_ut/singlylinkedlist_ut.c +++ b/tests/singlylinkedlist_ut/singlylinkedlist_ut.c @@ -19,7 +19,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; @@ -33,7 +33,7 @@ TEST_SUITE_INITIALIZE(suite_init) REGISTER_UMOCK_ALIAS_TYPE(LIST_ITEM_HANDLE, void*); } -TEST_SUITE_CLEANUP(suite_cleanup) +TIMED_TEST_SUITE_CLEANUP(suite_cleanup) { umock_c_deinit(); } diff --git a/tests/singlylinkedlist_ut/singlylinkedlist_ut_pch.h b/tests/singlylinkedlist_ut/singlylinkedlist_ut_pch.h index 4bda48e6..7c0bce03 100644 --- a/tests/singlylinkedlist_ut/singlylinkedlist_ut_pch.h +++ b/tests/singlylinkedlist_ut/singlylinkedlist_ut_pch.h @@ -16,6 +16,8 @@ #include "umock_c/umocktypes_bool.h" #include "c_util/singlylinkedlist.h" +#include "c_pal/timed_test_suite.h" + #include "umock_c/umock_c_ENABLE_MOCKS.h" // ============================== ENABLE_MOCKS /* test match function mock */ diff --git a/tests/sliding_window_average_by_count_ut/CMakeLists.txt b/tests/sliding_window_average_by_count_ut/CMakeLists.txt index 6e6ac35f..48c6be4f 100644 --- a/tests/sliding_window_average_by_count_ut/CMakeLists.txt +++ b/tests/sliding_window_average_by_count_ut/CMakeLists.txt @@ -1,4 +1,4 @@ -#Copyright (c) Microsoft. All rights reserved. +#Copyright (c) Microsoft. All rights reserved. set(theseTestsName sliding_window_average_by_count_ut) @@ -14,6 +14,6 @@ set(${theseTestsName}_h_files ../../inc/c_util/sliding_window_average_by_count.h ) -build_test_artifacts(${theseTestsName} "tests/c_util" ADDITIONAL_LIBS c_pal c_pal_reals c_pal_umocktypes +build_test_artifacts(${theseTestsName} "tests/c_util" ADDITIONAL_LIBS real_process_watchdog c_pal c_pal c_pal_reals c_pal_umocktypes ENABLE_TEST_FILES_PRECOMPILED_HEADERS "${CMAKE_CURRENT_LIST_DIR}/sliding_window_average_by_count_ut_pch.h" ) \ No newline at end of file diff --git a/tests/sliding_window_average_by_count_ut/sliding_window_average_by_count_ut.c b/tests/sliding_window_average_by_count_ut/sliding_window_average_by_count_ut.c index 4106d9c7..7b263b17 100644 --- a/tests/sliding_window_average_by_count_ut/sliding_window_average_by_count_ut.c +++ b/tests/sliding_window_average_by_count_ut/sliding_window_average_by_count_ut.c @@ -23,7 +23,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) { ASSERT_ARE_EQUAL(int, 0, real_gballoc_hl_init(NULL, NULL)); @@ -41,7 +41,7 @@ TEST_SUITE_INITIALIZE(suite_init) REGISTER_GLOBAL_MOCK_FAIL_RETURN(malloc, NULL); } -TEST_SUITE_CLEANUP(suite_cleanup) +TIMED_TEST_SUITE_CLEANUP(suite_cleanup) { umock_c_deinit(); real_gballoc_hl_deinit(); diff --git a/tests/sliding_window_average_by_count_ut/sliding_window_average_by_count_ut_pch.h b/tests/sliding_window_average_by_count_ut/sliding_window_average_by_count_ut_pch.h index b0f03dc5..98137d4c 100644 --- a/tests/sliding_window_average_by_count_ut/sliding_window_average_by_count_ut_pch.h +++ b/tests/sliding_window_average_by_count_ut/sliding_window_average_by_count_ut_pch.h @@ -19,6 +19,8 @@ #include "umock_c/umocktypes_stdint.h" #include "umock_c/umocktypes_struct.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" diff --git a/tests/strings_ut/CMakeLists.txt b/tests/strings_ut/CMakeLists.txt index d363db31..0e147ff4 100644 --- a/tests/strings_ut/CMakeLists.txt +++ b/tests/strings_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 strings_ut) @@ -14,6 +14,6 @@ set(${theseTestsName}_c_files set(${theseTestsName}_h_files ) -build_test_artifacts(${theseTestsName} "tests/c_util" ADDITIONAL_LIBS c_pal c_pal_reals +build_test_artifacts(${theseTestsName} "tests/c_util" ADDITIONAL_LIBS real_process_watchdog c_pal c_pal c_pal_reals ENABLE_TEST_FILES_PRECOMPILED_HEADERS "${CMAKE_CURRENT_LIST_DIR}/strings_ut_pch.h" ) \ No newline at end of file diff --git a/tests/strings_ut/strings_ut.c b/tests/strings_ut/strings_ut.c index dd83d5b3..c9ba8d2b 100644 --- a/tests/strings_ut/strings_ut.c +++ b/tests/strings_ut/strings_ut.c @@ -46,7 +46,7 @@ static void on_umock_c_error(UMOCK_C_ERROR_CODE error_code) BEGIN_TEST_SUITE(TEST_SUITE_NAME_FROM_CMAKE) - TEST_SUITE_INITIALIZE(setsBufferTempSize) + TIMED_TEST_SUITE_INITIALIZE(setsBufferTempSize, TIMED_TEST_DEFAULT_TIMEOUT_MS) { ASSERT_ARE_EQUAL(int, 0, real_gballoc_hl_init(NULL, NULL)); @@ -60,7 +60,7 @@ BEGIN_TEST_SUITE(TEST_SUITE_NAME_FROM_CMAKE) REGISTER_GLOBAL_MOCK_FAIL_RETURN(realloc, NULL); } - TEST_SUITE_CLEANUP(TestClassCleanup) + TIMED_TEST_SUITE_CLEANUP(TestClassCleanup) { umock_c_deinit(); diff --git a/tests/strings_ut/strings_ut_pch.h b/tests/strings_ut/strings_ut_pch.h index 56ca6067..7ee3e839 100644 --- a/tests/strings_ut/strings_ut_pch.h +++ b/tests/strings_ut/strings_ut_pch.h @@ -15,6 +15,8 @@ #include "umock_c/umock_c_negative_tests.h" #include "umock_c/umocktypes_charptr.h" +#include "c_pal/timed_test_suite.h" + #include "umock_c/umock_c_ENABLE_MOCKS.h" // ============================== ENABLE_MOCKS #include "c_pal/gballoc_hl.h" diff --git a/tests/sync_wrapper_ut/CMakeLists.txt b/tests/sync_wrapper_ut/CMakeLists.txt index 6c4543e4..1b3f0410 100644 --- a/tests/sync_wrapper_ut/CMakeLists.txt +++ b/tests/sync_wrapper_ut/CMakeLists.txt @@ -1,4 +1,4 @@ -#Copyright (c) Microsoft. All rights reserved. +#Copyright (c) Microsoft. All rights reserved. set(theseTestsName sync_wrapper_ut) @@ -19,6 +19,6 @@ set(${theseTestsName}_h_files test_ref_counted.h ) -build_test_artifacts(${theseTestsName} "tests/c_util" ADDITIONAL_LIBS c_pal_reals c_util_reals +build_test_artifacts(${theseTestsName} "tests/c_util" ADDITIONAL_LIBS real_process_watchdog c_pal c_pal_reals c_util_reals ENABLE_TEST_FILES_PRECOMPILED_HEADERS "${CMAKE_CURRENT_LIST_DIR}/sync_wrapper_ut_pch.h" ) \ No newline at end of file diff --git a/tests/sync_wrapper_ut/sync_wrapper_ut.c b/tests/sync_wrapper_ut/sync_wrapper_ut.c index 43aa7af6..92c6c99a 100644 --- a/tests/sync_wrapper_ut/sync_wrapper_ut.c +++ b/tests/sync_wrapper_ut/sync_wrapper_ut.c @@ -111,7 +111,7 @@ INTERLOCKED_HL_RESULT my_InterlockedHL_WaitForValue(int32_t volatile_atomic* add 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)); @@ -144,7 +144,7 @@ TEST_SUITE_INITIALIZE(suite_init) REGISTER_TYPE(INTERLOCKED_HL_RESULT, INTERLOCKED_HL_RESULT); } -TEST_SUITE_CLEANUP(suite_cleanup) +TIMED_TEST_SUITE_CLEANUP(suite_cleanup) { umock_c_deinit(); diff --git a/tests/sync_wrapper_ut/sync_wrapper_ut_pch.h b/tests/sync_wrapper_ut/sync_wrapper_ut_pch.h index 873c023a..3a57da36 100644 --- a/tests/sync_wrapper_ut/sync_wrapper_ut_pch.h +++ b/tests/sync_wrapper_ut/sync_wrapper_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/sync.h" /*included for mocking reasons - it will prohibit creation of mocks belonging to sync.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" diff --git a/tests/tarray_2_int/tarray_2_int.c b/tests/tarray_2_int/tarray_2_int.c index 829e0557..b599dc85 100644 --- a/tests/tarray_2_int/tarray_2_int.c +++ b/tests/tarray_2_int/tarray_2_int.c @@ -15,6 +15,7 @@ #include "c_pal/threadapi.h" #include "c_pal/thandle.h" +#include "c_pal/timed_test_suite.h" #include "c_util/tarray.h" TEST_DEFINE_ENUM_TYPE(THREADAPI_RESULT, THREADAPI_RESULT_VALUES); @@ -36,11 +37,11 @@ TARRAY_TYPE_DEFINE(CAT); BEGIN_TEST_SUITE(TEST_SUITE_NAME_FROM_CMAKE) -TEST_SUITE_INITIALIZE(it_does_something) +TIMED_TEST_SUITE_INITIALIZE(it_does_something, TIMED_TEST_DEFAULT_TIMEOUT_MS) { } -TEST_SUITE_CLEANUP(it_undoes_something) +TIMED_TEST_SUITE_CLEANUP(it_undoes_something) { } diff --git a/tests/tarray_int/CMakeLists.txt b/tests/tarray_int/CMakeLists.txt index 3cd10608..330e48e8 100644 --- a/tests/tarray_int/CMakeLists.txt +++ b/tests/tarray_int/CMakeLists.txt @@ -17,5 +17,5 @@ play_undo_op_types.h play_undo_op_tarray_types.h ) -build_test_artifacts(${theseTestsName} "tests/c_util" ADDITIONAL_LIBS c_pal c_pal_reals c_util_reals tarray_int_reals) +build_test_artifacts(${theseTestsName} "tests/c_util" ADDITIONAL_LIBS real_process_watchdog c_pal_ll_reals c_pal c_pal_reals c_util_reals tarray_int_reals) diff --git a/tests/tarray_int/tarray_int.c b/tests/tarray_int/tarray_int.c index 62c0bcea..0ed99d47 100644 --- a/tests/tarray_int/tarray_int.c +++ b/tests/tarray_int/tarray_int.c @@ -16,6 +16,7 @@ #include "umock_c/umock_c.h" #include "c_pal/gballoc_hl.h" #include "c_pal/gballoc_hl_redirect.h" +#include "c_pal/timed_test_suite.h" #include "play_undo_op_types.h" #include "play_undo_op_tarray_types.h" #include "umock_c/umock_c_DISABLE_MOCKS.h" // ============================== DISABLE_MOCKS @@ -34,7 +35,7 @@ static void on_umock_c_error(UMOCK_C_ERROR_CODE error_code) BEGIN_TEST_SUITE(TEST_SUITE_NAME_FROM_CMAKE) -TEST_SUITE_INITIALIZE(it_does_something) +TIMED_TEST_SUITE_INITIALIZE(it_does_something, TIMED_TEST_DEFAULT_TIMEOUT_MS) { ASSERT_ARE_EQUAL(int, 0, real_gballoc_hl_init(NULL, NULL)); @@ -48,7 +49,7 @@ TEST_SUITE_INITIALIZE(it_does_something) REGISTER_TARRAY_UNDO_OP_GLOBAL_MOCK_HOOK(); } -TEST_SUITE_CLEANUP(TestClassCleanup) +TIMED_TEST_SUITE_CLEANUP(TestClassCleanup) { umock_c_deinit(); diff --git a/tests/tarray_ut/CMakeLists.txt b/tests/tarray_ut/CMakeLists.txt index ef2d9bda..4b25808e 100644 --- a/tests/tarray_ut/CMakeLists.txt +++ b/tests/tarray_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 tarray_ut) @@ -14,6 +14,6 @@ set(${theseTestsName}_h_files ../../inc/c_util/tarray.h ) -build_test_artifacts(${theseTestsName} "tests/c_util" ADDITIONAL_LIBS c_pal c_pal_reals +build_test_artifacts(${theseTestsName} "tests/c_util" ADDITIONAL_LIBS real_process_watchdog c_pal c_pal c_pal_reals ENABLE_TEST_FILES_PRECOMPILED_HEADERS "${CMAKE_CURRENT_LIST_DIR}/tarray_ut_pch.h" ) diff --git a/tests/tarray_ut/tarray_ut.c b/tests/tarray_ut/tarray_ut.c index 4203c18c..d24eb983 100644 --- a/tests/tarray_ut/tarray_ut.c +++ b/tests/tarray_ut/tarray_ut.c @@ -43,7 +43,7 @@ static void on_umock_c_error(UMOCK_C_ERROR_CODE error_code) BEGIN_TEST_SUITE(TEST_SUITE_NAME_FROM_CMAKE) -TEST_SUITE_INITIALIZE(it_does_something) +TIMED_TEST_SUITE_INITIALIZE(it_does_something, TIMED_TEST_DEFAULT_TIMEOUT_MS) { ASSERT_ARE_EQUAL(int, 0, real_gballoc_hl_init(NULL, NULL)); @@ -52,7 +52,7 @@ TEST_SUITE_INITIALIZE(it_does_something) REGISTER_GBALLOC_HL_GLOBAL_MOCK_HOOK(); } -TEST_SUITE_CLEANUP(TestClassCleanup) +TIMED_TEST_SUITE_CLEANUP(TestClassCleanup) { umock_c_deinit(); diff --git a/tests/tarray_ut/tarray_ut_pch.h b/tests/tarray_ut/tarray_ut_pch.h index 099c641d..8ae2dfde 100644 --- a/tests/tarray_ut/tarray_ut_pch.h +++ b/tests/tarray_ut/tarray_ut_pch.h @@ -17,6 +17,8 @@ #include "umock_c/umock_c.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" diff --git a/tests/tcall_dispatcher_int/tcall_dispatcher_int.c b/tests/tcall_dispatcher_int/tcall_dispatcher_int.c index a6341b3f..ece951ca 100644 --- a/tests/tcall_dispatcher_int/tcall_dispatcher_int.c +++ b/tests/tcall_dispatcher_int/tcall_dispatcher_int.c @@ -14,6 +14,7 @@ #include "c_pal/interlocked.h" #include "c_pal/thandle.h" #include "c_pal/threadapi.h" +#include "c_pal/timed_test_suite.h" #include "c_util/tcall_dispatcher.h" #include "tcall_dispatcher_foo.h" @@ -69,11 +70,11 @@ 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) { } -TEST_SUITE_CLEANUP(suite_cleanup) +TIMED_TEST_SUITE_CLEANUP(suite_cleanup) { } diff --git a/tests/tcall_dispatcher_ut/CMakeLists.txt b/tests/tcall_dispatcher_ut/CMakeLists.txt index 5fa68c4f..0f78cb51 100644 --- a/tests/tcall_dispatcher_ut/CMakeLists.txt +++ b/tests/tcall_dispatcher_ut/CMakeLists.txt @@ -1,4 +1,4 @@ -#Copyright (c) Microsoft. All rights reserved. +#Copyright (c) Microsoft. All rights reserved. set(theseTestsName tcall_dispatcher_ut) @@ -14,6 +14,6 @@ set(${theseTestsName}_h_files ../../inc/c_util/tcall_dispatcher.h ) -build_test_artifacts(${theseTestsName} "tests/c_util" ADDITIONAL_LIBS c_pal c_pal_reals c_util c_util_reals +build_test_artifacts(${theseTestsName} "tests/c_util" ADDITIONAL_LIBS real_process_watchdog c_pal c_pal c_pal_reals c_util c_util_reals ENABLE_TEST_FILES_PRECOMPILED_HEADERS "${CMAKE_CURRENT_LIST_DIR}/tcall_dispatcher_ut_pch.h" ) \ No newline at end of file diff --git a/tests/tcall_dispatcher_ut/tcall_dispatcher_ut.c b/tests/tcall_dispatcher_ut/tcall_dispatcher_ut.c index bd8446ef..bc3cfa75 100644 --- a/tests/tcall_dispatcher_ut/tcall_dispatcher_ut.c +++ b/tests/tcall_dispatcher_ut/tcall_dispatcher_ut.c @@ -47,7 +47,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) { ASSERT_ARE_EQUAL(int, 0, real_gballoc_hl_init(NULL, NULL)); @@ -67,7 +67,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/tcall_dispatcher_ut/tcall_dispatcher_ut_pch.h b/tests/tcall_dispatcher_ut/tcall_dispatcher_ut_pch.h index dfc4135f..6b538cd5 100644 --- a/tests/tcall_dispatcher_ut/tcall_dispatcher_ut_pch.h +++ b/tests/tcall_dispatcher_ut/tcall_dispatcher_ut_pch.h @@ -20,6 +20,8 @@ #include "c_pal/thandle.h" +#include "c_pal/timed_test_suite.h" + #include "umock_c/umock_c_ENABLE_MOCKS.h" // ============================== ENABLE_MOCKS #include "c_pal/gballoc_hl.h" diff --git a/tests/thandle_tuple_array_ut/CMakeLists.txt b/tests/thandle_tuple_array_ut/CMakeLists.txt index 8c8db257..9a21fce3 100644 --- a/tests/thandle_tuple_array_ut/CMakeLists.txt +++ b/tests/thandle_tuple_array_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 thandle_tuple_array_ut) @@ -14,6 +14,6 @@ set(${theseTestsName}_h_files ../../inc/c_util/thandle_tuple_array.h ) -build_test_artifacts(${theseTestsName} "tests/c_util" ADDITIONAL_LIBS c_pal c_util_reals c_pal_reals +build_test_artifacts(${theseTestsName} "tests/c_util" ADDITIONAL_LIBS real_process_watchdog c_pal c_pal c_util_reals c_pal_reals ENABLE_TEST_FILES_PRECOMPILED_HEADERS "${CMAKE_CURRENT_LIST_DIR}/thandle_tuple_array_ut_pch.h" ) \ No newline at end of file diff --git a/tests/thandle_tuple_array_ut/thandle_tuple_array_ut.c b/tests/thandle_tuple_array_ut/thandle_tuple_array_ut.c index 175a599e..5a3ec809 100644 --- a/tests/thandle_tuple_array_ut/thandle_tuple_array_ut.c +++ b/tests/thandle_tuple_array_ut/thandle_tuple_array_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 "thandle_tuple_array_ut_pch.h" @@ -27,7 +27,7 @@ DEFINE_THANDLE_TUPLE_ARRAY(TUPLE_THREE, TUPLE_THREE_FIELDS); 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)); @@ -42,7 +42,7 @@ TEST_SUITE_INITIALIZE(suite_init) REGISTER_UMOCK_ALIAS_TYPE(THANDLE(RC_STRING), void*); } -TEST_SUITE_CLEANUP(suite_cleanup) +TIMED_TEST_SUITE_CLEANUP(suite_cleanup) { umock_c_deinit(); diff --git a/tests/thandle_tuple_array_ut/thandle_tuple_array_ut_pch.h b/tests/thandle_tuple_array_ut/thandle_tuple_array_ut_pch.h index a13548dd..16678f8a 100644 --- a/tests/thandle_tuple_array_ut/thandle_tuple_array_ut_pch.h +++ b/tests/thandle_tuple_array_ut/thandle_tuple_array_ut_pch.h @@ -19,6 +19,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" diff --git a/tests/thread_notifications_dispatcher_int/thread_notifications_dispatcher_int.c b/tests/thread_notifications_dispatcher_int/thread_notifications_dispatcher_int.c index f18d050b..2970a26e 100644 --- a/tests/thread_notifications_dispatcher_int/thread_notifications_dispatcher_int.c +++ b/tests/thread_notifications_dispatcher_int/thread_notifications_dispatcher_int.c @@ -16,6 +16,7 @@ #include "c_pal/interlocked.h" #include "c_pal/interlocked_hl.h" #include "c_pal/sync.h" +#include "c_pal/timed_test_suite.h" #include "thread_notifications_lackey_dll/thread_notifications_lackey_dll.h" #include "c_util/tcall_dispatcher_thread_notification_call.h" @@ -23,12 +24,12 @@ 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(); } diff --git a/tests/thread_notifications_dispatcher_ut/CMakeLists.txt b/tests/thread_notifications_dispatcher_ut/CMakeLists.txt index d8e48d30..a773092c 100644 --- a/tests/thread_notifications_dispatcher_ut/CMakeLists.txt +++ b/tests/thread_notifications_dispatcher_ut/CMakeLists.txt @@ -1,4 +1,4 @@ -#Copyright (c) Microsoft. All rights reserved. +#Copyright (c) Microsoft. All rights reserved. set(theseTestsName thread_notifications_dispatcher_ut) @@ -15,7 +15,7 @@ set(${theseTestsName}_h_files ) build_test_artifacts(${theseTestsName} "tests/c_util" - ADDITIONAL_LIBS c_pal c_pal_reals c_util c_util_reals thread_notifications_lackey_dll + ADDITIONAL_LIBS real_process_watchdog c_pal c_pal c_pal_reals c_util c_util_reals thread_notifications_lackey_dll ENABLE_TEST_FILES_PRECOMPILED_HEADERS "${CMAKE_CURRENT_LIST_DIR}/thread_notifications_dispatcher_ut_pch.h" ) diff --git a/tests/thread_notifications_dispatcher_ut/thread_notifications_dispatcher_ut.c b/tests/thread_notifications_dispatcher_ut/thread_notifications_dispatcher_ut.c index 9e241d30..9d9da061 100644 --- a/tests/thread_notifications_dispatcher_ut/thread_notifications_dispatcher_ut.c +++ b/tests/thread_notifications_dispatcher_ut/thread_notifications_dispatcher_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 "thread_notifications_dispatcher_ut_pch.h" @@ -15,7 +15,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) { ASSERT_ARE_EQUAL(int, 0, real_gballoc_hl_init(NULL, NULL)); @@ -33,7 +33,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/thread_notifications_dispatcher_ut/thread_notifications_dispatcher_ut_pch.h b/tests/thread_notifications_dispatcher_ut/thread_notifications_dispatcher_ut_pch.h index dcbfa412..c26c91fa 100644 --- a/tests/thread_notifications_dispatcher_ut/thread_notifications_dispatcher_ut_pch.h +++ b/tests/thread_notifications_dispatcher_ut/thread_notifications_dispatcher_ut_pch.h @@ -17,6 +17,8 @@ #include "c_pal/thandle.h" +#include "c_pal/timed_test_suite.h" + #include "umock_c/umock_c_ENABLE_MOCKS.h" // ============================== ENABLE_MOCKS #include "c_pal/gballoc_hl.h" diff --git a/tests/thread_notifications_dispatcher_wo_init_ut/CMakeLists.txt b/tests/thread_notifications_dispatcher_wo_init_ut/CMakeLists.txt index 05e5945b..314f4cff 100644 --- a/tests/thread_notifications_dispatcher_wo_init_ut/CMakeLists.txt +++ b/tests/thread_notifications_dispatcher_wo_init_ut/CMakeLists.txt @@ -1,4 +1,4 @@ -#Copyright (c) Microsoft. All rights reserved. +#Copyright (c) Microsoft. All rights reserved. set(theseTestsName thread_notifications_dispatcher_wo_init_ut) @@ -15,7 +15,7 @@ set(${theseTestsName}_h_files ) build_test_artifacts(${theseTestsName} "tests/c_util" - ADDITIONAL_LIBS c_pal c_pal_reals c_util c_util_reals thread_notifications_lackey_dll + ADDITIONAL_LIBS real_process_watchdog c_pal c_pal c_pal_reals c_util c_util_reals thread_notifications_lackey_dll ENABLE_TEST_FILES_PRECOMPILED_HEADERS "${CMAKE_CURRENT_LIST_DIR}/thread_notifications_dispatcher_wo_init_ut_pch.h" ) diff --git a/tests/thread_notifications_dispatcher_wo_init_ut/thread_notifications_dispatcher_wo_init_ut.c b/tests/thread_notifications_dispatcher_wo_init_ut/thread_notifications_dispatcher_wo_init_ut.c index bd6c8443..9e3e0756 100644 --- a/tests/thread_notifications_dispatcher_wo_init_ut/thread_notifications_dispatcher_wo_init_ut.c +++ b/tests/thread_notifications_dispatcher_wo_init_ut/thread_notifications_dispatcher_wo_init_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 "thread_notifications_dispatcher_wo_init_ut_pch.h" @@ -15,7 +15,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) { ASSERT_ARE_EQUAL(int, 0, real_gballoc_hl_init(NULL, NULL)); @@ -33,7 +33,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/thread_notifications_dispatcher_wo_init_ut/thread_notifications_dispatcher_wo_init_ut_pch.h b/tests/thread_notifications_dispatcher_wo_init_ut/thread_notifications_dispatcher_wo_init_ut_pch.h index ef92e167..427f8adf 100644 --- a/tests/thread_notifications_dispatcher_wo_init_ut/thread_notifications_dispatcher_wo_init_ut_pch.h +++ b/tests/thread_notifications_dispatcher_wo_init_ut/thread_notifications_dispatcher_wo_init_ut_pch.h @@ -20,6 +20,8 @@ #include "c_pal/thandle.h" +#include "c_pal/timed_test_suite.h" + #include "umock_c/umock_c_ENABLE_MOCKS.h" // ============================== ENABLE_MOCKS #include "c_pal/gballoc_hl.h" diff --git a/tests/tp_worker_thread_int/CMakeLists.txt b/tests/tp_worker_thread_int/CMakeLists.txt index 22e25133..89f876ba 100644 --- a/tests/tp_worker_thread_int/CMakeLists.txt +++ b/tests/tp_worker_thread_int/CMakeLists.txt @@ -16,4 +16,4 @@ set(${theseTestsName}_cpp_files set(${theseTestsName}_h_files ) -build_test_artifacts(${theseTestsName} "tests/c_util" ADDITIONAL_LIBS c_util c_util_test_helpers) +build_test_artifacts(${theseTestsName} "tests/c_util" ADDITIONAL_LIBS c_pal c_util c_util_test_helpers) diff --git a/tests/tp_worker_thread_int/tp_worker_thread_int.c b/tests/tp_worker_thread_int/tp_worker_thread_int.c index 2b2ecf39..217a0569 100644 --- a/tests/tp_worker_thread_int/tp_worker_thread_int.c +++ b/tests/tp_worker_thread_int/tp_worker_thread_int.c @@ -14,6 +14,7 @@ #include "c_pal/interlocked_hl.h" #include "c_pal/sync.h" #include "c_pal/threadapi.h" +#include "c_pal/timed_test_suite.h" #include "c_util/tp_worker_thread.h" @@ -52,11 +53,11 @@ static void worker_thread_func(void* context) BEGIN_TEST_SUITE(TEST_SUITE_NAME_FROM_CMAKE) -TEST_SUITE_INITIALIZE(suite_init) +TIMED_TEST_SUITE_INITIALIZE(suite_init, TIMED_TEST_DEFAULT_TIMEOUT_MS) { } -TEST_SUITE_CLEANUP(suite_cleanup) +TIMED_TEST_SUITE_CLEANUP(suite_cleanup) { } diff --git a/tests/tp_worker_thread_ut/CMakeLists.txt b/tests/tp_worker_thread_ut/CMakeLists.txt index 2836d982..f5dda873 100644 --- a/tests/tp_worker_thread_ut/CMakeLists.txt +++ b/tests/tp_worker_thread_ut/CMakeLists.txt @@ -1,4 +1,4 @@ -#Copyright (c) Microsoft. All rights reserved. +#Copyright (c) Microsoft. All rights reserved. set(theseTestsName tp_worker_thread_ut) @@ -15,7 +15,7 @@ set(${theseTestsName}_h_files ) build_test_artifacts(${theseTestsName} "tests/c_util" - ADDITIONAL_LIBS c_util_reals c_util_test_helpers c_pal_reals c_pal_umocktypes + ADDITIONAL_LIBS real_process_watchdog c_pal c_util_reals c_util_test_helpers c_pal_reals c_pal_umocktypes ENABLE_TEST_FILES_PRECOMPILED_HEADERS "${CMAKE_CURRENT_LIST_DIR}/tp_worker_thread_ut_pch.h" ) \ No newline at end of file diff --git a/tests/tp_worker_thread_ut/tp_worker_thread_ut.c b/tests/tp_worker_thread_ut/tp_worker_thread_ut.c index 5af6408f..b6141669 100644 --- a/tests/tp_worker_thread_ut/tp_worker_thread_ut.c +++ b/tests/tp_worker_thread_ut/tp_worker_thread_ut.c @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All rights reserved. +// Copyright (c) Microsoft. All rights reserved. #include "tp_worker_thread_ut_pch.h" @@ -178,7 +178,7 @@ static void expect_destroy(void) 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)); @@ -209,7 +209,7 @@ TEST_SUITE_INITIALIZE(suite_init) REGISTER_UMOCK_ALIAS_TYPE(THANDLE(THREADPOOL_WORK_ITEM), void*); } -TEST_SUITE_CLEANUP(suite_cleanup) +TIMED_TEST_SUITE_CLEANUP(suite_cleanup) { umock_c_deinit(); diff --git a/tests/tp_worker_thread_ut/tp_worker_thread_ut_pch.h b/tests/tp_worker_thread_ut/tp_worker_thread_ut_pch.h index 945930b3..26b5f192 100644 --- a/tests/tp_worker_thread_ut/tp_worker_thread_ut_pch.h +++ b/tests/tp_worker_thread_ut/tp_worker_thread_ut_pch.h @@ -19,6 +19,8 @@ #include "umock_c/umocktypes_charptr.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" #include "c_pal/gballoc_hl_redirect.h" diff --git a/tests/two_d_array_int/two_d_array_int.c b/tests/two_d_array_int/two_d_array_int.c index 01da0026..d34c3d7e 100644 --- a/tests/two_d_array_int/two_d_array_int.c +++ b/tests/two_d_array_int/two_d_array_int.c @@ -14,6 +14,7 @@ #include "c_pal/interlocked.h" #include "c_pal/thandle.h" #include "c_pal/threadapi.h" +#include "c_pal/timed_test_suite.h" #include "c_util/two_d_array.h" @@ -41,14 +42,14 @@ TEST_DEFINE_ENUM_TYPE(TWO_D_ARRAY_GET_ROW_RESULT, TWO_D_ARRAY_GET_ROW_RESULT_VAL BEGIN_TEST_SUITE(TEST_SUITE_NAME_FROM_CMAKE) -TEST_SUITE_INITIALIZE(suite_init) +TIMED_TEST_SUITE_INITIALIZE(suite_init, TIMED_TEST_DEFAULT_TIMEOUT_MS) { time_t seed = time(NULL); LogInfo("Test using random seed=%u", (unsigned int)seed); srand((unsigned int)seed); } -TEST_SUITE_CLEANUP(suite_cleanup) +TIMED_TEST_SUITE_CLEANUP(suite_cleanup) { } diff --git a/tests/two_d_array_ut/CMakeLists.txt b/tests/two_d_array_ut/CMakeLists.txt index e3e5b8dc..772d0c95 100644 --- a/tests/two_d_array_ut/CMakeLists.txt +++ b/tests/two_d_array_ut/CMakeLists.txt @@ -1,4 +1,4 @@ -#Copyright (c) Microsoft. All rights reserved. +#Copyright (c) Microsoft. All rights reserved. set(theseTestsName two_d_array_ut) @@ -13,6 +13,6 @@ set(${theseTestsName}_h_files ../../inc/c_util/two_d_array.h ) -build_test_artifacts(${theseTestsName} "tests/c_util" ADDITIONAL_LIBS c_pal c_pal_reals c_util c_util_reals +build_test_artifacts(${theseTestsName} "tests/c_util" ADDITIONAL_LIBS real_process_watchdog c_pal c_pal c_pal_reals c_util c_util_reals ENABLE_TEST_FILES_PRECOMPILED_HEADERS "${CMAKE_CURRENT_LIST_DIR}/two_d_array_ut_pch.h" ) \ No newline at end of file diff --git a/tests/two_d_array_ut/two_d_array_ut.c b/tests/two_d_array_ut/two_d_array_ut.c index 42b83965..74f2e4d4 100644 --- a/tests/two_d_array_ut/two_d_array_ut.c +++ b/tests/two_d_array_ut/two_d_array_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 "two_d_array_ut_pch.h" @@ -52,7 +52,7 @@ static void on_umock_c_error(UMOCK_C_ERROR_CODE error_code) BEGIN_TEST_SUITE(TEST_SUITE_NAME_FROM_CMAKE) -TEST_SUITE_INITIALIZE(it_does_something) +TIMED_TEST_SUITE_INITIALIZE(it_does_something, TIMED_TEST_DEFAULT_TIMEOUT_MS) { ASSERT_ARE_EQUAL(int, 0, real_gballoc_hl_init(NULL, NULL)); @@ -61,7 +61,7 @@ TEST_SUITE_INITIALIZE(it_does_something) REGISTER_GBALLOC_HL_GLOBAL_MOCK_HOOK(); } -TEST_SUITE_CLEANUP(TestClassCleanup) +TIMED_TEST_SUITE_CLEANUP(TestClassCleanup) { umock_c_deinit(); diff --git a/tests/two_d_array_ut/two_d_array_ut_pch.h b/tests/two_d_array_ut/two_d_array_ut_pch.h index a3192996..4e3f865f 100644 --- a/tests/two_d_array_ut/two_d_array_ut_pch.h +++ b/tests/two_d_array_ut/two_d_array_ut_pch.h @@ -18,6 +18,8 @@ #include "umock_c/umock_c.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" diff --git a/tests/uuid_string_ut/CMakeLists.txt b/tests/uuid_string_ut/CMakeLists.txt index c40aed5e..409f8fb4 100644 --- a/tests/uuid_string_ut/CMakeLists.txt +++ b/tests/uuid_string_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 uuid_string_ut) @@ -14,6 +14,6 @@ set(${theseTestsName}_c_files set(${theseTestsName}_h_files ) -build_test_artifacts(${theseTestsName} "tests/c_util" ADDITIONAL_LIBS c_pal c_pal_reals c_pal_umocktypes +build_test_artifacts(${theseTestsName} "tests/c_util" ADDITIONAL_LIBS real_process_watchdog c_pal c_pal c_pal_reals c_pal_umocktypes ENABLE_TEST_FILES_PRECOMPILED_HEADERS "${CMAKE_CURRENT_LIST_DIR}/uuid_string_ut_pch.h" ) diff --git a/tests/uuid_string_ut/uuid_string_ut.c b/tests/uuid_string_ut/uuid_string_ut.c index 85b6bc09..d70cba0f 100644 --- a/tests/uuid_string_ut/uuid_string_ut.c +++ b/tests/uuid_string_ut/uuid_string_ut.c @@ -15,7 +15,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) { ASSERT_ARE_EQUAL(int, 0, real_gballoc_hl_init(NULL, NULL)); @@ -29,7 +29,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/uuid_string_ut/uuid_string_ut_pch.h b/tests/uuid_string_ut/uuid_string_ut_pch.h index 35c56e37..1e527fcc 100644 --- a/tests/uuid_string_ut/uuid_string_ut_pch.h +++ b/tests/uuid_string_ut/uuid_string_ut_pch.h @@ -16,6 +16,8 @@ #include "umock_c/umocktypes_charptr.h" #include "umock_c/umock_c_negative_tests.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" diff --git a/tests/watchdog_int/watchdog_int.c b/tests/watchdog_int/watchdog_int.c index 24df3181..0b17a0f6 100644 --- a/tests/watchdog_int/watchdog_int.c +++ b/tests/watchdog_int/watchdog_int.c @@ -20,6 +20,7 @@ #include "c_pal/interlocked_hl.h" #include "c_util/rc_string.h" #include "c_pal/thandle.h" +#include "c_pal/timed_test_suite.h" #include "c_util/watchdog.h" #include "c_util/watchdog_threadpool.h" @@ -78,12 +79,12 @@ static int test_watchdog_reset_thread(void* context) 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(); } diff --git a/tests/watchdog_threadpool_ut/CMakeLists.txt b/tests/watchdog_threadpool_ut/CMakeLists.txt index ede4654d..7763906b 100644 --- a/tests/watchdog_threadpool_ut/CMakeLists.txt +++ b/tests/watchdog_threadpool_ut/CMakeLists.txt @@ -1,4 +1,4 @@ -#Copyright (c) Microsoft. All rights reserved. +#Copyright (c) Microsoft. All rights reserved. set(theseTestsName watchdog_threadpool_ut) @@ -14,6 +14,6 @@ set(${theseTestsName}_h_files ../../inc/c_util/watchdog_threadpool.h ) -build_test_artifacts(${theseTestsName} "tests/c_util" ADDITIONAL_LIBS c_pal_reals c_util_reals +build_test_artifacts(${theseTestsName} "tests/c_util" ADDITIONAL_LIBS real_process_watchdog c_pal c_pal_reals c_util_reals ENABLE_TEST_FILES_PRECOMPILED_HEADERS "${CMAKE_CURRENT_LIST_DIR}/watchdog_threadpool_ut_pch.h" ) \ No newline at end of file diff --git a/tests/watchdog_threadpool_ut/watchdog_threadpool_ut.c b/tests/watchdog_threadpool_ut/watchdog_threadpool_ut.c index f38d5df5..f832ba2c 100644 --- a/tests/watchdog_threadpool_ut/watchdog_threadpool_ut.c +++ b/tests/watchdog_threadpool_ut/watchdog_threadpool_ut.c @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All rights reserved. +// Copyright (c) Microsoft. All rights reserved. #include "watchdog_threadpool_ut_pch.h" @@ -84,7 +84,7 @@ static void dispose_REAL_THREADPOOL_do_nothing(REAL_THREADPOOL* nothing) 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)); @@ -110,7 +110,7 @@ TEST_SUITE_INITIALIZE(suite_init) REGISTER_GLOBAL_MOCK_HOOK(THANDLE_INITIALIZE(THREADPOOL), THANDLE_INITIALIZE(REAL_THREADPOOL)); } -TEST_SUITE_CLEANUP(suite_cleanup) +TIMED_TEST_SUITE_CLEANUP(suite_cleanup) { THANDLE_ASSIGN(REAL_THREADPOOL)(&g.test_threadpool, NULL); diff --git a/tests/watchdog_threadpool_ut/watchdog_threadpool_ut_pch.h b/tests/watchdog_threadpool_ut/watchdog_threadpool_ut_pch.h index a46ce103..0d903b67 100644 --- a/tests/watchdog_threadpool_ut/watchdog_threadpool_ut_pch.h +++ b/tests/watchdog_threadpool_ut/watchdog_threadpool_ut_pch.h @@ -16,6 +16,8 @@ #include "umock_c/umocktypes_stdint.h" #include "umock_c/umock_c_negative_tests.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" diff --git a/tests/watchdog_ut/CMakeLists.txt b/tests/watchdog_ut/CMakeLists.txt index eec5cb15..223b8683 100644 --- a/tests/watchdog_ut/CMakeLists.txt +++ b/tests/watchdog_ut/CMakeLists.txt @@ -1,4 +1,4 @@ -#Copyright (c) Microsoft. All rights reserved. +#Copyright (c) Microsoft. All rights reserved. set(theseTestsName watchdog_ut) @@ -14,6 +14,6 @@ set(${theseTestsName}_h_files ../../inc/c_util/watchdog.h ) -build_test_artifacts(${theseTestsName} "tests/c_util" ADDITIONAL_LIBS c_pal_reals c_util_reals +build_test_artifacts(${theseTestsName} "tests/c_util" ADDITIONAL_LIBS real_process_watchdog c_pal c_pal_reals c_util_reals ENABLE_TEST_FILES_PRECOMPILED_HEADERS "${CMAKE_CURRENT_LIST_DIR}/watchdog_ut_pch.h" ) \ No newline at end of file diff --git a/tests/watchdog_ut/watchdog_ut.c b/tests/watchdog_ut/watchdog_ut.c index 00e88fbf..1bfc232d 100644 --- a/tests/watchdog_ut/watchdog_ut.c +++ b/tests/watchdog_ut/watchdog_ut.c @@ -66,7 +66,7 @@ static WATCHDOG_HANDLE do_start(THREADPOOL_WORK_FUNCTION* callback, void** conte 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)); @@ -92,7 +92,7 @@ TEST_SUITE_INITIALIZE(suite_init) REGISTER_UMOCK_ALIAS_TYPE(SM_HANDLE, void*); } -TEST_SUITE_CLEANUP(suite_cleanup) +TIMED_TEST_SUITE_CLEANUP(suite_cleanup) { umock_c_deinit(); diff --git a/tests/watchdog_ut/watchdog_ut_pch.h b/tests/watchdog_ut/watchdog_ut_pch.h index ef8a43b6..aebfb953 100644 --- a/tests/watchdog_ut/watchdog_ut_pch.h +++ b/tests/watchdog_ut/watchdog_ut_pch.h @@ -18,6 +18,8 @@ #include "umock_c/umock_c_negative_tests.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" #include "c_pal/gballoc_hl_redirect.h" diff --git a/tests/worker_thread_int/CMakeLists.txt b/tests/worker_thread_int/CMakeLists.txt index 071e2b02..68c9ba16 100644 --- a/tests/worker_thread_int/CMakeLists.txt +++ b/tests/worker_thread_int/CMakeLists.txt @@ -14,7 +14,7 @@ set(${theseTestsName}_h_files ../../inc/c_util/worker_thread.h ) -build_test_artifacts(${theseTestsName} "tests/c_util" ADDITIONAL_LIBS c_util) +build_test_artifacts(${theseTestsName} "tests/c_util" ADDITIONAL_LIBS c_pal c_util) if (WIN32) if("${building}" STREQUAL "exe") diff --git a/tests/worker_thread_int/worker_thread_int.c b/tests/worker_thread_int/worker_thread_int.c index 489535d5..2be2476d 100644 --- a/tests/worker_thread_int/worker_thread_int.c +++ b/tests/worker_thread_int/worker_thread_int.c @@ -11,6 +11,7 @@ #include "c_pal/interlocked_hl.h" #include "c_pal/sync.h" #include "c_pal/threadapi.h" +#include "c_pal/timed_test_suite.h" #include "c_util/worker_thread.h" @@ -33,11 +34,11 @@ static void worker_thread_func(void* context) BEGIN_TEST_SUITE(TEST_SUITE_NAME_FROM_CMAKE) -TEST_SUITE_INITIALIZE(suite_init) +TIMED_TEST_SUITE_INITIALIZE(suite_init, TIMED_TEST_DEFAULT_TIMEOUT_MS) { } -TEST_SUITE_CLEANUP(suite_cleanup) +TIMED_TEST_SUITE_CLEANUP(suite_cleanup) { } diff --git a/tests/worker_thread_ut/CMakeLists.txt b/tests/worker_thread_ut/CMakeLists.txt index e32bca59..31dc9b4a 100644 --- a/tests/worker_thread_ut/CMakeLists.txt +++ b/tests/worker_thread_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 worker_thread_ut) @@ -15,7 +15,7 @@ set(${theseTestsName}_h_files ../../inc/c_util/worker_thread.h ) -build_test_artifacts(${theseTestsName} "tests/c_util" ADDITIONAL_LIBS pal_interfaces c_pal_reals c_pal_reals c_util_reals +build_test_artifacts(${theseTestsName} "tests/c_util" ADDITIONAL_LIBS real_process_watchdog c_pal pal_interfaces c_pal_reals c_pal_reals c_util_reals ENABLE_TEST_FILES_PRECOMPILED_HEADERS "${CMAKE_CURRENT_LIST_DIR}/worker_thread_ut_pch.h" ) diff --git a/tests/worker_thread_ut/worker_thread_ut.c b/tests/worker_thread_ut/worker_thread_ut.c index 0ccd22da..69614074 100644 --- a/tests/worker_thread_ut/worker_thread_ut.c +++ b/tests/worker_thread_ut/worker_thread_ut.c @@ -74,7 +74,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) { ASSERT_ARE_EQUAL(int, 0, real_gballoc_hl_init(NULL, NULL)); @@ -100,7 +100,7 @@ TEST_SUITE_INITIALIZE(suite_init) REGISTER_TYPE(WORKER_THREAD_SCHEDULE_PROCESS_RESULT, WORKER_THREAD_SCHEDULE_PROCESS_RESULT); } -TEST_SUITE_CLEANUP(suite_cleanup) +TIMED_TEST_SUITE_CLEANUP(suite_cleanup) { umock_c_deinit(); diff --git a/tests/worker_thread_ut/worker_thread_ut_pch.h b/tests/worker_thread_ut/worker_thread_ut_pch.h index 634bbecf..b0561f46 100644 --- a/tests/worker_thread_ut/worker_thread_ut_pch.h +++ b/tests/worker_thread_ut/worker_thread_ut_pch.h @@ -18,6 +18,8 @@ #include "umock_c/umock_c_negative_tests.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" #include "c_pal/gballoc_hl_redirect.h" diff --git a/thread_notifications_lackey_dll/tests/thread_notif_lackey_dll_wo_init_ut/CMakeLists.txt b/thread_notifications_lackey_dll/tests/thread_notif_lackey_dll_wo_init_ut/CMakeLists.txt index 7adeb295..8f6cdc83 100644 --- a/thread_notifications_lackey_dll/tests/thread_notif_lackey_dll_wo_init_ut/CMakeLists.txt +++ b/thread_notifications_lackey_dll/tests/thread_notif_lackey_dll_wo_init_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 thread_notif_lackey_dll_wo_init_ut) @@ -16,6 +16,6 @@ set(${theseTestsName}_h_files include_directories(../../inc) -build_test_artifacts(${theseTestsName} "tests/c_util" ADDITIONAL_LIBS c_logging_v2 c_pal c_pal_reals +build_test_artifacts(${theseTestsName} "tests/c_util" ADDITIONAL_LIBS real_process_watchdog c_pal c_logging_v2 c_pal c_pal_reals ENABLE_TEST_FILES_PRECOMPILED_HEADERS "${CMAKE_CURRENT_LIST_DIR}/thread_notif_lackey_dll_wo_init_ut_pch.h" ) \ No newline at end of file diff --git a/thread_notifications_lackey_dll/tests/thread_notif_lackey_dll_wo_init_ut/thread_notif_lackey_dll_wo_init_ut.c b/thread_notifications_lackey_dll/tests/thread_notif_lackey_dll_wo_init_ut/thread_notif_lackey_dll_wo_init_ut.c index 0780c47a..891cdc77 100644 --- a/thread_notifications_lackey_dll/tests/thread_notif_lackey_dll_wo_init_ut/thread_notif_lackey_dll_wo_init_ut.c +++ b/thread_notifications_lackey_dll/tests/thread_notif_lackey_dll_wo_init_ut/thread_notif_lackey_dll_wo_init_ut.c @@ -22,7 +22,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) { ASSERT_ARE_EQUAL(int, 0, umock_c_init(on_umock_c_error), "umock_c_init failed"); ASSERT_ARE_EQUAL(int, 0, umocktypes_windows_register_types(), "umocktypes_windows_register_types failed"); @@ -32,7 +32,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/thread_notifications_lackey_dll/tests/thread_notif_lackey_dll_wo_init_ut/thread_notif_lackey_dll_wo_init_ut_pch.h b/thread_notifications_lackey_dll/tests/thread_notif_lackey_dll_wo_init_ut/thread_notif_lackey_dll_wo_init_ut_pch.h index 1f9cc28a..06506f6b 100644 --- a/thread_notifications_lackey_dll/tests/thread_notif_lackey_dll_wo_init_ut/thread_notif_lackey_dll_wo_init_ut_pch.h +++ b/thread_notifications_lackey_dll/tests/thread_notif_lackey_dll_wo_init_ut/thread_notif_lackey_dll_wo_init_ut_pch.h @@ -23,6 +23,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/ps_util.h" diff --git a/thread_notifications_lackey_dll/tests/thread_notifications_lackey_dll_int/CMakeLists.txt b/thread_notifications_lackey_dll/tests/thread_notifications_lackey_dll_int/CMakeLists.txt index a98453dc..2194f4af 100644 --- a/thread_notifications_lackey_dll/tests/thread_notifications_lackey_dll_int/CMakeLists.txt +++ b/thread_notifications_lackey_dll/tests/thread_notifications_lackey_dll_int/CMakeLists.txt @@ -12,7 +12,7 @@ set(${theseTestsName}_c_files set(${theseTestsName}_h_files ) -build_test_artifacts(${theseTestsName} "tests/thread_notifications_lackey_dll" ADDITIONAL_LIBS thread_notifications_lackey_dll) +build_test_artifacts(${theseTestsName} "tests/thread_notifications_lackey_dll" ADDITIONAL_LIBS c_pal thread_notifications_lackey_dll) if("${building}" STREQUAL "exe") copy_thread_notifications_lackey_outputs(${theseTestsName}_exe_${CMAKE_PROJECT_NAME} $) diff --git a/thread_notifications_lackey_dll/tests/thread_notifications_lackey_dll_int/thread_notifications_lackey_dll_int.c b/thread_notifications_lackey_dll/tests/thread_notifications_lackey_dll_int/thread_notifications_lackey_dll_int.c index 4cf057f9..ef5438be 100644 --- a/thread_notifications_lackey_dll/tests/thread_notifications_lackey_dll_int/thread_notifications_lackey_dll_int.c +++ b/thread_notifications_lackey_dll/tests/thread_notifications_lackey_dll_int/thread_notifications_lackey_dll_int.c @@ -11,6 +11,7 @@ #include "c_pal/interlocked.h" #include "c_pal/threadapi.h" +#include "c_pal/timed_test_suite.h" #include "thread_notifications_lackey_dll/thread_notifications_lackey_dll.h" @@ -24,11 +25,11 @@ MU_DEFINE_ENUM_STRINGS(THREAD_NOTIFICATIONS_LACKEY_DLL_REASON, THREAD_NOTIFICATI BEGIN_TEST_SUITE(TEST_SUITE_NAME_FROM_CMAKE) -TEST_SUITE_INITIALIZE(suite_init) +TIMED_TEST_SUITE_INITIALIZE(suite_init, TIMED_TEST_DEFAULT_TIMEOUT_MS) { } -TEST_SUITE_CLEANUP(suite_cleanup) +TIMED_TEST_SUITE_CLEANUP(suite_cleanup) { } diff --git a/thread_notifications_lackey_dll/tests/thread_notifications_lackey_dll_ut/CMakeLists.txt b/thread_notifications_lackey_dll/tests/thread_notifications_lackey_dll_ut/CMakeLists.txt index a2510283..f53ca06f 100644 --- a/thread_notifications_lackey_dll/tests/thread_notifications_lackey_dll_ut/CMakeLists.txt +++ b/thread_notifications_lackey_dll/tests/thread_notifications_lackey_dll_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 thread_notifications_lackey_dll_ut) @@ -16,6 +16,6 @@ set(${theseTestsName}_h_files include_directories(../../inc) -build_test_artifacts(${theseTestsName} "tests/c_util" ADDITIONAL_LIBS c_logging_v2 c_pal c_pal_reals +build_test_artifacts(${theseTestsName} "tests/c_util" ADDITIONAL_LIBS real_process_watchdog c_pal c_logging_v2 c_pal c_pal_reals ENABLE_TEST_FILES_PRECOMPILED_HEADERS "${CMAKE_CURRENT_LIST_DIR}/thread_notifications_lackey_dll_ut_pch.h" ) \ No newline at end of file diff --git a/thread_notifications_lackey_dll/tests/thread_notifications_lackey_dll_ut/thread_notifications_lackey_dll_ut.c b/thread_notifications_lackey_dll/tests/thread_notifications_lackey_dll_ut/thread_notifications_lackey_dll_ut.c index 4b4e6eb8..94958b43 100644 --- a/thread_notifications_lackey_dll/tests/thread_notifications_lackey_dll_ut/thread_notifications_lackey_dll_ut.c +++ b/thread_notifications_lackey_dll/tests/thread_notifications_lackey_dll_ut/thread_notifications_lackey_dll_ut.c @@ -31,7 +31,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) { ASSERT_ARE_EQUAL(int, 0, umock_c_init(on_umock_c_error), "umock_c_init failed"); ASSERT_ARE_EQUAL(int, 0, umocktypes_windows_register_types(), "umocktypes_windows_register_types failed"); @@ -42,7 +42,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/thread_notifications_lackey_dll/tests/thread_notifications_lackey_dll_ut/thread_notifications_lackey_dll_ut_pch.h b/thread_notifications_lackey_dll/tests/thread_notifications_lackey_dll_ut/thread_notifications_lackey_dll_ut_pch.h index 07368213..19cb07bf 100644 --- a/thread_notifications_lackey_dll/tests/thread_notifications_lackey_dll_ut/thread_notifications_lackey_dll_ut_pch.h +++ b/thread_notifications_lackey_dll/tests/thread_notifications_lackey_dll_ut/thread_notifications_lackey_dll_ut_pch.h @@ -23,6 +23,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/ps_util.h"