Skip to content

Commit 0a8e67c

Browse files
parth21999Copilot
andcommitted
Add real_ps_util_renames to real_process_watchdog to avoid c_pal link dependency
real_process_watchdog calls ps_util_terminate_process via LogCriticalAndTerminate. By adding real_ps_util_renames.h, this becomes real_ps_util_terminate_process which is provided by c_pal_reals (already linked in UTs). This eliminates the need for downstream repos to link c_pal in unit tests solely for watchdog support. Also fixes include order in int tests (timed_test_suite.h before umock_c.h) so renames are not triggered and int tests use process_watchdog directly from c_pal without needing any reals libraries. Fixes gballoc_ll_passthrough_ut PCH include order (umock_c.h must come before timed_test_suite.h for proper rename activation in UTs). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 3f80be4 commit 0a8e67c

9 files changed

Lines changed: 14 additions & 7 deletions

File tree

common/tests/threadpool_int/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ set(${theseTestsName}_c_files
1212
set(${theseTestsName}_h_files
1313
)
1414

15-
build_test_artifacts(${theseTestsName} "tests/c_pal" ADDITIONAL_LIBS real_process_watchdog c_pal_ll_reals pal_interfaces c_pal)
15+
build_test_artifacts(${theseTestsName} "tests/c_pal" ADDITIONAL_LIBS c_pal_ll_reals pal_interfaces c_pal)

common/tests/threadpool_int/threadpool_int.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313

1414
#include "testrunnerswitcher.h"
1515

16+
#include "c_pal/timed_test_suite.h"
17+
1618
#include "umock_c/umock_c.h" // IWYU pragma: keep
1719

1820
#include "c_pal/timer.h"

interfaces/tests/srw_lock_int/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ set(${theseTestsName}_c_files
1212
set(${theseTestsName}_h_files
1313
)
1414

15-
build_test_artifacts(${theseTestsName} "tests/c_pal/int" ADDITIONAL_LIBS real_process_watchdog c_pal_ll_reals c_pal)
15+
build_test_artifacts(${theseTestsName} "tests/c_pal/int" ADDITIONAL_LIBS c_pal_ll_reals c_pal)
1616

interfaces/tests/srw_lock_int/srw_lock_int.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66

77
#include "testrunnerswitcher.h"
88

9-
#include "umock_c/umock_c.h" // IWYU pragma: keep
10-
119
#include "c_pal/srw_lock.h"
1210
#include "c_pal/timed_test_suite.h"
1311

12+
#include "umock_c/umock_c.h" // IWYU pragma: keep
13+
1414
static const char* TEST_LOCK_NAME = "test_lock";
1515

1616
BEGIN_TEST_SUITE(TEST_SUITE_NAME_FROM_CMAKE)

interfaces/tests/srw_lock_ll_int/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ set(${theseTestsName}_c_files
1212
set(${theseTestsName}_h_files
1313
)
1414

15-
build_test_artifacts(${theseTestsName} "tests/c_pal/int" ADDITIONAL_LIBS real_process_watchdog c_pal_ll_reals c_pal)
15+
build_test_artifacts(${theseTestsName} "tests/c_pal/int" ADDITIONAL_LIBS c_pal_ll_reals c_pal)
1616

interfaces/tests/srw_lock_ll_int/srw_lock_ll_int.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55

66
#include "testrunnerswitcher.h"
77

8-
#include "umock_c/umock_c.h" // IWYU pragma: keep
9-
108
#include "c_pal/srw_lock_ll.h"
119
#include "c_pal/timed_test_suite.h"
1210

11+
#include "umock_c/umock_c.h" // IWYU pragma: keep
12+
1313
BEGIN_TEST_SUITE(TEST_SUITE_NAME_FROM_CMAKE)
1414

1515
TIMED_TEST_SUITE_INITIALIZE(suite_init, TIMED_TEST_DEFAULT_TIMEOUT_MS)

linux/linux_reals/real_process_watchdog.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
33

44
#include "real_interlocked_renames.h" // IWYU pragma: keep
5+
#include "real_ps_util_renames.h" // IWYU pragma: keep
56

67
#include "real_process_watchdog_renames.h" // IWYU pragma: keep
78

win32/reals/real_process_watchdog.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
33

44
#include "real_interlocked_renames.h" // IWYU pragma: keep
5+
#include "real_ps_util_renames.h" // IWYU pragma: keep
56

67
#include "real_process_watchdog_renames.h" // IWYU pragma: keep
78

win32/tests/gballoc_ll_passthrough_ut/gballoc_ll_passthrough_ut_pch.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010

1111
#include "macro_utils/macro_utils.h"
1212
#include "testrunnerswitcher.h"
13+
14+
#include "umock_c/umock_c.h"
15+
1316
#include "c_pal/timed_test_suite.h"
1417

1518
#endif // GBALLOC_LL_PASSTHROUGH_UT_PCH_H

0 commit comments

Comments
 (0)