Skip to content

Commit 50e23b7

Browse files
authored
Merge pull request #14765 from rwalton-arm/fix_unittest_check
Fix unittest check
2 parents 3964478 + a0befae commit 50e23b7

File tree

13 files changed

+25
-24
lines changed

13 files changed

+25
-24
lines changed

CMakeLists.txt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ endif()
1313
project(mbed-os)
1414

1515
# Add all paths to the list files within Mbed OS
16-
list(APPEND CMAKE_MODULE_PATH
16+
list(APPEND CMAKE_MODULE_PATH
1717
"${mbed-os_SOURCE_DIR}/platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_TFM/TARGET_TFM_LATEST/scripts;${mbed-os_SOURCE_DIR}/targets/TARGET_Cypress/scripts;${mbed-os_SOURCE_DIR}/targets/TARGET_NXP/scripts"
1818
)
1919

2020
option(BUILD_TESTING "Run unit tests only." OFF)
2121

2222
if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME AND BUILD_TESTING)
23-
include(CTest)
23+
include(CTest)
2424
add_subdirectory(UNITTESTS)
2525
endif()
2626

@@ -68,19 +68,19 @@ if(${CMAKE_CROSSCOMPILING})
6868
"Invalid printf library type '${MBED_PRINTF_LIB}'. Possible values:\n ${MBED_PRINTF_LIB_TYPES}"
6969
)
7070
endif()
71-
71+
7272
mbed_set_cpu_core_definitions(mbed-core)
7373
if(${MBED_TOOLCHAIN_FILE_USED})
7474
mbed_set_profile_options(mbed-core ${MBED_TOOLCHAIN})
7575
mbed_set_c_lib(mbed-core ${MBED_C_LIB})
7676
mbed_set_printf_lib(mbed-core ${MBED_PRINTF_LIB})
77-
77+
7878
target_compile_features(mbed-core
7979
INTERFACE
8080
c_std_11
8181
cxx_std_14
8282
)
83-
83+
8484
endif()
8585

8686
target_compile_definitions(mbed-core
@@ -98,7 +98,7 @@ if(${CMAKE_CROSSCOMPILING})
9898
endif()
9999

100100
# We need to generate a "response file" to pass to the C preprocessor when we preprocess the linker
101-
# script, because of path le ngth limitations on Windows. We set the response file and bind the path
101+
# script, because of path length limitations on Windows. We set the response file and bind the path
102102
# to a global property here. The MBED_TARGET being built queries this global property when it sets
103103
# the linker script.
104104
#
@@ -110,7 +110,7 @@ if(${CMAKE_CROSSCOMPILING})
110110
# using response files or global properties.
111111
mbed_generate_options_for_linker(mbed-core RESPONSE_FILE_PATH)
112112
set_property(GLOBAL PROPERTY COMPILE_DEFS_RESPONSE_FILE ${RESPONSE_FILE_PATH})
113-
113+
114114
# Add compile definitions for backward compatibility with the toolchain
115115
# supported. New source files should instead check for __GNUC__ and __clang__
116116
# for the GCC_ARM and ARM toolchains respectively.
@@ -164,7 +164,7 @@ if(${CMAKE_CROSSCOMPILING})
164164
string(TOLOWER ${MBED_TARGET} MBED_TARGET_CONVERTED)
165165
string(REPLACE "_" "-" MBED_TARGET_CONVERTED ${MBED_TARGET_CONVERTED})
166166
string(PREPEND MBED_TARGET_CONVERTED "mbed-")
167-
167+
168168
target_link_libraries(mbed-core INTERFACE ${MBED_TARGET_CONVERTED})
169169
endif()
170170

UNITTESTS/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ include(FetchContent)
1919
# Download and unpack googletest
2020
FetchContent_Declare(googletest
2121
GIT_REPOSITORY https://github.com/google/googletest.git
22-
GIT_TAG release-1.10.0
22+
GIT_TAG master
2323
)
2424
FetchContent_MakeAvailable(googletest)
2525

UNITTESTS/stubs/CMakeLists.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,13 @@ target_include_directories(mbed-headers-base
4545
)
4646

4747
target_include_directories(mbed-headers-storage
48-
INTERFACE
48+
INTERFACE
4949
${mbed-os_SOURCE_DIR}/storage/filesystem/fat/include
5050
${mbed-os_SOURCE_DIR}/storage/filesystem/fat/ChaN
5151
${mbed-os_SOURCE_DIR}/storage/filesystem/littlefs
5252
${mbed-os_SOURCE_DIR}/storage/filesystem/littlefs/include
5353
${mbed-os_SOURCE_DIR}/storage/filesystem/littlefsv2/littlefs
54-
${mbed-os_SOURCE_DIR}/storage/filesystem/littlefsv2/littlefs/bd
54+
${mbed-os_SOURCE_DIR}/storage/filesystem/littlefsv2/littlefs/bd
5555
${mbed-os_SOURCE_DIR}/storage/filesystem/littlefs/littlefs
5656
${mbed-os_SOURCE_DIR}/storage/blockdevice/include
5757
${mbed-os_SOURCE_DIR}/storage/filesystem/include
@@ -91,7 +91,7 @@ target_include_directories(mbed-headers-drivers
9191
INTERFACE
9292
${mbed-os_SOURCE_DIR}/drivers
9393
${mbed-os_SOURCE_DIR}/drivers/include
94-
${mbed-os_SOURCE_DIR}/drivers/include/drivers
94+
${mbed-os_SOURCE_DIR}/drivers/include/drivers
9595
)
9696

9797
target_include_directories(mbed-headers-events
@@ -100,7 +100,7 @@ target_include_directories(mbed-headers-events
100100
${mbed-os_SOURCE_DIR}/events/tests/UNITTESTS/target_h/equeue
101101
${mbed-os_SOURCE_DIR}/events/include
102102
${mbed-os_SOURCE_DIR}/events/include/events
103-
${mbed-os_SOURCE_DIR}/events/include/events/internal
103+
${mbed-os_SOURCE_DIR}/events/include/events/internal
104104
)
105105

106106
target_include_directories(mbed-headers-hal

connectivity/cellular/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Copyright (c) 2020 ARM Limited. All rights reserved.
22
# SPDX-License-Identifier: Apache-2.0
33

4-
if(NOT ${CMAKE_CROSSCOMPILING})
4+
if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME AND BUILD_TESTING)
55
add_subdirectory(tests/UNITTESTS)
66
endif()
77

connectivity/lorawan/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Copyright (c) 2020 ARM Limited. All rights reserved.
22
# SPDX-License-Identifier: Apache-2.0
33

4-
if(NOT ${CMAKE_CROSSCOMPILING})
4+
if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME AND BUILD_TESTING)
55
add_subdirectory(tests/UNITTESTS)
66
endif()
77

connectivity/netsocket/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Copyright (c) 2020 ARM Limited. All rights reserved.
22
# SPDX-License-Identifier: Apache-2.0
33

4-
if(NOT ${CMAKE_CROSSCOMPILING})
4+
if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME AND BUILD_TESTING)
55
add_subdirectory(tests/UNITTESTS)
66
endif()
77

drivers/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Copyright (c) 2020 ARM Limited. All rights reserved.
22
# SPDX-License-Identifier: Apache-2.0
33

4-
if(NOT ${CMAKE_CROSSCOMPILING})
4+
if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME AND BUILD_TESTING)
55
add_subdirectory(tests/UNITTESTS)
66
endif()
77

