From 56d7bb9941ba54e176f7ee2d524409d92b7e82fb Mon Sep 17 00:00:00 2001 From: Lingkai Dong Date: Wed, 7 Jul 2021 15:46:25 +0100 Subject: [PATCH 01/17] Unit tests: Remove unused arm_math.h --- UNITTESTS/target_h/arm_math.h | 16 ---------------- 1 file changed, 16 deletions(-) delete mode 100644 UNITTESTS/target_h/arm_math.h diff --git a/UNITTESTS/target_h/arm_math.h b/UNITTESTS/target_h/arm_math.h deleted file mode 100644 index a431b392e72..00000000000 --- a/UNITTESTS/target_h/arm_math.h +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright (c) , Arm Limited and affiliates. - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ From 34656e8a923602e559e4dc913d8b65b96b6c0ee0 Mon Sep 17 00:00:00 2001 From: Lingkai Dong Date: Wed, 7 Jul 2021 16:55:53 +0100 Subject: [PATCH 02/17] Unit tests: Remove unused nsapi_ppp.h stub --- UNITTESTS/target_h/nsapi_ppp.h | 16 ---------------- 1 file changed, 16 deletions(-) delete mode 100644 UNITTESTS/target_h/nsapi_ppp.h diff --git a/UNITTESTS/target_h/nsapi_ppp.h b/UNITTESTS/target_h/nsapi_ppp.h deleted file mode 100644 index a431b392e72..00000000000 --- a/UNITTESTS/target_h/nsapi_ppp.h +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright (c) , Arm Limited and affiliates. - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ From dcc240d578666c50e228eeed003139897f9d3ec5 Mon Sep 17 00:00:00 2001 From: Lingkai Dong Date: Thu, 15 Jul 2021 10:24:24 +0100 Subject: [PATCH 03/17] Unit tests: Remove unused syslimits.h --- UNITTESTS/target_h/sys/syslimits.h | 17 ----------------- 1 file changed, 17 deletions(-) delete mode 100644 UNITTESTS/target_h/sys/syslimits.h diff --git a/UNITTESTS/target_h/sys/syslimits.h b/UNITTESTS/target_h/sys/syslimits.h deleted file mode 100644 index 5c90b373f14..00000000000 --- a/UNITTESTS/target_h/sys/syslimits.h +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) , Arm Limited and affiliates. - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#define NAME_MAX 255 From 57dd6812c37b0ffa81ca49af76f5ebc9ea0ec0df Mon Sep 17 00:00:00 2001 From: Lingkai Dong Date: Wed, 7 Jul 2021 15:22:21 +0100 Subject: [PATCH 04/17] Unit tests: Move cellular target_h stubs We move test-specific files from the top-level UNITTESTS directory into individual components' UNITTESTS/doubles subdirectories. --- .../cellular/tests/UNITTESTS/doubles}/myCellularContext.h | 0 .../cellular/tests/UNITTESTS/doubles}/myCellularDevice.h | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename {UNITTESTS/target_h => connectivity/cellular/tests/UNITTESTS/doubles}/myCellularContext.h (100%) rename {UNITTESTS/target_h => connectivity/cellular/tests/UNITTESTS/doubles}/myCellularDevice.h (100%) diff --git a/UNITTESTS/target_h/myCellularContext.h b/connectivity/cellular/tests/UNITTESTS/doubles/myCellularContext.h similarity index 100% rename from UNITTESTS/target_h/myCellularContext.h rename to connectivity/cellular/tests/UNITTESTS/doubles/myCellularContext.h diff --git a/UNITTESTS/target_h/myCellularDevice.h b/connectivity/cellular/tests/UNITTESTS/doubles/myCellularDevice.h similarity index 100% rename from UNITTESTS/target_h/myCellularDevice.h rename to connectivity/cellular/tests/UNITTESTS/doubles/myCellularDevice.h From 44cd64a3e42297cacb4a7f88bfc27f0cbd1b418e Mon Sep 17 00:00:00 2001 From: Lingkai Dong Date: Mon, 19 Jul 2021 10:03:10 +0100 Subject: [PATCH 05/17] Unit tests: Fix style in cellular myCellularContext.h stub --- .../cellular/tests/UNITTESTS/doubles/myCellularContext.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/connectivity/cellular/tests/UNITTESTS/doubles/myCellularContext.h b/connectivity/cellular/tests/UNITTESTS/doubles/myCellularContext.h index c7871c4eb90..e463ce22045 100644 --- a/connectivity/cellular/tests/UNITTESTS/doubles/myCellularContext.h +++ b/connectivity/cellular/tests/UNITTESTS/doubles/myCellularContext.h @@ -137,7 +137,8 @@ class myCellularContext : public CellularContext { return true; }; - const char* get_nonip_context_type_str() { + const char *get_nonip_context_type_str() + { return "Non-IP"; } From 7e3565b5f53ea34d768de666b664676731b8e9cb Mon Sep 17 00:00:00 2001 From: Lingkai Dong Date: Wed, 7 Jul 2021 16:49:54 +0100 Subject: [PATCH 06/17] Unit tests: Move cmsis target_h stubs This creates a new mbed-headers-cmsis which is always and only used by mbed-headers-platform, so we add the former to the laters' linked targets. --- cmsis/CMakeLists.txt | 3 +++ cmsis/tests/UNITTESTS/.mbedignore | 1 + cmsis/tests/UNITTESTS/doubles/CMakeLists.txt | 9 +++++++++ .../target_h => cmsis/tests/UNITTESTS/doubles}/cmsis.h | 0 .../tests/UNITTESTS/doubles}/cmsis_compiler.h | 0 .../tests/UNITTESTS/doubles}/cmsis_os.h | 0 .../tests/UNITTESTS/doubles}/cmsis_os2.h | 0 .../tests/UNITTESTS/doubles}/mbed_rtx.h | 0 .../tests/UNITTESTS/doubles}/mbed_rtx_conf.h | 0 .../target_h => cmsis/tests/UNITTESTS/doubles}/rtx_lib.h | 0 .../target_h => cmsis/tests/UNITTESTS/doubles}/rtx_os.h | 0 platform/tests/UNITTESTS/doubles/CMakeLists.txt | 4 ++++ 12 files changed, 17 insertions(+) create mode 100644 cmsis/tests/UNITTESTS/.mbedignore create mode 100644 cmsis/tests/UNITTESTS/doubles/CMakeLists.txt rename {UNITTESTS/target_h => cmsis/tests/UNITTESTS/doubles}/cmsis.h (100%) rename {UNITTESTS/target_h => cmsis/tests/UNITTESTS/doubles}/cmsis_compiler.h (100%) rename {UNITTESTS/target_h => cmsis/tests/UNITTESTS/doubles}/cmsis_os.h (100%) rename {UNITTESTS/target_h => cmsis/tests/UNITTESTS/doubles}/cmsis_os2.h (100%) rename {UNITTESTS/target_h => cmsis/tests/UNITTESTS/doubles}/mbed_rtx.h (100%) rename {UNITTESTS/target_h => cmsis/tests/UNITTESTS/doubles}/mbed_rtx_conf.h (100%) rename {UNITTESTS/target_h => cmsis/tests/UNITTESTS/doubles}/rtx_lib.h (100%) rename {UNITTESTS/target_h => cmsis/tests/UNITTESTS/doubles}/rtx_os.h (100%) diff --git a/cmsis/CMakeLists.txt b/cmsis/CMakeLists.txt index b2442a67a1b..ecfe69c76a6 100644 --- a/cmsis/CMakeLists.txt +++ b/cmsis/CMakeLists.txt @@ -4,3 +4,6 @@ add_subdirectory(CMSIS_5) add_subdirectory(device) +if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME AND BUILD_TESTING) + add_subdirectory(tests/UNITTESTS/doubles) +endif() diff --git a/cmsis/tests/UNITTESTS/.mbedignore b/cmsis/tests/UNITTESTS/.mbedignore new file mode 100644 index 00000000000..72e8ffc0db8 --- /dev/null +++ b/cmsis/tests/UNITTESTS/.mbedignore @@ -0,0 +1 @@ +* diff --git a/cmsis/tests/UNITTESTS/doubles/CMakeLists.txt b/cmsis/tests/UNITTESTS/doubles/CMakeLists.txt new file mode 100644 index 00000000000..f220a6fdc17 --- /dev/null +++ b/cmsis/tests/UNITTESTS/doubles/CMakeLists.txt @@ -0,0 +1,9 @@ +# Copyright (c) 2021 Arm Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +add_library(mbed-headers-cmsis INTERFACE) + +target_include_directories(mbed-headers-cmsis + INTERFACE + . +) diff --git a/UNITTESTS/target_h/cmsis.h b/cmsis/tests/UNITTESTS/doubles/cmsis.h similarity index 100% rename from UNITTESTS/target_h/cmsis.h rename to cmsis/tests/UNITTESTS/doubles/cmsis.h diff --git a/UNITTESTS/target_h/cmsis_compiler.h b/cmsis/tests/UNITTESTS/doubles/cmsis_compiler.h similarity index 100% rename from UNITTESTS/target_h/cmsis_compiler.h rename to cmsis/tests/UNITTESTS/doubles/cmsis_compiler.h diff --git a/UNITTESTS/target_h/cmsis_os.h b/cmsis/tests/UNITTESTS/doubles/cmsis_os.h similarity index 100% rename from UNITTESTS/target_h/cmsis_os.h rename to cmsis/tests/UNITTESTS/doubles/cmsis_os.h diff --git a/UNITTESTS/target_h/cmsis_os2.h b/cmsis/tests/UNITTESTS/doubles/cmsis_os2.h similarity index 100% rename from UNITTESTS/target_h/cmsis_os2.h rename to cmsis/tests/UNITTESTS/doubles/cmsis_os2.h diff --git a/UNITTESTS/target_h/mbed_rtx.h b/cmsis/tests/UNITTESTS/doubles/mbed_rtx.h similarity index 100% rename from UNITTESTS/target_h/mbed_rtx.h rename to cmsis/tests/UNITTESTS/doubles/mbed_rtx.h diff --git a/UNITTESTS/target_h/mbed_rtx_conf.h b/cmsis/tests/UNITTESTS/doubles/mbed_rtx_conf.h similarity index 100% rename from UNITTESTS/target_h/mbed_rtx_conf.h rename to cmsis/tests/UNITTESTS/doubles/mbed_rtx_conf.h diff --git a/UNITTESTS/target_h/rtx_lib.h b/cmsis/tests/UNITTESTS/doubles/rtx_lib.h similarity index 100% rename from UNITTESTS/target_h/rtx_lib.h rename to cmsis/tests/UNITTESTS/doubles/rtx_lib.h diff --git a/UNITTESTS/target_h/rtx_os.h b/cmsis/tests/UNITTESTS/doubles/rtx_os.h similarity index 100% rename from UNITTESTS/target_h/rtx_os.h rename to cmsis/tests/UNITTESTS/doubles/rtx_os.h diff --git a/platform/tests/UNITTESTS/doubles/CMakeLists.txt b/platform/tests/UNITTESTS/doubles/CMakeLists.txt index 31710967ba3..cb8bd7fb1bf 100644 --- a/platform/tests/UNITTESTS/doubles/CMakeLists.txt +++ b/platform/tests/UNITTESTS/doubles/CMakeLists.txt @@ -10,6 +10,10 @@ target_include_directories(mbed-headers-platform ${mbed-os_SOURCE_DIR}/platform/randlib/include/ ${mbed-os_SOURCE_DIR}/platform/mbed-trace/include ) +target_link_libraries(mbed-headers-platform + INTERFACE + mbed-headers-cmsis +) add_library(mbed-stubs-platform) target_sources(mbed-stubs-platform From 4011e2ef85106affad3f325009d8c905003c2deb Mon Sep 17 00:00:00 2001 From: Lingkai Dong Date: Thu, 8 Jul 2021 10:24:24 +0100 Subject: [PATCH 07/17] Unit tests: Move platform target_h stubs Stubs previously in UNITTESTS/target_h/ have the same names as regular Mbed OS headers, intending to override the latter directly. We move platform target_h stubs into platform/tests/UNITTESTS/doubles/platform/. Note: nvic_wrapper.h is normally implemented and used by Mbed targets as needed. But as unit tests do not have a real target, we treat it as a stub for the platform. --- platform/tests/UNITTESTS/doubles/CMakeLists.txt | 3 +++ .../tests/UNITTESTS/doubles}/platform/CThunk.h | 0 .../UNITTESTS/doubles}/platform/cxxsupport/mstd_algorithm | 0 .../tests/UNITTESTS/doubles}/platform/cxxsupport/mstd_atomic | 0 .../tests/UNITTESTS/doubles}/platform/cxxsupport/mstd_cstddef | 0 .../UNITTESTS/doubles}/platform/cxxsupport/mstd_functional | 0 .../tests/UNITTESTS/doubles}/platform/cxxsupport/mstd_iterator | 0 .../tests/UNITTESTS/doubles}/platform/cxxsupport/mstd_memory | 0 .../tests/UNITTESTS/doubles}/platform/cxxsupport/mstd_mutex | 0 .../tests/UNITTESTS/doubles}/platform/cxxsupport/mstd_new | 0 .../tests/UNITTESTS/doubles}/platform/cxxsupport/mstd_tuple | 0 .../UNITTESTS/doubles}/platform/cxxsupport/mstd_type_traits | 0 .../tests/UNITTESTS/doubles}/platform/cxxsupport/mstd_utility | 0 .../tests/UNITTESTS/doubles}/platform/mbed_assert.h | 0 .../tests/UNITTESTS/doubles}/platform/mbed_power_mgmt.h | 0 .../tests/UNITTESTS/doubles}/platform/mbed_retarget.h | 0 .../tests/UNITTESTS/doubles}/platform/mbed_wait_api.h | 0 .../tests/UNITTESTS/doubles/platform}/nvic_wrapper.h | 0 .../tests/UNITTESTS/doubles}/platform/platform.h | 0 19 files changed, 3 insertions(+) rename {UNITTESTS/target_h => platform/tests/UNITTESTS/doubles}/platform/CThunk.h (100%) rename {UNITTESTS/target_h => platform/tests/UNITTESTS/doubles}/platform/cxxsupport/mstd_algorithm (100%) rename {UNITTESTS/target_h => platform/tests/UNITTESTS/doubles}/platform/cxxsupport/mstd_atomic (100%) rename {UNITTESTS/target_h => platform/tests/UNITTESTS/doubles}/platform/cxxsupport/mstd_cstddef (100%) rename {UNITTESTS/target_h => platform/tests/UNITTESTS/doubles}/platform/cxxsupport/mstd_functional (100%) rename {UNITTESTS/target_h => platform/tests/UNITTESTS/doubles}/platform/cxxsupport/mstd_iterator (100%) rename {UNITTESTS/target_h => platform/tests/UNITTESTS/doubles}/platform/cxxsupport/mstd_memory (100%) rename {UNITTESTS/target_h => platform/tests/UNITTESTS/doubles}/platform/cxxsupport/mstd_mutex (100%) rename {UNITTESTS/target_h => platform/tests/UNITTESTS/doubles}/platform/cxxsupport/mstd_new (100%) rename {UNITTESTS/target_h => platform/tests/UNITTESTS/doubles}/platform/cxxsupport/mstd_tuple (100%) rename {UNITTESTS/target_h => platform/tests/UNITTESTS/doubles}/platform/cxxsupport/mstd_type_traits (100%) rename {UNITTESTS/target_h => platform/tests/UNITTESTS/doubles}/platform/cxxsupport/mstd_utility (100%) rename {UNITTESTS/target_h => platform/tests/UNITTESTS/doubles}/platform/mbed_assert.h (100%) rename {UNITTESTS/target_h => platform/tests/UNITTESTS/doubles}/platform/mbed_power_mgmt.h (100%) rename {UNITTESTS/target_h => platform/tests/UNITTESTS/doubles}/platform/mbed_retarget.h (100%) rename {UNITTESTS/target_h => platform/tests/UNITTESTS/doubles}/platform/mbed_wait_api.h (100%) rename {UNITTESTS/target_h => platform/tests/UNITTESTS/doubles/platform}/nvic_wrapper.h (100%) rename {UNITTESTS/target_h => platform/tests/UNITTESTS/doubles}/platform/platform.h (100%) diff --git a/platform/tests/UNITTESTS/doubles/CMakeLists.txt b/platform/tests/UNITTESTS/doubles/CMakeLists.txt index cb8bd7fb1bf..8d14bfcd469 100644 --- a/platform/tests/UNITTESTS/doubles/CMakeLists.txt +++ b/platform/tests/UNITTESTS/doubles/CMakeLists.txt @@ -4,6 +4,9 @@ add_library(mbed-headers-platform INTERFACE) target_include_directories(mbed-headers-platform INTERFACE + . + platform + platform/cxxsupport ${mbed-os_SOURCE_DIR}/platform/include ${mbed-os_SOURCE_DIR}/platform/include/platform ${mbed-os_SOURCE_DIR}/platform/randlib/include/mbed-client-randlib/ diff --git a/UNITTESTS/target_h/platform/CThunk.h b/platform/tests/UNITTESTS/doubles/platform/CThunk.h similarity index 100% rename from UNITTESTS/target_h/platform/CThunk.h rename to platform/tests/UNITTESTS/doubles/platform/CThunk.h diff --git a/UNITTESTS/target_h/platform/cxxsupport/mstd_algorithm b/platform/tests/UNITTESTS/doubles/platform/cxxsupport/mstd_algorithm similarity index 100% rename from UNITTESTS/target_h/platform/cxxsupport/mstd_algorithm rename to platform/tests/UNITTESTS/doubles/platform/cxxsupport/mstd_algorithm diff --git a/UNITTESTS/target_h/platform/cxxsupport/mstd_atomic b/platform/tests/UNITTESTS/doubles/platform/cxxsupport/mstd_atomic similarity index 100% rename from UNITTESTS/target_h/platform/cxxsupport/mstd_atomic rename to platform/tests/UNITTESTS/doubles/platform/cxxsupport/mstd_atomic diff --git a/UNITTESTS/target_h/platform/cxxsupport/mstd_cstddef b/platform/tests/UNITTESTS/doubles/platform/cxxsupport/mstd_cstddef similarity index 100% rename from UNITTESTS/target_h/platform/cxxsupport/mstd_cstddef rename to platform/tests/UNITTESTS/doubles/platform/cxxsupport/mstd_cstddef diff --git a/UNITTESTS/target_h/platform/cxxsupport/mstd_functional b/platform/tests/UNITTESTS/doubles/platform/cxxsupport/mstd_functional similarity index 100% rename from UNITTESTS/target_h/platform/cxxsupport/mstd_functional rename to platform/tests/UNITTESTS/doubles/platform/cxxsupport/mstd_functional diff --git a/UNITTESTS/target_h/platform/cxxsupport/mstd_iterator b/platform/tests/UNITTESTS/doubles/platform/cxxsupport/mstd_iterator similarity index 100% rename from UNITTESTS/target_h/platform/cxxsupport/mstd_iterator rename to platform/tests/UNITTESTS/doubles/platform/cxxsupport/mstd_iterator diff --git a/UNITTESTS/target_h/platform/cxxsupport/mstd_memory b/platform/tests/UNITTESTS/doubles/platform/cxxsupport/mstd_memory similarity index 100% rename from UNITTESTS/target_h/platform/cxxsupport/mstd_memory rename to platform/tests/UNITTESTS/doubles/platform/cxxsupport/mstd_memory diff --git a/UNITTESTS/target_h/platform/cxxsupport/mstd_mutex b/platform/tests/UNITTESTS/doubles/platform/cxxsupport/mstd_mutex similarity index 100% rename from UNITTESTS/target_h/platform/cxxsupport/mstd_mutex rename to platform/tests/UNITTESTS/doubles/platform/cxxsupport/mstd_mutex diff --git a/UNITTESTS/target_h/platform/cxxsupport/mstd_new b/platform/tests/UNITTESTS/doubles/platform/cxxsupport/mstd_new similarity index 100% rename from UNITTESTS/target_h/platform/cxxsupport/mstd_new rename to platform/tests/UNITTESTS/doubles/platform/cxxsupport/mstd_new diff --git a/UNITTESTS/target_h/platform/cxxsupport/mstd_tuple b/platform/tests/UNITTESTS/doubles/platform/cxxsupport/mstd_tuple similarity index 100% rename from UNITTESTS/target_h/platform/cxxsupport/mstd_tuple rename to platform/tests/UNITTESTS/doubles/platform/cxxsupport/mstd_tuple diff --git a/UNITTESTS/target_h/platform/cxxsupport/mstd_type_traits b/platform/tests/UNITTESTS/doubles/platform/cxxsupport/mstd_type_traits similarity index 100% rename from UNITTESTS/target_h/platform/cxxsupport/mstd_type_traits rename to platform/tests/UNITTESTS/doubles/platform/cxxsupport/mstd_type_traits diff --git a/UNITTESTS/target_h/platform/cxxsupport/mstd_utility b/platform/tests/UNITTESTS/doubles/platform/cxxsupport/mstd_utility similarity index 100% rename from UNITTESTS/target_h/platform/cxxsupport/mstd_utility rename to platform/tests/UNITTESTS/doubles/platform/cxxsupport/mstd_utility diff --git a/UNITTESTS/target_h/platform/mbed_assert.h b/platform/tests/UNITTESTS/doubles/platform/mbed_assert.h similarity index 100% rename from UNITTESTS/target_h/platform/mbed_assert.h rename to platform/tests/UNITTESTS/doubles/platform/mbed_assert.h diff --git a/UNITTESTS/target_h/platform/mbed_power_mgmt.h b/platform/tests/UNITTESTS/doubles/platform/mbed_power_mgmt.h similarity index 100% rename from UNITTESTS/target_h/platform/mbed_power_mgmt.h rename to platform/tests/UNITTESTS/doubles/platform/mbed_power_mgmt.h diff --git a/UNITTESTS/target_h/platform/mbed_retarget.h b/platform/tests/UNITTESTS/doubles/platform/mbed_retarget.h similarity index 100% rename from UNITTESTS/target_h/platform/mbed_retarget.h rename to platform/tests/UNITTESTS/doubles/platform/mbed_retarget.h diff --git a/UNITTESTS/target_h/platform/mbed_wait_api.h b/platform/tests/UNITTESTS/doubles/platform/mbed_wait_api.h similarity index 100% rename from UNITTESTS/target_h/platform/mbed_wait_api.h rename to platform/tests/UNITTESTS/doubles/platform/mbed_wait_api.h diff --git a/UNITTESTS/target_h/nvic_wrapper.h b/platform/tests/UNITTESTS/doubles/platform/nvic_wrapper.h similarity index 100% rename from UNITTESTS/target_h/nvic_wrapper.h rename to platform/tests/UNITTESTS/doubles/platform/nvic_wrapper.h diff --git a/UNITTESTS/target_h/platform/platform.h b/platform/tests/UNITTESTS/doubles/platform/platform.h similarity index 100% rename from UNITTESTS/target_h/platform/platform.h rename to platform/tests/UNITTESTS/doubles/platform/platform.h From 71962481a454835403ace93dd8156949f084246d Mon Sep 17 00:00:00 2001 From: Lingkai Dong Date: Fri, 16 Jul 2021 13:56:41 +0100 Subject: [PATCH 08/17] Unit tests: Remove mbed.h stub from target_h The header `mbed.h` is a convenient wrapper that pre-includes some platform headers, for use by user applications. Libraries and tests internal to Mbed OS should not use it, and they should explicitly include headers they need. So a stub is not needed. --- UNITTESTS/target_h/mbed.h | 34 ------------------- .../UNITTESTS/doubles/NetworkStack_stub.cpp | 1 - events/tests/UNITTESTS/equeue/test_equeue.cpp | 2 +- 3 files changed, 1 insertion(+), 36 deletions(-) delete mode 100644 UNITTESTS/target_h/mbed.h diff --git a/UNITTESTS/target_h/mbed.h b/UNITTESTS/target_h/mbed.h deleted file mode 100644 index 276aebc58b4..00000000000 --- a/UNITTESTS/target_h/mbed.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2018, Arm Limited and affiliates. - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef MBED_H -#define MBED_H - -#include -#include - -#include "events/mbed_events.h" -#include "events/mbed_shared_queues.h" - -namespace mbed { -#include "platform/Callback.h" -}; - -using namespace mbed; -using namespace std; - -#endif // MBED_H diff --git a/connectivity/netsocket/tests/UNITTESTS/doubles/NetworkStack_stub.cpp b/connectivity/netsocket/tests/UNITTESTS/doubles/NetworkStack_stub.cpp index 7d6331a4d9c..877bfc7db71 100644 --- a/connectivity/netsocket/tests/UNITTESTS/doubles/NetworkStack_stub.cpp +++ b/connectivity/netsocket/tests/UNITTESTS/doubles/NetworkStack_stub.cpp @@ -17,7 +17,6 @@ #include "netsocket/NetworkStack.h" #include "netsocket/nsapi_dns.h" -#include "mbed.h" #include "stddef.h" #include diff --git a/events/tests/UNITTESTS/equeue/test_equeue.cpp b/events/tests/UNITTESTS/equeue/test_equeue.cpp index ae017cb014c..c99c31a2e2c 100644 --- a/events/tests/UNITTESTS/equeue/test_equeue.cpp +++ b/events/tests/UNITTESTS/equeue/test_equeue.cpp @@ -16,7 +16,7 @@ */ #include "gtest/gtest.h" #include "events/equeue.h" -#include "mbed.h" +#include "platform/Callback.h" #include #include From 1f99729474f9ea9040c6d91e8d4228a2bc3c97a5 Mon Sep 17 00:00:00 2001 From: Lingkai Dong Date: Fri, 16 Jul 2021 14:04:47 +0100 Subject: [PATCH 09/17] Unit tests: Move rtos target_h stubs --- rtos/tests/UNITTESTS/doubles/CMakeLists.txt | 1 + .../target_h => rtos/tests/UNITTESTS/doubles}/rtos/Mutex.h | 0 .../target_h => rtos/tests/UNITTESTS/doubles}/rtos/Semaphore.h | 0 .../target_h => rtos/tests/UNITTESTS/doubles}/rtos/Thread.h | 0 .../tests/UNITTESTS/doubles}/rtos/internal/mbed_rtos1_types.h | 0 .../tests/UNITTESTS/doubles}/rtos/internal/mbed_rtos_storage.h | 0 {UNITTESTS/target_h => rtos/tests/UNITTESTS/doubles}/rtos/rtos.h | 0 7 files changed, 1 insertion(+) rename {UNITTESTS/target_h => rtos/tests/UNITTESTS/doubles}/rtos/Mutex.h (100%) rename {UNITTESTS/target_h => rtos/tests/UNITTESTS/doubles}/rtos/Semaphore.h (100%) rename {UNITTESTS/target_h => rtos/tests/UNITTESTS/doubles}/rtos/Thread.h (100%) rename {UNITTESTS/target_h/rtos/include => rtos/tests/UNITTESTS/doubles}/rtos/internal/mbed_rtos1_types.h (100%) rename {UNITTESTS/target_h/rtos/include => rtos/tests/UNITTESTS/doubles}/rtos/internal/mbed_rtos_storage.h (100%) rename {UNITTESTS/target_h => rtos/tests/UNITTESTS/doubles}/rtos/rtos.h (100%) diff --git a/rtos/tests/UNITTESTS/doubles/CMakeLists.txt b/rtos/tests/UNITTESTS/doubles/CMakeLists.txt index babf17c9207..ed8440daec8 100644 --- a/rtos/tests/UNITTESTS/doubles/CMakeLists.txt +++ b/rtos/tests/UNITTESTS/doubles/CMakeLists.txt @@ -5,6 +5,7 @@ add_library(mbed-headers-rtos INTERFACE) target_include_directories(mbed-headers-rtos INTERFACE + . ${mbed-os_SOURCE_DIR}/rtos/include ${mbed-os_SOURCE_DIR}/rtos/include/rtos ) diff --git a/UNITTESTS/target_h/rtos/Mutex.h b/rtos/tests/UNITTESTS/doubles/rtos/Mutex.h similarity index 100% rename from UNITTESTS/target_h/rtos/Mutex.h rename to rtos/tests/UNITTESTS/doubles/rtos/Mutex.h diff --git a/UNITTESTS/target_h/rtos/Semaphore.h b/rtos/tests/UNITTESTS/doubles/rtos/Semaphore.h similarity index 100% rename from UNITTESTS/target_h/rtos/Semaphore.h rename to rtos/tests/UNITTESTS/doubles/rtos/Semaphore.h diff --git a/UNITTESTS/target_h/rtos/Thread.h b/rtos/tests/UNITTESTS/doubles/rtos/Thread.h similarity index 100% rename from UNITTESTS/target_h/rtos/Thread.h rename to rtos/tests/UNITTESTS/doubles/rtos/Thread.h diff --git a/UNITTESTS/target_h/rtos/include/rtos/internal/mbed_rtos1_types.h b/rtos/tests/UNITTESTS/doubles/rtos/internal/mbed_rtos1_types.h similarity index 100% rename from UNITTESTS/target_h/rtos/include/rtos/internal/mbed_rtos1_types.h rename to rtos/tests/UNITTESTS/doubles/rtos/internal/mbed_rtos1_types.h diff --git a/UNITTESTS/target_h/rtos/include/rtos/internal/mbed_rtos_storage.h b/rtos/tests/UNITTESTS/doubles/rtos/internal/mbed_rtos_storage.h similarity index 100% rename from UNITTESTS/target_h/rtos/include/rtos/internal/mbed_rtos_storage.h rename to rtos/tests/UNITTESTS/doubles/rtos/internal/mbed_rtos_storage.h diff --git a/UNITTESTS/target_h/rtos/rtos.h b/rtos/tests/UNITTESTS/doubles/rtos/rtos.h similarity index 100% rename from UNITTESTS/target_h/rtos/rtos.h rename to rtos/tests/UNITTESTS/doubles/rtos/rtos.h From 5fe0f8916b0d13aaea4ba82eb3ecf3dc340c308a Mon Sep 17 00:00:00 2001 From: Lingkai Dong Date: Mon, 19 Jul 2021 10:01:34 +0100 Subject: [PATCH 10/17] Unit tests: Fix style in rtos Thread.h stubs --- rtos/tests/UNITTESTS/doubles/rtos/Thread.h | 55 +++++++++++++++------- 1 file changed, 37 insertions(+), 18 deletions(-) diff --git a/rtos/tests/UNITTESTS/doubles/rtos/Thread.h b/rtos/tests/UNITTESTS/doubles/rtos/Thread.h index 1fa8e47f153..f6ae5fd3e01 100644 --- a/rtos/tests/UNITTESTS/doubles/rtos/Thread.h +++ b/rtos/tests/UNITTESTS/doubles/rtos/Thread.h @@ -48,11 +48,23 @@ class Thread { osStatus start(mbed::Callback task); - osStatus join() {return 0;}; + osStatus join() + { + return 0; + }; osStatus terminate(); - osStatus set_priority(osPriority priority){return 0;}; - osPriority get_priority() const{return osPriorityNormal;}; - uint32_t flags_set(uint32_t flags){return 0;}; + osStatus set_priority(osPriority priority) + { + return 0; + }; + osPriority get_priority() const + { + return osPriorityNormal; + }; + uint32_t flags_set(uint32_t flags) + { + return 0; + }; /** State of the Thread */ enum State { @@ -77,26 +89,33 @@ class Thread { Deleted, /**< The task has been deleted or not started */ }; - State get_state() const { - return Ready; + State get_state() const + { + return Ready; }; - uint32_t stack_size() const { - return 0; + uint32_t stack_size() const + { + return 0; }; - uint32_t free_stack() const { - return 0; + uint32_t free_stack() const + { + return 0; }; - uint32_t used_stack() const { - return 0; + uint32_t used_stack() const + { + return 0; }; - uint32_t max_stack() const { - return 0; + uint32_t max_stack() const + { + return 0; }; - const char *get_name() const { - return ""; + const char *get_name() const + { + return ""; }; - osThreadId_t get_id() const { - return 0; + osThreadId_t get_id() const + { + return 0; }; virtual ~Thread(); private: From e75a45d0416f122a1f0a71b3e0c95bcf416b8ae3 Mon Sep 17 00:00:00 2001 From: Lingkai Dong Date: Fri, 16 Jul 2021 14:07:32 +0100 Subject: [PATCH 11/17] Unit tests: Move drivers target_h stubs --- drivers/tests/UNITTESTS/doubles/CMakeLists.txt | 1 + .../tests/UNITTESTS/doubles}/drivers/LowPowerTicker.h | 0 .../tests/UNITTESTS/doubles}/drivers/Ticker.h | 0 3 files changed, 1 insertion(+) rename {UNITTESTS/target_h => drivers/tests/UNITTESTS/doubles}/drivers/LowPowerTicker.h (100%) rename {UNITTESTS/target_h => drivers/tests/UNITTESTS/doubles}/drivers/Ticker.h (100%) diff --git a/drivers/tests/UNITTESTS/doubles/CMakeLists.txt b/drivers/tests/UNITTESTS/doubles/CMakeLists.txt index a223876842c..cb648500945 100644 --- a/drivers/tests/UNITTESTS/doubles/CMakeLists.txt +++ b/drivers/tests/UNITTESTS/doubles/CMakeLists.txt @@ -5,6 +5,7 @@ add_library(mbed-headers-drivers INTERFACE) target_include_directories(mbed-headers-drivers INTERFACE + . ${mbed-os_SOURCE_DIR}/drivers ${mbed-os_SOURCE_DIR}/drivers/include ${mbed-os_SOURCE_DIR}/drivers/include/drivers diff --git a/UNITTESTS/target_h/drivers/LowPowerTicker.h b/drivers/tests/UNITTESTS/doubles/drivers/LowPowerTicker.h similarity index 100% rename from UNITTESTS/target_h/drivers/LowPowerTicker.h rename to drivers/tests/UNITTESTS/doubles/drivers/LowPowerTicker.h diff --git a/UNITTESTS/target_h/drivers/Ticker.h b/drivers/tests/UNITTESTS/doubles/drivers/Ticker.h similarity index 100% rename from UNITTESTS/target_h/drivers/Ticker.h rename to drivers/tests/UNITTESTS/doubles/drivers/Ticker.h From c775e30b2d992842d116bde81014f7dd26ef09c4 Mon Sep 17 00:00:00 2001 From: Lingkai Dong Date: Fri, 16 Jul 2021 14:10:49 +0100 Subject: [PATCH 12/17] Unit tests: Move randLIB.h The stub header randLIB.h overrides the header of the same name in platform/randlib/ which is an external repository vendored into the mbed-os codebase. As the repository is synchronized regularly, it is better not to put overrides there, so we put the randLIB.h stub into the regular platform doubles directory. --- .../target_h => platform/tests/UNITTESTS/doubles}/randLIB.h | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {UNITTESTS/target_h => platform/tests/UNITTESTS/doubles}/randLIB.h (100%) diff --git a/UNITTESTS/target_h/randLIB.h b/platform/tests/UNITTESTS/doubles/randLIB.h similarity index 100% rename from UNITTESTS/target_h/randLIB.h rename to platform/tests/UNITTESTS/doubles/randLIB.h From 825e3491b017d6ca87ce4074016dda26e9640001 Mon Sep 17 00:00:00 2001 From: Lingkai Dong Date: Wed, 7 Jul 2021 17:36:05 +0100 Subject: [PATCH 13/17] Unit tests: Move hal target_h stubs Stubs previously in UNITTESTS/target_h/ have the same names as regular Mbed OS headers, intending to override the latter directly. We move hal target_h stubs into hal/tests/UNITTESTS/doubles/. Note: In Mbed OS, the standard include format requires each header to be prefixed with its module name, for example "hal/gpio_api.h". This requires headers to be organized in a module directory. But unit tests stubs for hal correspond to what a real Mbed target would have implemented (in a non-test scenario), and targets do not currently put headers in hal/, so we similary put stub headers directly in hal/tests/UNITTESTS/doubles/ instead of add a hal/ subdirectory there. --- hal/tests/UNITTESTS/doubles/CMakeLists.txt | 1 + .../target_h => hal/tests/UNITTESTS/doubles}/PeripheralNames.h | 0 {UNITTESTS/target_h => hal/tests/UNITTESTS/doubles}/PinNames.h | 0 {UNITTESTS/target_h => hal/tests/UNITTESTS/doubles}/device.h | 0 .../target_h => hal/tests/UNITTESTS/doubles}/gpio_object.h | 0 {UNITTESTS/target_h => hal/tests/UNITTESTS/doubles}/objects.h | 0 6 files changed, 1 insertion(+) rename {UNITTESTS/target_h => hal/tests/UNITTESTS/doubles}/PeripheralNames.h (100%) rename {UNITTESTS/target_h => hal/tests/UNITTESTS/doubles}/PinNames.h (100%) rename {UNITTESTS/target_h => hal/tests/UNITTESTS/doubles}/device.h (100%) rename {UNITTESTS/target_h => hal/tests/UNITTESTS/doubles}/gpio_object.h (100%) rename {UNITTESTS/target_h => hal/tests/UNITTESTS/doubles}/objects.h (100%) diff --git a/hal/tests/UNITTESTS/doubles/CMakeLists.txt b/hal/tests/UNITTESTS/doubles/CMakeLists.txt index 3dc195030dc..f82ceb58c97 100644 --- a/hal/tests/UNITTESTS/doubles/CMakeLists.txt +++ b/hal/tests/UNITTESTS/doubles/CMakeLists.txt @@ -5,6 +5,7 @@ add_library(mbed-headers-hal INTERFACE) target_include_directories(mbed-headers-hal INTERFACE + . ${mbed-os_SOURCE_DIR}/hal ${mbed-os_SOURCE_DIR}/hal/include ) diff --git a/UNITTESTS/target_h/PeripheralNames.h b/hal/tests/UNITTESTS/doubles/PeripheralNames.h similarity index 100% rename from UNITTESTS/target_h/PeripheralNames.h rename to hal/tests/UNITTESTS/doubles/PeripheralNames.h diff --git a/UNITTESTS/target_h/PinNames.h b/hal/tests/UNITTESTS/doubles/PinNames.h similarity index 100% rename from UNITTESTS/target_h/PinNames.h rename to hal/tests/UNITTESTS/doubles/PinNames.h diff --git a/UNITTESTS/target_h/device.h b/hal/tests/UNITTESTS/doubles/device.h similarity index 100% rename from UNITTESTS/target_h/device.h rename to hal/tests/UNITTESTS/doubles/device.h diff --git a/UNITTESTS/target_h/gpio_object.h b/hal/tests/UNITTESTS/doubles/gpio_object.h similarity index 100% rename from UNITTESTS/target_h/gpio_object.h rename to hal/tests/UNITTESTS/doubles/gpio_object.h diff --git a/UNITTESTS/target_h/objects.h b/hal/tests/UNITTESTS/doubles/objects.h similarity index 100% rename from UNITTESTS/target_h/objects.h rename to hal/tests/UNITTESTS/doubles/objects.h From 6731f553ce38e2d243cc0b2a3153856f69e2133d Mon Sep 17 00:00:00 2001 From: Lingkai Dong Date: Mon, 19 Jul 2021 10:02:30 +0100 Subject: [PATCH 14/17] Unit tests: Fix style in hal gpio_object.h stub --- hal/tests/UNITTESTS/doubles/gpio_object.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hal/tests/UNITTESTS/doubles/gpio_object.h b/hal/tests/UNITTESTS/doubles/gpio_object.h index 9f31aeb9b37..2fd544a8551 100644 --- a/hal/tests/UNITTESTS/doubles/gpio_object.h +++ b/hal/tests/UNITTESTS/doubles/gpio_object.h @@ -27,7 +27,7 @@ extern "C" { #endif typedef struct { - int unused; + int unused; } gpio_t; #ifdef __cplusplus From dca2aa79a0be368b0968b953f7207421bc5cb8c1 Mon Sep 17 00:00:00 2001 From: Lingkai Dong Date: Fri, 16 Jul 2021 14:23:39 +0100 Subject: [PATCH 15/17] Unit tests: Remove redundant CMake target mbed-headers-base Individual libraries' `target_h` stub headers have now all been moved from `mbed-headers-base` to `mbed-headers-`. Note: Even though headers previously in `target_h` are technically stubs/fakes too, they are used by not only unit tests but also regular libraries when compiled for unit tests, because no target-specific HAL implementation exists in this case. In order for regular library sources to pick up `target_h` headers, those headers must * have the same names as regular headers * appear first in include paths This is why those headers are part of `mbed-headers-` and not `mbed-stubs-`. Before this refactoring, `mbed-headers-base` was the first in unit tests' include paths. --- UNITTESTS/stubs/CMakeLists.txt | 14 -------------- .../tests/UNITTESTS/doubles/CMakeLists.txt | 1 - .../framework/AT/at_cellularcontext/CMakeLists.txt | 1 - .../framework/AT/at_cellulardevice/CMakeLists.txt | 1 - .../AT/at_cellularinformation/CMakeLists.txt | 1 - .../framework/AT/at_cellularnetwork/CMakeLists.txt | 1 - .../framework/AT/at_cellularsms/CMakeLists.txt | 1 - .../framework/AT/at_cellularstack/CMakeLists.txt | 1 - .../framework/device/athandler/CMakeLists.txt | 1 - .../device/cellularcontext/CMakeLists.txt | 1 - .../framework/device/cellulardevice/CMakeLists.txt | 1 - .../device/cellularstatemachine/CMakeLists.txt | 1 - .../lorawan/tests/UNITTESTS/doubles/CMakeLists.txt | 1 - .../features/lorawan/loramac/CMakeLists.txt | 1 - .../lorawan/loramacchannelplan/CMakeLists.txt | 1 - .../features/lorawan/loramaccommand/CMakeLists.txt | 1 - .../features/lorawan/loramaccrypto/CMakeLists.txt | 1 - .../features/lorawan/loraphy/CMakeLists.txt | 1 - .../features/lorawan/loraphyas923/CMakeLists.txt | 1 - .../features/lorawan/loraphyau915/CMakeLists.txt | 1 - .../features/lorawan/loraphycn470/CMakeLists.txt | 1 - .../features/lorawan/loraphycn779/CMakeLists.txt | 1 - .../features/lorawan/loraphyeu433/CMakeLists.txt | 1 - .../features/lorawan/loraphyeu868/CMakeLists.txt | 1 - .../features/lorawan/loraphyin865/CMakeLists.txt | 1 - .../features/lorawan/loraphykr920/CMakeLists.txt | 1 - .../features/lorawan/loraphyus915/CMakeLists.txt | 1 - .../lorawan/lorawaninterface/CMakeLists.txt | 1 - .../features/lorawan/lorawanstack/CMakeLists.txt | 1 - .../features/lorawan/lorawantimer/CMakeLists.txt | 1 - drivers/tests/UNITTESTS/PwmOut/CMakeLists.txt | 1 - drivers/tests/UNITTESTS/Watchdog/CMakeLists.txt | 1 - drivers/tests/UNITTESTS/doubles/CMakeLists.txt | 1 - events/tests/UNITTESTS/doubles/CMakeLists.txt | 1 - events/tests/UNITTESTS/equeue/CMakeLists.txt | 1 - hal/tests/UNITTESTS/doubles/CMakeLists.txt | 1 - platform/tests/UNITTESTS/doubles/CMakeLists.txt | 1 - rtos/tests/UNITTESTS/doubles/CMakeLists.txt | 1 - .../tests/UNITTESTS/SFDP/CMakeLists.txt | 1 - .../blockdevice/BufferedBlockDevice/CMakeLists.txt | 1 - .../blockdevice/ChainingBlockDevice/CMakeLists.txt | 1 - .../ExhaustibleBlockDevice/CMakeLists.txt | 1 - .../blockdevice/FlashSimBlockDevice/CMakeLists.txt | 1 - .../blockdevice/HeapBlockDevice/CMakeLists.txt | 1 - .../blockdevice/MBRBlockDevice/CMakeLists.txt | 1 - .../ObservingBlockDevice/CMakeLists.txt | 1 - .../ProfilingBlockDevice/CMakeLists.txt | 1 - .../blockdevice/ReadOnlyBlockDevice/CMakeLists.txt | 1 - .../blockdevice/SlicingBlockDevice/CMakeLists.txt | 1 - .../tests/UNITTESTS/doubles/CMakeLists.txt | 1 - .../tests/UNITTESTS/FileSystemStore/CMakeLists.txt | 1 - .../tests/UNITTESTS/TDBStore/CMakeLists.txt | 1 - 52 files changed, 65 deletions(-) diff --git a/UNITTESTS/stubs/CMakeLists.txt b/UNITTESTS/stubs/CMakeLists.txt index 9a10220f31a..de1b11dc6ce 100644 --- a/UNITTESTS/stubs/CMakeLists.txt +++ b/UNITTESTS/stubs/CMakeLists.txt @@ -3,11 +3,9 @@ add_library(mbed-stubs-headers INTERFACE) add_library(mbed-headers INTERFACE) -add_library(mbed-headers-base INTERFACE) target_link_libraries(mbed-headers INTERFACE - mbed-headers-base mbed-headers-platform mbed-headers-drivers mbed-headers-hal @@ -15,18 +13,6 @@ target_link_libraries(mbed-headers mbed-headers-rtos ) -target_include_directories(mbed-headers-base - INTERFACE - ${mbed-os_SOURCE_DIR}/UNITTESTS/target_h - ${mbed-os_SOURCE_DIR}/UNITTESTS/target_h/platform - ${mbed-os_SOURCE_DIR}/UNITTESTS/target_h/platform/cxxsupport - ${mbed-os_SOURCE_DIR}/UNITTESTS/target_h/drivers - ${mbed-os_SOURCE_DIR}/UNITTESTS/target_h/rtos/include - ${mbed-os_SOURCE_DIR}/UNITTESTS/target_h/rtos - ${mbed-os_SOURCE_DIR}/UNITTESTS/target_h/sys -) - - target_include_directories(mbed-headers INTERFACE ${mbed-os_SOURCE_DIR}/features diff --git a/connectivity/cellular/tests/UNITTESTS/doubles/CMakeLists.txt b/connectivity/cellular/tests/UNITTESTS/doubles/CMakeLists.txt index 4089759e2b4..6cc9c2c0fc9 100644 --- a/connectivity/cellular/tests/UNITTESTS/doubles/CMakeLists.txt +++ b/connectivity/cellular/tests/UNITTESTS/doubles/CMakeLists.txt @@ -49,7 +49,6 @@ target_sources(mbed-stubs-cellular target_link_libraries(mbed-stubs-cellular PRIVATE - mbed-headers-base mbed-stubs-platform mbed-headers-rtos mbed-headers-drivers diff --git a/connectivity/cellular/tests/UNITTESTS/framework/AT/at_cellularcontext/CMakeLists.txt b/connectivity/cellular/tests/UNITTESTS/framework/AT/at_cellularcontext/CMakeLists.txt index b94dce45c1c..d59d064c232 100644 --- a/connectivity/cellular/tests/UNITTESTS/framework/AT/at_cellularcontext/CMakeLists.txt +++ b/connectivity/cellular/tests/UNITTESTS/framework/AT/at_cellularcontext/CMakeLists.txt @@ -23,7 +23,6 @@ target_sources(${TEST_NAME} target_link_libraries(${TEST_NAME} PRIVATE - mbed-headers-base mbed-headers-platform mbed-headers-events mbed-headers-rtos diff --git a/connectivity/cellular/tests/UNITTESTS/framework/AT/at_cellulardevice/CMakeLists.txt b/connectivity/cellular/tests/UNITTESTS/framework/AT/at_cellulardevice/CMakeLists.txt index 176bf21e4e4..eb44678a860 100644 --- a/connectivity/cellular/tests/UNITTESTS/framework/AT/at_cellulardevice/CMakeLists.txt +++ b/connectivity/cellular/tests/UNITTESTS/framework/AT/at_cellulardevice/CMakeLists.txt @@ -29,7 +29,6 @@ target_sources(${TEST_NAME} target_link_libraries(${TEST_NAME} PRIVATE - mbed-headers-base mbed-headers-platform mbed-headers-events mbed-headers-rtos diff --git a/connectivity/cellular/tests/UNITTESTS/framework/AT/at_cellularinformation/CMakeLists.txt b/connectivity/cellular/tests/UNITTESTS/framework/AT/at_cellularinformation/CMakeLists.txt index ff616ebd5b1..f9d517d7218 100644 --- a/connectivity/cellular/tests/UNITTESTS/framework/AT/at_cellularinformation/CMakeLists.txt +++ b/connectivity/cellular/tests/UNITTESTS/framework/AT/at_cellularinformation/CMakeLists.txt @@ -21,7 +21,6 @@ target_sources(${TEST_NAME} target_link_libraries(${TEST_NAME} PRIVATE - mbed-headers-base mbed-headers-platform mbed-headers-events mbed-headers-rtos diff --git a/connectivity/cellular/tests/UNITTESTS/framework/AT/at_cellularnetwork/CMakeLists.txt b/connectivity/cellular/tests/UNITTESTS/framework/AT/at_cellularnetwork/CMakeLists.txt index 034d61bd41e..8ae33840f50 100644 --- a/connectivity/cellular/tests/UNITTESTS/framework/AT/at_cellularnetwork/CMakeLists.txt +++ b/connectivity/cellular/tests/UNITTESTS/framework/AT/at_cellularnetwork/CMakeLists.txt @@ -22,7 +22,6 @@ target_sources(${TEST_NAME} target_link_libraries(${TEST_NAME} PRIVATE - mbed-headers-base mbed-headers-platform mbed-headers-events mbed-headers-rtos diff --git a/connectivity/cellular/tests/UNITTESTS/framework/AT/at_cellularsms/CMakeLists.txt b/connectivity/cellular/tests/UNITTESTS/framework/AT/at_cellularsms/CMakeLists.txt index a82f0ee76b7..806857c5008 100644 --- a/connectivity/cellular/tests/UNITTESTS/framework/AT/at_cellularsms/CMakeLists.txt +++ b/connectivity/cellular/tests/UNITTESTS/framework/AT/at_cellularsms/CMakeLists.txt @@ -22,7 +22,6 @@ target_sources(${TEST_NAME} target_link_libraries(${TEST_NAME} PRIVATE - mbed-headers-base mbed-headers-platform mbed-headers-events mbed-headers-rtos diff --git a/connectivity/cellular/tests/UNITTESTS/framework/AT/at_cellularstack/CMakeLists.txt b/connectivity/cellular/tests/UNITTESTS/framework/AT/at_cellularstack/CMakeLists.txt index 9176840f6f7..7051d597dff 100644 --- a/connectivity/cellular/tests/UNITTESTS/framework/AT/at_cellularstack/CMakeLists.txt +++ b/connectivity/cellular/tests/UNITTESTS/framework/AT/at_cellularstack/CMakeLists.txt @@ -27,7 +27,6 @@ target_sources(${TEST_NAME} target_link_libraries(${TEST_NAME} PRIVATE - mbed-headers-base mbed-headers-platform mbed-headers-events mbed-headers-rtos diff --git a/connectivity/cellular/tests/UNITTESTS/framework/device/athandler/CMakeLists.txt b/connectivity/cellular/tests/UNITTESTS/framework/device/athandler/CMakeLists.txt index 03c075e3f29..2f8e40ce47d 100644 --- a/connectivity/cellular/tests/UNITTESTS/framework/device/athandler/CMakeLists.txt +++ b/connectivity/cellular/tests/UNITTESTS/framework/device/athandler/CMakeLists.txt @@ -26,7 +26,6 @@ target_sources(${TEST_NAME} target_link_libraries(${TEST_NAME} PRIVATE - mbed-headers-base mbed-headers-platform mbed-headers-events mbed-headers-rtos diff --git a/connectivity/cellular/tests/UNITTESTS/framework/device/cellularcontext/CMakeLists.txt b/connectivity/cellular/tests/UNITTESTS/framework/device/cellularcontext/CMakeLists.txt index 4a40598f957..af73d4776c7 100644 --- a/connectivity/cellular/tests/UNITTESTS/framework/device/cellularcontext/CMakeLists.txt +++ b/connectivity/cellular/tests/UNITTESTS/framework/device/cellularcontext/CMakeLists.txt @@ -31,7 +31,6 @@ target_sources(${TEST_NAME} target_link_libraries(${TEST_NAME} PRIVATE - mbed-headers-base mbed-headers-platform mbed-headers-events mbed-headers-rtos diff --git a/connectivity/cellular/tests/UNITTESTS/framework/device/cellulardevice/CMakeLists.txt b/connectivity/cellular/tests/UNITTESTS/framework/device/cellulardevice/CMakeLists.txt index d77a8dee3d0..48843591c97 100644 --- a/connectivity/cellular/tests/UNITTESTS/framework/device/cellulardevice/CMakeLists.txt +++ b/connectivity/cellular/tests/UNITTESTS/framework/device/cellulardevice/CMakeLists.txt @@ -29,7 +29,6 @@ target_sources(${TEST_NAME} target_link_libraries(${TEST_NAME} PRIVATE - mbed-headers-base mbed-headers-platform mbed-headers-events mbed-headers-rtos diff --git a/connectivity/cellular/tests/UNITTESTS/framework/device/cellularstatemachine/CMakeLists.txt b/connectivity/cellular/tests/UNITTESTS/framework/device/cellularstatemachine/CMakeLists.txt index 1428310de60..e5e66bdc927 100644 --- a/connectivity/cellular/tests/UNITTESTS/framework/device/cellularstatemachine/CMakeLists.txt +++ b/connectivity/cellular/tests/UNITTESTS/framework/device/cellularstatemachine/CMakeLists.txt @@ -30,7 +30,6 @@ target_sources(${TEST_NAME} target_link_libraries(${TEST_NAME} PRIVATE - mbed-headers-base mbed-headers-platform mbed-headers-events mbed-headers-rtos diff --git a/connectivity/lorawan/tests/UNITTESTS/doubles/CMakeLists.txt b/connectivity/lorawan/tests/UNITTESTS/doubles/CMakeLists.txt index 66f929dfb9e..70f5d3f4620 100644 --- a/connectivity/lorawan/tests/UNITTESTS/doubles/CMakeLists.txt +++ b/connectivity/lorawan/tests/UNITTESTS/doubles/CMakeLists.txt @@ -40,7 +40,6 @@ target_sources(mbed-stubs-lorawan target_link_libraries(mbed-stubs-lorawan PRIVATE - mbed-headers-base mbed-headers-events mbed-headers-hal mbed-stubs-headers diff --git a/connectivity/lorawan/tests/UNITTESTS/features/lorawan/loramac/CMakeLists.txt b/connectivity/lorawan/tests/UNITTESTS/features/lorawan/loramac/CMakeLists.txt index 11ab6596b10..ebe9b3d6512 100644 --- a/connectivity/lorawan/tests/UNITTESTS/features/lorawan/loramac/CMakeLists.txt +++ b/connectivity/lorawan/tests/UNITTESTS/features/lorawan/loramac/CMakeLists.txt @@ -35,7 +35,6 @@ target_sources(${TEST_NAME} target_link_libraries(${TEST_NAME} PRIVATE - mbed-headers-base mbed-headers-events mbed-headers-hal mbed-headers-platform diff --git a/connectivity/lorawan/tests/UNITTESTS/features/lorawan/loramacchannelplan/CMakeLists.txt b/connectivity/lorawan/tests/UNITTESTS/features/lorawan/loramacchannelplan/CMakeLists.txt index 862de1d4413..523640378c1 100644 --- a/connectivity/lorawan/tests/UNITTESTS/features/lorawan/loramacchannelplan/CMakeLists.txt +++ b/connectivity/lorawan/tests/UNITTESTS/features/lorawan/loramacchannelplan/CMakeLists.txt @@ -20,7 +20,6 @@ target_sources(${TEST_NAME} target_link_libraries(${TEST_NAME} PRIVATE - mbed-headers-base mbed-headers-events mbed-headers-hal mbed-headers-platform diff --git a/connectivity/lorawan/tests/UNITTESTS/features/lorawan/loramaccommand/CMakeLists.txt b/connectivity/lorawan/tests/UNITTESTS/features/lorawan/loramaccommand/CMakeLists.txt index 6bb1173b4da..10c05b15f3f 100644 --- a/connectivity/lorawan/tests/UNITTESTS/features/lorawan/loramaccommand/CMakeLists.txt +++ b/connectivity/lorawan/tests/UNITTESTS/features/lorawan/loramaccommand/CMakeLists.txt @@ -20,7 +20,6 @@ target_sources(${TEST_NAME} target_link_libraries(${TEST_NAME} PRIVATE - mbed-headers-base mbed-headers-events mbed-headers-hal mbed-headers-platform diff --git a/connectivity/lorawan/tests/UNITTESTS/features/lorawan/loramaccrypto/CMakeLists.txt b/connectivity/lorawan/tests/UNITTESTS/features/lorawan/loramaccrypto/CMakeLists.txt index 0c85b8bce35..e955f520bce 100644 --- a/connectivity/lorawan/tests/UNITTESTS/features/lorawan/loramaccrypto/CMakeLists.txt +++ b/connectivity/lorawan/tests/UNITTESTS/features/lorawan/loramaccrypto/CMakeLists.txt @@ -20,7 +20,6 @@ target_sources(${TEST_NAME} target_link_libraries(${TEST_NAME} PRIVATE - mbed-headers-base mbed-headers-platform mbed-headers-mbedtls mbed-headers-lorawan diff --git a/connectivity/lorawan/tests/UNITTESTS/features/lorawan/loraphy/CMakeLists.txt b/connectivity/lorawan/tests/UNITTESTS/features/lorawan/loraphy/CMakeLists.txt index c17e1859696..4d3fd3fdc63 100644 --- a/connectivity/lorawan/tests/UNITTESTS/features/lorawan/loraphy/CMakeLists.txt +++ b/connectivity/lorawan/tests/UNITTESTS/features/lorawan/loraphy/CMakeLists.txt @@ -24,7 +24,6 @@ target_sources(${TEST_NAME} target_link_libraries(${TEST_NAME} PRIVATE - mbed-headers-base mbed-headers-events mbed-headers-hal mbed-headers-platform diff --git a/connectivity/lorawan/tests/UNITTESTS/features/lorawan/loraphyas923/CMakeLists.txt b/connectivity/lorawan/tests/UNITTESTS/features/lorawan/loraphyas923/CMakeLists.txt index c010a76880e..abdb4da14d9 100644 --- a/connectivity/lorawan/tests/UNITTESTS/features/lorawan/loraphyas923/CMakeLists.txt +++ b/connectivity/lorawan/tests/UNITTESTS/features/lorawan/loraphyas923/CMakeLists.txt @@ -22,7 +22,6 @@ target_sources(${TEST_NAME} target_link_libraries(${TEST_NAME} PRIVATE - mbed-headers-base mbed-headers-events mbed-headers-hal mbed-headers-platform diff --git a/connectivity/lorawan/tests/UNITTESTS/features/lorawan/loraphyau915/CMakeLists.txt b/connectivity/lorawan/tests/UNITTESTS/features/lorawan/loraphyau915/CMakeLists.txt index 4b7c3219d9f..5bee043d9a8 100644 --- a/connectivity/lorawan/tests/UNITTESTS/features/lorawan/loraphyau915/CMakeLists.txt +++ b/connectivity/lorawan/tests/UNITTESTS/features/lorawan/loraphyau915/CMakeLists.txt @@ -28,7 +28,6 @@ target_sources(${TEST_NAME} target_link_libraries(${TEST_NAME} PRIVATE - mbed-headers-base mbed-headers-events mbed-headers-hal mbed-headers-platform diff --git a/connectivity/lorawan/tests/UNITTESTS/features/lorawan/loraphycn470/CMakeLists.txt b/connectivity/lorawan/tests/UNITTESTS/features/lorawan/loraphycn470/CMakeLists.txt index 72456b97161..29d3905a654 100644 --- a/connectivity/lorawan/tests/UNITTESTS/features/lorawan/loraphycn470/CMakeLists.txt +++ b/connectivity/lorawan/tests/UNITTESTS/features/lorawan/loraphycn470/CMakeLists.txt @@ -28,7 +28,6 @@ target_sources(${TEST_NAME} target_link_libraries(${TEST_NAME} PRIVATE - mbed-headers-base mbed-headers-events mbed-headers-hal mbed-headers-platform diff --git a/connectivity/lorawan/tests/UNITTESTS/features/lorawan/loraphycn779/CMakeLists.txt b/connectivity/lorawan/tests/UNITTESTS/features/lorawan/loraphycn779/CMakeLists.txt index 9265d163330..f039e1999b4 100644 --- a/connectivity/lorawan/tests/UNITTESTS/features/lorawan/loraphycn779/CMakeLists.txt +++ b/connectivity/lorawan/tests/UNITTESTS/features/lorawan/loraphycn779/CMakeLists.txt @@ -22,7 +22,6 @@ target_sources(${TEST_NAME} target_link_libraries(${TEST_NAME} PRIVATE - mbed-headers-base mbed-headers-events mbed-headers-hal mbed-headers-platform diff --git a/connectivity/lorawan/tests/UNITTESTS/features/lorawan/loraphyeu433/CMakeLists.txt b/connectivity/lorawan/tests/UNITTESTS/features/lorawan/loraphyeu433/CMakeLists.txt index 4d5186bda2c..f8ab984e561 100644 --- a/connectivity/lorawan/tests/UNITTESTS/features/lorawan/loraphyeu433/CMakeLists.txt +++ b/connectivity/lorawan/tests/UNITTESTS/features/lorawan/loraphyeu433/CMakeLists.txt @@ -22,7 +22,6 @@ target_sources(${TEST_NAME} target_link_libraries(${TEST_NAME} PRIVATE - mbed-headers-base mbed-headers-events mbed-headers-hal mbed-headers-platform diff --git a/connectivity/lorawan/tests/UNITTESTS/features/lorawan/loraphyeu868/CMakeLists.txt b/connectivity/lorawan/tests/UNITTESTS/features/lorawan/loraphyeu868/CMakeLists.txt index 91f9619dbe1..740d320f562 100644 --- a/connectivity/lorawan/tests/UNITTESTS/features/lorawan/loraphyeu868/CMakeLists.txt +++ b/connectivity/lorawan/tests/UNITTESTS/features/lorawan/loraphyeu868/CMakeLists.txt @@ -22,7 +22,6 @@ target_sources(${TEST_NAME} target_link_libraries(${TEST_NAME} PRIVATE - mbed-headers-base mbed-headers-events mbed-headers-hal mbed-headers-platform diff --git a/connectivity/lorawan/tests/UNITTESTS/features/lorawan/loraphyin865/CMakeLists.txt b/connectivity/lorawan/tests/UNITTESTS/features/lorawan/loraphyin865/CMakeLists.txt index 70c57d1b157..713f5528f64 100644 --- a/connectivity/lorawan/tests/UNITTESTS/features/lorawan/loraphyin865/CMakeLists.txt +++ b/connectivity/lorawan/tests/UNITTESTS/features/lorawan/loraphyin865/CMakeLists.txt @@ -22,7 +22,6 @@ target_sources(${TEST_NAME} target_link_libraries(${TEST_NAME} PRIVATE - mbed-headers-base mbed-headers-events mbed-headers-hal mbed-headers-platform diff --git a/connectivity/lorawan/tests/UNITTESTS/features/lorawan/loraphykr920/CMakeLists.txt b/connectivity/lorawan/tests/UNITTESTS/features/lorawan/loraphykr920/CMakeLists.txt index e1a0c667a5d..7d53df5b3dc 100644 --- a/connectivity/lorawan/tests/UNITTESTS/features/lorawan/loraphykr920/CMakeLists.txt +++ b/connectivity/lorawan/tests/UNITTESTS/features/lorawan/loraphykr920/CMakeLists.txt @@ -22,7 +22,6 @@ target_sources(${TEST_NAME} target_link_libraries(${TEST_NAME} PRIVATE - mbed-headers-base mbed-headers-events mbed-headers-hal mbed-headers-platform diff --git a/connectivity/lorawan/tests/UNITTESTS/features/lorawan/loraphyus915/CMakeLists.txt b/connectivity/lorawan/tests/UNITTESTS/features/lorawan/loraphyus915/CMakeLists.txt index 8d76584eee2..a9df57efc91 100644 --- a/connectivity/lorawan/tests/UNITTESTS/features/lorawan/loraphyus915/CMakeLists.txt +++ b/connectivity/lorawan/tests/UNITTESTS/features/lorawan/loraphyus915/CMakeLists.txt @@ -28,7 +28,6 @@ target_sources(${TEST_NAME} target_link_libraries(${TEST_NAME} PRIVATE - mbed-headers-base mbed-headers-events mbed-headers-hal mbed-headers-platform diff --git a/connectivity/lorawan/tests/UNITTESTS/features/lorawan/lorawaninterface/CMakeLists.txt b/connectivity/lorawan/tests/UNITTESTS/features/lorawan/lorawaninterface/CMakeLists.txt index edc435f357e..20594a83139 100644 --- a/connectivity/lorawan/tests/UNITTESTS/features/lorawan/lorawaninterface/CMakeLists.txt +++ b/connectivity/lorawan/tests/UNITTESTS/features/lorawan/lorawaninterface/CMakeLists.txt @@ -21,7 +21,6 @@ target_sources(${TEST_NAME} target_link_libraries(${TEST_NAME} PRIVATE - mbed-headers-base mbed-headers-events mbed-headers-hal mbed-headers-platform diff --git a/connectivity/lorawan/tests/UNITTESTS/features/lorawan/lorawanstack/CMakeLists.txt b/connectivity/lorawan/tests/UNITTESTS/features/lorawan/lorawanstack/CMakeLists.txt index 9e5f201b628..9c23ea676b8 100644 --- a/connectivity/lorawan/tests/UNITTESTS/features/lorawan/lorawanstack/CMakeLists.txt +++ b/connectivity/lorawan/tests/UNITTESTS/features/lorawan/lorawanstack/CMakeLists.txt @@ -22,7 +22,6 @@ target_sources(${TEST_NAME} target_link_libraries(${TEST_NAME} PRIVATE - mbed-headers-base mbed-headers-events mbed-headers-hal mbed-headers-platform diff --git a/connectivity/lorawan/tests/UNITTESTS/features/lorawan/lorawantimer/CMakeLists.txt b/connectivity/lorawan/tests/UNITTESTS/features/lorawan/lorawantimer/CMakeLists.txt index 512dd866bb7..5c7e8a5e708 100644 --- a/connectivity/lorawan/tests/UNITTESTS/features/lorawan/lorawantimer/CMakeLists.txt +++ b/connectivity/lorawan/tests/UNITTESTS/features/lorawan/lorawantimer/CMakeLists.txt @@ -21,7 +21,6 @@ target_sources(${TEST_NAME} target_link_libraries(${TEST_NAME} PRIVATE - mbed-headers-base mbed-headers-events mbed-headers-platform mbed-headers-lorawan diff --git a/drivers/tests/UNITTESTS/PwmOut/CMakeLists.txt b/drivers/tests/UNITTESTS/PwmOut/CMakeLists.txt index d459df365e7..daa6c196432 100644 --- a/drivers/tests/UNITTESTS/PwmOut/CMakeLists.txt +++ b/drivers/tests/UNITTESTS/PwmOut/CMakeLists.txt @@ -20,7 +20,6 @@ target_sources(${TEST_NAME} target_link_libraries(${TEST_NAME} PRIVATE - mbed-headers-base mbed-headers-platform mbed-headers-hal mbed-headers-drivers diff --git a/drivers/tests/UNITTESTS/Watchdog/CMakeLists.txt b/drivers/tests/UNITTESTS/Watchdog/CMakeLists.txt index 4f652e87f26..8e3fa8420f5 100644 --- a/drivers/tests/UNITTESTS/Watchdog/CMakeLists.txt +++ b/drivers/tests/UNITTESTS/Watchdog/CMakeLists.txt @@ -21,7 +21,6 @@ target_sources(${TEST_NAME} target_link_libraries(${TEST_NAME} PRIVATE - mbed-headers-base mbed-headers-hal mbed-headers-drivers mbed-headers-platform diff --git a/drivers/tests/UNITTESTS/doubles/CMakeLists.txt b/drivers/tests/UNITTESTS/doubles/CMakeLists.txt index cb648500945..042d02c8b3a 100644 --- a/drivers/tests/UNITTESTS/doubles/CMakeLists.txt +++ b/drivers/tests/UNITTESTS/doubles/CMakeLists.txt @@ -28,7 +28,6 @@ target_compile_definitions(mbed-stubs-drivers target_link_libraries(mbed-stubs-drivers PRIVATE - mbed-headers-base mbed-headers-hal mbed-headers-drivers mbed-headers-platform diff --git a/events/tests/UNITTESTS/doubles/CMakeLists.txt b/events/tests/UNITTESTS/doubles/CMakeLists.txt index 1569b6edb47..c936d0ddbd9 100644 --- a/events/tests/UNITTESTS/doubles/CMakeLists.txt +++ b/events/tests/UNITTESTS/doubles/CMakeLists.txt @@ -32,7 +32,6 @@ target_include_directories(mbed-stubs-events target_link_libraries(mbed-stubs-events PRIVATE - mbed-headers-base mbed-headers-drivers mbed-headers-hal mbed-headers-events diff --git a/events/tests/UNITTESTS/equeue/CMakeLists.txt b/events/tests/UNITTESTS/equeue/CMakeLists.txt index 230afbcc175..c7df99e0958 100644 --- a/events/tests/UNITTESTS/equeue/CMakeLists.txt +++ b/events/tests/UNITTESTS/equeue/CMakeLists.txt @@ -25,7 +25,6 @@ target_sources(${TEST_NAME} target_link_libraries(${TEST_NAME} PRIVATE - mbed-headers-base mbed-headers-platform mbed-headers-events mbed-stubs-events diff --git a/hal/tests/UNITTESTS/doubles/CMakeLists.txt b/hal/tests/UNITTESTS/doubles/CMakeLists.txt index f82ceb58c97..896617bc249 100644 --- a/hal/tests/UNITTESTS/doubles/CMakeLists.txt +++ b/hal/tests/UNITTESTS/doubles/CMakeLists.txt @@ -28,7 +28,6 @@ target_sources(mbed-stubs-hal target_link_libraries(mbed-stubs-hal PRIVATE - mbed-headers-base mbed-headers-hal mbed-headers-platform mbed-stubs-headers diff --git a/platform/tests/UNITTESTS/doubles/CMakeLists.txt b/platform/tests/UNITTESTS/doubles/CMakeLists.txt index 8d14bfcd469..827466bc22d 100644 --- a/platform/tests/UNITTESTS/doubles/CMakeLists.txt +++ b/platform/tests/UNITTESTS/doubles/CMakeLists.txt @@ -39,7 +39,6 @@ target_include_directories(mbed-stubs-platform ) target_link_libraries(mbed-stubs-platform PUBLIC - mbed-headers-base mbed-headers-hal mbed-headers-platform gmock_main diff --git a/rtos/tests/UNITTESTS/doubles/CMakeLists.txt b/rtos/tests/UNITTESTS/doubles/CMakeLists.txt index ed8440daec8..70d414edc21 100644 --- a/rtos/tests/UNITTESTS/doubles/CMakeLists.txt +++ b/rtos/tests/UNITTESTS/doubles/CMakeLists.txt @@ -36,7 +36,6 @@ target_sources(mbed-stubs-rtos target_link_libraries(mbed-stubs-rtos PRIVATE - mbed-headers-base mbed-headers-rtos mbed-headers-platform mbed-headers-drivers diff --git a/storage/blockdevice/tests/UNITTESTS/SFDP/CMakeLists.txt b/storage/blockdevice/tests/UNITTESTS/SFDP/CMakeLists.txt index 0d14cbb2871..a90346e781b 100644 --- a/storage/blockdevice/tests/UNITTESTS/SFDP/CMakeLists.txt +++ b/storage/blockdevice/tests/UNITTESTS/SFDP/CMakeLists.txt @@ -20,7 +20,6 @@ target_sources(${TEST_NAME} target_link_libraries(${TEST_NAME} PRIVATE - mbed-headers-base mbed-headers-blockdevice mbed-headers-platform mbed-stubs-platform diff --git a/storage/blockdevice/tests/UNITTESTS/blockdevice/BufferedBlockDevice/CMakeLists.txt b/storage/blockdevice/tests/UNITTESTS/blockdevice/BufferedBlockDevice/CMakeLists.txt index 83e32eaa47a..282e2ac887a 100644 --- a/storage/blockdevice/tests/UNITTESTS/blockdevice/BufferedBlockDevice/CMakeLists.txt +++ b/storage/blockdevice/tests/UNITTESTS/blockdevice/BufferedBlockDevice/CMakeLists.txt @@ -13,7 +13,6 @@ target_sources(${TEST_NAME} target_link_libraries(${TEST_NAME} PRIVATE - mbed-headers-base mbed-headers-blockdevice mbed-headers-platform mbed-stubs-headers diff --git a/storage/blockdevice/tests/UNITTESTS/blockdevice/ChainingBlockDevice/CMakeLists.txt b/storage/blockdevice/tests/UNITTESTS/blockdevice/ChainingBlockDevice/CMakeLists.txt index 82605991c7a..61cc97aa731 100644 --- a/storage/blockdevice/tests/UNITTESTS/blockdevice/ChainingBlockDevice/CMakeLists.txt +++ b/storage/blockdevice/tests/UNITTESTS/blockdevice/ChainingBlockDevice/CMakeLists.txt @@ -15,7 +15,6 @@ target_sources(${TEST_NAME} target_link_libraries(${TEST_NAME} PRIVATE - mbed-headers-base mbed-headers-blockdevice mbed-headers-platform mbed-stubs-headers diff --git a/storage/blockdevice/tests/UNITTESTS/blockdevice/ExhaustibleBlockDevice/CMakeLists.txt b/storage/blockdevice/tests/UNITTESTS/blockdevice/ExhaustibleBlockDevice/CMakeLists.txt index d5f019b99a4..0b26310fdec 100644 --- a/storage/blockdevice/tests/UNITTESTS/blockdevice/ExhaustibleBlockDevice/CMakeLists.txt +++ b/storage/blockdevice/tests/UNITTESTS/blockdevice/ExhaustibleBlockDevice/CMakeLists.txt @@ -13,7 +13,6 @@ target_sources(${TEST_NAME} target_link_libraries(${TEST_NAME} PRIVATE - mbed-headers-base mbed-headers-blockdevice mbed-headers-platform mbed-stubs-headers diff --git a/storage/blockdevice/tests/UNITTESTS/blockdevice/FlashSimBlockDevice/CMakeLists.txt b/storage/blockdevice/tests/UNITTESTS/blockdevice/FlashSimBlockDevice/CMakeLists.txt index f6f1383dbba..1465d5ee456 100644 --- a/storage/blockdevice/tests/UNITTESTS/blockdevice/FlashSimBlockDevice/CMakeLists.txt +++ b/storage/blockdevice/tests/UNITTESTS/blockdevice/FlashSimBlockDevice/CMakeLists.txt @@ -13,7 +13,6 @@ target_sources(${TEST_NAME} target_link_libraries(${TEST_NAME} PRIVATE - mbed-headers-base mbed-headers-blockdevice mbed-headers-platform mbed-stubs-headers diff --git a/storage/blockdevice/tests/UNITTESTS/blockdevice/HeapBlockDevice/CMakeLists.txt b/storage/blockdevice/tests/UNITTESTS/blockdevice/HeapBlockDevice/CMakeLists.txt index c965c065262..84e01fac0e8 100644 --- a/storage/blockdevice/tests/UNITTESTS/blockdevice/HeapBlockDevice/CMakeLists.txt +++ b/storage/blockdevice/tests/UNITTESTS/blockdevice/HeapBlockDevice/CMakeLists.txt @@ -13,7 +13,6 @@ target_sources(${TEST_NAME} target_link_libraries(${TEST_NAME} PRIVATE - mbed-headers-base mbed-headers-blockdevice mbed-headers-platform mbed-stubs-platform diff --git a/storage/blockdevice/tests/UNITTESTS/blockdevice/MBRBlockDevice/CMakeLists.txt b/storage/blockdevice/tests/UNITTESTS/blockdevice/MBRBlockDevice/CMakeLists.txt index fdddb9d803c..0847aff4410 100644 --- a/storage/blockdevice/tests/UNITTESTS/blockdevice/MBRBlockDevice/CMakeLists.txt +++ b/storage/blockdevice/tests/UNITTESTS/blockdevice/MBRBlockDevice/CMakeLists.txt @@ -13,7 +13,6 @@ target_sources(${TEST_NAME} target_link_libraries(${TEST_NAME} PRIVATE - mbed-headers-base mbed-headers-blockdevice mbed-headers-platform mbed-stubs-headers diff --git a/storage/blockdevice/tests/UNITTESTS/blockdevice/ObservingBlockDevice/CMakeLists.txt b/storage/blockdevice/tests/UNITTESTS/blockdevice/ObservingBlockDevice/CMakeLists.txt index 63d3c6f7d2d..f928ca4a0ee 100644 --- a/storage/blockdevice/tests/UNITTESTS/blockdevice/ObservingBlockDevice/CMakeLists.txt +++ b/storage/blockdevice/tests/UNITTESTS/blockdevice/ObservingBlockDevice/CMakeLists.txt @@ -14,7 +14,6 @@ target_sources(${TEST_NAME} target_link_libraries(${TEST_NAME} PRIVATE - mbed-headers-base mbed-headers-blockdevice mbed-headers-platform mbed-stubs-headers diff --git a/storage/blockdevice/tests/UNITTESTS/blockdevice/ProfilingBlockDevice/CMakeLists.txt b/storage/blockdevice/tests/UNITTESTS/blockdevice/ProfilingBlockDevice/CMakeLists.txt index 93ee6ee497c..6892156990f 100644 --- a/storage/blockdevice/tests/UNITTESTS/blockdevice/ProfilingBlockDevice/CMakeLists.txt +++ b/storage/blockdevice/tests/UNITTESTS/blockdevice/ProfilingBlockDevice/CMakeLists.txt @@ -13,7 +13,6 @@ target_sources(${TEST_NAME} target_link_libraries(${TEST_NAME} PRIVATE - mbed-headers-base mbed-headers-blockdevice mbed-headers-platform mbed-stubs-headers diff --git a/storage/blockdevice/tests/UNITTESTS/blockdevice/ReadOnlyBlockDevice/CMakeLists.txt b/storage/blockdevice/tests/UNITTESTS/blockdevice/ReadOnlyBlockDevice/CMakeLists.txt index 281d2be0ade..37484253d47 100644 --- a/storage/blockdevice/tests/UNITTESTS/blockdevice/ReadOnlyBlockDevice/CMakeLists.txt +++ b/storage/blockdevice/tests/UNITTESTS/blockdevice/ReadOnlyBlockDevice/CMakeLists.txt @@ -13,7 +13,6 @@ target_sources(${TEST_NAME} target_link_libraries(${TEST_NAME} PRIVATE - mbed-headers-base mbed-headers-blockdevice mbed-headers-platform mbed-stubs-headers diff --git a/storage/blockdevice/tests/UNITTESTS/blockdevice/SlicingBlockDevice/CMakeLists.txt b/storage/blockdevice/tests/UNITTESTS/blockdevice/SlicingBlockDevice/CMakeLists.txt index de7456a0b99..b8889404854 100644 --- a/storage/blockdevice/tests/UNITTESTS/blockdevice/SlicingBlockDevice/CMakeLists.txt +++ b/storage/blockdevice/tests/UNITTESTS/blockdevice/SlicingBlockDevice/CMakeLists.txt @@ -14,7 +14,6 @@ target_sources(${TEST_NAME} target_link_libraries(${TEST_NAME} PRIVATE - mbed-headers-base mbed-headers-blockdevice mbed-headers-platform mbed-stubs-platform diff --git a/storage/blockdevice/tests/UNITTESTS/doubles/CMakeLists.txt b/storage/blockdevice/tests/UNITTESTS/doubles/CMakeLists.txt index f322f98e23c..bd1295de6c8 100644 --- a/storage/blockdevice/tests/UNITTESTS/doubles/CMakeLists.txt +++ b/storage/blockdevice/tests/UNITTESTS/doubles/CMakeLists.txt @@ -32,7 +32,6 @@ target_sources(mbed-stubs-blockdevice target_link_libraries(mbed-stubs-blockdevice PRIVATE - mbed-headers-base mbed-headers-platform mbed-headers-blockdevice ) diff --git a/storage/kvstore/filesystemstore/tests/UNITTESTS/FileSystemStore/CMakeLists.txt b/storage/kvstore/filesystemstore/tests/UNITTESTS/FileSystemStore/CMakeLists.txt index ff75c746353..4898d1ece0f 100644 --- a/storage/kvstore/filesystemstore/tests/UNITTESTS/FileSystemStore/CMakeLists.txt +++ b/storage/kvstore/filesystemstore/tests/UNITTESTS/FileSystemStore/CMakeLists.txt @@ -33,7 +33,6 @@ target_sources(${TEST_NAME} target_link_libraries(${TEST_NAME} PRIVATE - mbed-headers-base mbed-headers-blockdevice mbed-headers-drivers mbed-headers-filesystem diff --git a/storage/kvstore/tdbstore/tests/UNITTESTS/TDBStore/CMakeLists.txt b/storage/kvstore/tdbstore/tests/UNITTESTS/TDBStore/CMakeLists.txt index 6f20ee14ded..41f711d1193 100644 --- a/storage/kvstore/tdbstore/tests/UNITTESTS/TDBStore/CMakeLists.txt +++ b/storage/kvstore/tdbstore/tests/UNITTESTS/TDBStore/CMakeLists.txt @@ -17,7 +17,6 @@ target_sources(${TEST_NAME} target_link_libraries(${TEST_NAME} PRIVATE - mbed-headers-base mbed-headers-blockdevice mbed-headers-drivers mbed-headers-hal From 578843067b8bb4650a1088f7da180cce89f90033 Mon Sep 17 00:00:00 2001 From: Lingkai Dong Date: Tue, 20 Jul 2021 12:53:25 +0100 Subject: [PATCH 16/17] Unit tests: Fix pin validation failure The test script pinvalidate.py requires the following which are missing in the unit test stub PinName.h: * A comment "MBED TARGET LIST" * `CONSOLE_TX` and `CONSOLE_RX` in the `PinName` enum This commit adds them. --- hal/tests/UNITTESTS/doubles/PinNames.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/hal/tests/UNITTESTS/doubles/PinNames.h b/hal/tests/UNITTESTS/doubles/PinNames.h index 92fa9fb635f..7ed12ff70a7 100644 --- a/hal/tests/UNITTESTS/doubles/PinNames.h +++ b/hal/tests/UNITTESTS/doubles/PinNames.h @@ -15,6 +15,8 @@ * limitations under the License. */ +/* MBED TARGET LIST: UNITTESTS */ + #ifndef MBED_PINNAMES_H #define MBED_PINNAMES_H @@ -30,6 +32,11 @@ typedef enum { typedef enum { PTC0 = 0, PTC1 = 1, + + // USB Pins + CONSOLE_TX = 2, + CONSOLE_RX = 3, + NC = (int)0xFFFFFFFF } PinName; From 81eb6cb85568f3a246ca1cdc9dbdaeff15e0f7b6 Mon Sep 17 00:00:00 2001 From: Lingkai Dong Date: Tue, 20 Jul 2021 13:08:41 +0100 Subject: [PATCH 17/17] Travis: Enable maximum verbosity of pinvalidate.py Run pinvalidate.py with -vvv to print the cause of failure, making it easier for authors of pull requests to fix pin names. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 30f38ab7e3b..57c8c2be2b4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -244,7 +244,7 @@ matrix: - >- git diff --name-only --diff-filter=d FETCH_HEAD..HEAD \ | ( grep '.*[\\|\/]PinNames.h$' || true ) \ - | while read file; do python ./hal/tests/pinvalidate/pinvalidate.py -vfp "${file}"; done + | while read file; do python ./hal/tests/pinvalidate/pinvalidate.py -vvvfp "${file}"; done - git diff --exit-code --diff-filter=d --color ### CMake Check ###