Skip to content

Commit 66019cb

Browse files
committed
CMake: Move mbedtls stubs to the mbedtls dir
Move the connectivity mbedtls stubs into the connectivity/mbedtls component directory. So we can avoid duplicating the mbed-os source tree in a central UNITTESTS folder.
1 parent 3c2c5be commit 66019cb

File tree

14 files changed

+34
-4
lines changed

14 files changed

+34
-4
lines changed

UNITTESTS/stubs/connectivity/CMakeLists.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,8 @@ target_compile_definitions(mbed-stubs-connectivity
1818

1919
target_sources(mbed-stubs-connectivity
2020
PRIVATE
21-
aes_stub.c
22-
cipher_stub.c
23-
cmac_stub.c
2421
ip4tos_stub.c
2522
stoip4_stub.c
26-
${mbed-os_SOURCE_DIR}/connectivity/nanostack/coap-service/test/coap-service/unittest/stub/mbedtls_stub.c
2723
)
2824

2925
target_link_libraries(mbed-stubs-connectivity

connectivity/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,5 @@ else()
4141
add_subdirectory(cellular)
4242
add_subdirectory(lorawan)
4343
add_subdirectory(netsocket)
44+
add_subdirectory(mbedtls)
4445
endif()

connectivity/lorawan/tests/UNITTESTS/features/lorawan/loramaccrypto/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ target_link_libraries(${TEST_NAME}
2222
mbed-headers-lorawan
2323
mbed-stubs
2424
mbed-stubs-headers
25+
mbed-stubs-mbedtls
2526
gmock_main
2627
)
2728

connectivity/mbedtls/CMakeLists.txt

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

4+
if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME AND BUILD_TESTING)
5+
add_subdirectory(tests/UNITTESTS)
6+
endif()
7+
48
target_include_directories(mbed-mbedtls
59
INTERFACE
610
.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Copyright (c) 2021 ARM Limited. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
add_subdirectory(doubles)
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Copyright (c) 2021 ARM Limited. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
add_library(mbed-stubs-mbedtls)
5+
6+
target_sources(mbed-stubs-mbedtls
7+
PRIVATE
8+
aes_stub.c
9+
cipher_stub.c
10+
cmac_stub.c
11+
${mbed-os_SOURCE_DIR}/connectivity/nanostack/coap-service/test/coap-service/unittest/stub/mbedtls_stub.c
12+
)
13+
14+
target_link_libraries(mbed-stubs-mbedtls
15+
PRIVATE
16+
mbed-headers
17+
mbed-stubs-headers
18+
mbed-stubs-rtos
19+
gtest
20+
)

0 commit comments

Comments
 (0)