events/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
# Copyright (c) 2020 ARM Limited. All rights reserved.
22
# SPDX-License-Identifier: Apache-2.0
33

4-
if(NOT ${CMAKE_CROSSCOMPILING})
4+
if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME AND BUILD_TESTING)
55
add_subdirectory(tests/UNITTESTS)
66
else()
7+
78
add_library(mbed-events INTERFACE)
89

910
target_include_directories(mbed-events

platform/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Copyright (c) 2020 ARM Limited. All rights reserved.
22
# SPDX-License-Identifier: Apache-2.0
33

4-
if(NOT ${CMAKE_CROSSCOMPILING})
4+
if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME AND BUILD_TESTING)
55
add_subdirectory(tests/UNITTESTS)
66
endif()
77

platform/tests/UNITTESTS/ATCmdParser/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ target_sources(${TEST_NAME}
1414
target_link_libraries(${TEST_NAME}
1515
PRIVATE
1616
mbed-headers
17-
mbed-stubs-headers
18-
mbed-stubs-platform
17+
mbed-stubs-headers
18+
mbed-stubs-platform
1919
gmock_main
2020
)
2121

storage/blockdevice/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Copyright (c) 2020 ARM Limited. All rights reserved.
22
# SPDX-License-Identifier: Apache-2.0
33

4-
if(NOT ${CMAKE_CROSSCOMPILING})
4+
if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME AND BUILD_TESTING)
55
add_subdirectory(tests/UNITTESTS)
66
endif()
77

storage/kvstore/filesystemstore/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Copyright (c) 2020 ARM Limited. All rights reserved.
22
# SPDX-License-Identifier: Apache-2.0
33

4-
if(NOT ${CMAKE_CROSSCOMPILING})
4+
if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME AND BUILD_TESTING)
55
add_subdirectory(tests/UNITTESTS)
66
endif()
77

storage/kvstore/tdbstore/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Copyright (c) 2020 ARM Limited. All rights reserved.
22
# SPDX-License-Identifier: Apache-2.0
33

4-
if(NOT ${CMAKE_CROSSCOMPILING})
4+
if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME AND BUILD_TESTING)
55
add_subdirectory(tests/UNITTESTS)
66
endif()
77

0 commit comments

Comments
 (0)