From 623941f5642c4ffc493837787e561eab4c03e060 Mon Sep 17 00:00:00 2001 From: Parth Aggarwal Date: Wed, 22 Apr 2026 21:19:31 -0700 Subject: [PATCH 1/2] 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 gballoc_ll_passthrough_ut PCH include order (umock_c.h must come before timed_test_suite.h for proper rename activation). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- common/tests/threadpool_int/CMakeLists.txt | 2 +- interfaces/tests/srw_lock_int/CMakeLists.txt | 2 +- interfaces/tests/srw_lock_ll_int/CMakeLists.txt | 2 +- linux/linux_reals/real_process_watchdog.c | 1 + win32/reals/real_process_watchdog.c | 1 + .../gballoc_ll_passthrough_ut/gballoc_ll_passthrough_ut_pch.h | 3 +++ 6 files changed, 8 insertions(+), 3 deletions(-) diff --git a/common/tests/threadpool_int/CMakeLists.txt b/common/tests/threadpool_int/CMakeLists.txt index a8faa6d3..fcd9f8cc 100644 --- a/common/tests/threadpool_int/CMakeLists.txt +++ b/common/tests/threadpool_int/CMakeLists.txt @@ -12,4 +12,4 @@ set(${theseTestsName}_c_files set(${theseTestsName}_h_files ) -build_test_artifacts(${theseTestsName} "tests/c_pal" ADDITIONAL_LIBS real_process_watchdog c_pal_ll_reals pal_interfaces c_pal) +build_test_artifacts(${theseTestsName} "tests/c_pal" ADDITIONAL_LIBS real_process_watchdog c_pal_reals pal_interfaces c_pal) diff --git a/interfaces/tests/srw_lock_int/CMakeLists.txt b/interfaces/tests/srw_lock_int/CMakeLists.txt index 90495208..303d7afe 100644 --- a/interfaces/tests/srw_lock_int/CMakeLists.txt +++ b/interfaces/tests/srw_lock_int/CMakeLists.txt @@ -12,5 +12,5 @@ set(${theseTestsName}_c_files set(${theseTestsName}_h_files ) -build_test_artifacts(${theseTestsName} "tests/c_pal/int" ADDITIONAL_LIBS real_process_watchdog c_pal_ll_reals c_pal) +build_test_artifacts(${theseTestsName} "tests/c_pal/int" ADDITIONAL_LIBS real_process_watchdog c_pal_reals c_pal) diff --git a/interfaces/tests/srw_lock_ll_int/CMakeLists.txt b/interfaces/tests/srw_lock_ll_int/CMakeLists.txt index 372e890c..25b51c52 100644 --- a/interfaces/tests/srw_lock_ll_int/CMakeLists.txt +++ b/interfaces/tests/srw_lock_ll_int/CMakeLists.txt @@ -12,5 +12,5 @@ set(${theseTestsName}_c_files set(${theseTestsName}_h_files ) -build_test_artifacts(${theseTestsName} "tests/c_pal/int" ADDITIONAL_LIBS real_process_watchdog c_pal_ll_reals c_pal) +build_test_artifacts(${theseTestsName} "tests/c_pal/int" ADDITIONAL_LIBS real_process_watchdog c_pal_reals c_pal) diff --git a/linux/linux_reals/real_process_watchdog.c b/linux/linux_reals/real_process_watchdog.c index 4c0f37e6..8e86954d 100644 --- a/linux/linux_reals/real_process_watchdog.c +++ b/linux/linux_reals/real_process_watchdog.c @@ -2,6 +2,7 @@ // Licensed under the MIT license. See LICENSE file in the project root for full license information. #include "real_interlocked_renames.h" // IWYU pragma: keep +#include "real_ps_util_renames.h" // IWYU pragma: keep #include "real_process_watchdog_renames.h" // IWYU pragma: keep diff --git a/win32/reals/real_process_watchdog.c b/win32/reals/real_process_watchdog.c index 000343c5..4d2035a3 100644 --- a/win32/reals/real_process_watchdog.c +++ b/win32/reals/real_process_watchdog.c @@ -2,6 +2,7 @@ // Licensed under the MIT license. See LICENSE file in the project root for full license information. #include "real_interlocked_renames.h" // IWYU pragma: keep +#include "real_ps_util_renames.h" // IWYU pragma: keep #include "real_process_watchdog_renames.h" // IWYU pragma: keep diff --git a/win32/tests/gballoc_ll_passthrough_ut/gballoc_ll_passthrough_ut_pch.h b/win32/tests/gballoc_ll_passthrough_ut/gballoc_ll_passthrough_ut_pch.h index 371df0b0..8a8b9f91 100644 --- a/win32/tests/gballoc_ll_passthrough_ut/gballoc_ll_passthrough_ut_pch.h +++ b/win32/tests/gballoc_ll_passthrough_ut/gballoc_ll_passthrough_ut_pch.h @@ -10,6 +10,9 @@ #include "macro_utils/macro_utils.h" #include "testrunnerswitcher.h" + +#include "umock_c/umock_c.h" + #include "c_pal/timed_test_suite.h" #endif // GBALLOC_LL_PASSTHROUGH_UT_PCH_H From d7a7edd3601e3084759ea7ba0a0c8bb06506ae52 Mon Sep 17 00:00:00 2001 From: Parth Aggarwal Date: Fri, 5 Jun 2026 19:31:11 -0700 Subject: [PATCH 2/2] Address review: remove unnecessary umock from int tests, fix int test link libs - Remove umock_c.h from srw_lock_int and srw_lock_ll_int (not used) - Remove real_process_watchdog and c_pal_reals from srw_lock_int/ll CMakeLists - Restore threadpool_int CMakeLists to original libs (c_pal_reals pre-existing) - Move timed_test_suite.h before umock_c.h in threadpool_int to avoid renames Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- common/tests/threadpool_int/CMakeLists.txt | 2 +- common/tests/threadpool_int/threadpool_int.c | 2 ++ interfaces/tests/srw_lock_int/CMakeLists.txt | 2 +- interfaces/tests/srw_lock_int/srw_lock_int.c | 2 -- interfaces/tests/srw_lock_ll_int/CMakeLists.txt | 2 +- interfaces/tests/srw_lock_ll_int/srw_lock_ll_int.c | 2 -- 6 files changed, 5 insertions(+), 7 deletions(-) diff --git a/common/tests/threadpool_int/CMakeLists.txt b/common/tests/threadpool_int/CMakeLists.txt index fcd9f8cc..75b24883 100644 --- a/common/tests/threadpool_int/CMakeLists.txt +++ b/common/tests/threadpool_int/CMakeLists.txt @@ -12,4 +12,4 @@ set(${theseTestsName}_c_files set(${theseTestsName}_h_files ) -build_test_artifacts(${theseTestsName} "tests/c_pal" ADDITIONAL_LIBS real_process_watchdog c_pal_reals pal_interfaces c_pal) +build_test_artifacts(${theseTestsName} "tests/c_pal" ADDITIONAL_LIBS pal_interfaces c_pal c_pal_reals) diff --git a/common/tests/threadpool_int/threadpool_int.c b/common/tests/threadpool_int/threadpool_int.c index 49465633..8e3d2b91 100644 --- a/common/tests/threadpool_int/threadpool_int.c +++ b/common/tests/threadpool_int/threadpool_int.c @@ -13,6 +13,8 @@ #include "testrunnerswitcher.h" +#include "c_pal/timed_test_suite.h" + #include "umock_c/umock_c.h" // IWYU pragma: keep #include "c_pal/timer.h" diff --git a/interfaces/tests/srw_lock_int/CMakeLists.txt b/interfaces/tests/srw_lock_int/CMakeLists.txt index 303d7afe..cd5e10f3 100644 --- a/interfaces/tests/srw_lock_int/CMakeLists.txt +++ b/interfaces/tests/srw_lock_int/CMakeLists.txt @@ -12,5 +12,5 @@ set(${theseTestsName}_c_files set(${theseTestsName}_h_files ) -build_test_artifacts(${theseTestsName} "tests/c_pal/int" ADDITIONAL_LIBS real_process_watchdog c_pal_reals c_pal) +build_test_artifacts(${theseTestsName} "tests/c_pal/int" ADDITIONAL_LIBS c_pal) diff --git a/interfaces/tests/srw_lock_int/srw_lock_int.c b/interfaces/tests/srw_lock_int/srw_lock_int.c index 67b347f8..bcd702cd 100644 --- a/interfaces/tests/srw_lock_int/srw_lock_int.c +++ b/interfaces/tests/srw_lock_int/srw_lock_int.c @@ -6,8 +6,6 @@ #include "testrunnerswitcher.h" -#include "umock_c/umock_c.h" // IWYU pragma: keep - #include "c_pal/srw_lock.h" #include "c_pal/timed_test_suite.h" diff --git a/interfaces/tests/srw_lock_ll_int/CMakeLists.txt b/interfaces/tests/srw_lock_ll_int/CMakeLists.txt index 25b51c52..7a657778 100644 --- a/interfaces/tests/srw_lock_ll_int/CMakeLists.txt +++ b/interfaces/tests/srw_lock_ll_int/CMakeLists.txt @@ -12,5 +12,5 @@ set(${theseTestsName}_c_files set(${theseTestsName}_h_files ) -build_test_artifacts(${theseTestsName} "tests/c_pal/int" ADDITIONAL_LIBS real_process_watchdog c_pal_reals c_pal) +build_test_artifacts(${theseTestsName} "tests/c_pal/int" ADDITIONAL_LIBS c_pal) diff --git a/interfaces/tests/srw_lock_ll_int/srw_lock_ll_int.c b/interfaces/tests/srw_lock_ll_int/srw_lock_ll_int.c index 1abdc5ac..ed3e68de 100644 --- a/interfaces/tests/srw_lock_ll_int/srw_lock_ll_int.c +++ b/interfaces/tests/srw_lock_ll_int/srw_lock_ll_int.c @@ -5,8 +5,6 @@ #include "testrunnerswitcher.h" -#include "umock_c/umock_c.h" // IWYU pragma: keep - #include "c_pal/srw_lock_ll.h" #include "c_pal/timed_test_suite.h"