Skip to content

Commit 63cc134

Browse files
committed
CMake: Move connectivity/cellular stubs to the mbed-os/connectivity/cellular dir
Move the connectivity cellular into the connectivity/cellular component directory. So we can avoid duplicating the mbed-os source tree in a central UNITTESTS folder.
1 parent de7e326 commit 63cc134

File tree

26 files changed

+53
-16
lines changed

26 files changed

+53
-16
lines changed

UNITTESTS/stubs/connectivity/CMakeLists.txt

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ target_compile_definitions(mbed-stubs-connectivity
77
PRIVATE
88
DEVICE_SERIAL=1
99
DEVICE_INTERRUPTIN=1
10-
MBED_CONF_CELLULAR_USE_SMS=1
11-
MBED_CONF_NSAPI_DEFAULT_CELLULAR_APN=NULL
1210
MBED_CONF_PLATFORM_DEFAULT_SERIAL_BAUD_RATE=115200
1311
MBED_CONF_LORA_OVER_THE_AIR_ACTIVATION=true
1412
MBED_CONF_LORA_AUTOMATIC_UPLINK_MESSAGE=true
@@ -20,19 +18,7 @@ target_compile_definitions(mbed-stubs-connectivity
2018
target_sources(mbed-stubs-connectivity
2119
PRIVATE
2220
aes_stub.c
23-
AT_CellularContext_stub.cpp
24-
AT_CellularDevice_stub.cpp
25-
AT_CellularInformation_stub.cpp
26-
AT_CellularNetwork_stub.cpp
27-
AT_CellularSMS_stub.cpp
28-
AT_CellularStack_stub.cpp
29-
AT_ControlPlane_netif_stub.cpp
30-
ATHandler_stub.cpp
31-
CellularContext_stub.cpp
32-
CellularDevice_stub.cpp
3321
CellularInterface_stub.cpp
34-
CellularStateMachine_stub.cpp
35-
CellularUtil_stub.cpp
3622
cipher_stub.c
3723
cmac_stub.c
3824
ip4tos_stub.c
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# Copyright (c) 2021 ARM Limited. All rights reserved.
22
# SPDX-License-Identifier: Apache-2.0
33

4+
add_subdirectory(doubles)
45
add_subdirectory(framework)

UNITTESTS/stubs/connectivity/AT_CellularContext_stub.cpp renamed to connectivity/cellular/tests/UNITTESTS/doubles/AT_CellularContext_stub.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,8 @@ bool AT_CellularContext::get_context()
171171
return true;
172172
}
173173

174-
const char* AT_CellularContext::get_nonip_context_type_str() {
174+
const char *AT_CellularContext::get_nonip_context_type_str()
175+
{
175176
return "Non-IP";
176177
}
177178

UNITTESTS/stubs/connectivity/AT_CellularStack_stub.cpp renamed to connectivity/cellular/tests/UNITTESTS/doubles/AT_CellularStack_stub.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ AT_CellularStack::~AT_CellularStack()
3131
{
3232
}
3333

34-
nsapi_error_t AT_CellularStack::get_ip_address(SocketAddress* address)
34+
nsapi_error_t AT_CellularStack::get_ip_address(SocketAddress *address)
3535
{
3636
return NSAPI_ERROR_UNSUPPORTED;
3737
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Copyright (c) 2021 ARM Limited. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
add_library(mbed-stubs-cellular)
5+
6+
target_compile_definitions(mbed-stubs-cellular
7+
PRIVATE
8+
DEVICE_SERIAL=1
9+
DEVICE_INTERRUPTIN=1
10+
MBED_CONF_CELLULAR_USE_SMS=1
11+
MBED_CONF_NSAPI_DEFAULT_CELLULAR_APN=NULL
12+
MBED_CONF_PLATFORM_DEFAULT_SERIAL_BAUD_RATE=115200
13+
MDMTXD=NC
14+
MDMRXD=NC
15+
)
16+
17+
target_sources(mbed-stubs-cellular
18+
PRIVATE
19+
AT_CellularContext_stub.cpp
20+
AT_CellularDevice_stub.cpp
21+
AT_CellularInformation_stub.cpp
22+
AT_CellularNetwork_stub.cpp
23+
AT_CellularSMS_stub.cpp
24+
AT_CellularStack_stub.cpp
25+
AT_ControlPlane_netif_stub.cpp
26+
ATHandler_stub.cpp
27+
CellularContext_stub.cpp
28+
CellularDevice_stub.cpp
29+
CellularStateMachine_stub.cpp
30+
CellularUtil_stub.cpp
31+
)
32+
33+
target_link_libraries(mbed-stubs-cellular
34+
PRIVATE
35+
mbed-headers
36+
mbed-stubs-headers
37+
gtest
38+
)

connectivity/cellular/tests/UNITTESTS/framework/AT/at_cellularcontext/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ target_link_libraries(${TEST_NAME}
2424
PRIVATE
2525
mbed-headers
2626
mbed-stubs
27+
mbed-stubs-cellular
2728
mbed-stubs-headers
2829
gmock_main
2930
)

connectivity/cellular/tests/UNITTESTS/framework/AT/at_cellulardevice/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ target_link_libraries(${TEST_NAME}
3030
PRIVATE
3131
mbed-headers
3232
mbed-stubs
33+
mbed-stubs-cellular
3334
mbed-stubs-headers
3435
gmock_main
3536
)

connectivity/cellular/tests/UNITTESTS/framework/AT/at_cellularinformation/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
PRIVATE
2323
mbed-headers
2424
mbed-stubs
25+
mbed-stubs-cellular
2526
mbed-stubs-headers
2627
gmock_main
2728
)

connectivity/cellular/tests/UNITTESTS/framework/AT/at_cellularnetwork/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ target_link_libraries(${TEST_NAME}
2323
PRIVATE
2424
mbed-headers
2525
mbed-stubs
26+
mbed-stubs-cellular
2627
mbed-stubs-headers
2728
gmock_main
2829
)

connectivity/cellular/tests/UNITTESTS/framework/AT/at_cellularsms/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ target_link_libraries(${TEST_NAME}
2323
PRIVATE
2424
mbed-headers
2525
mbed-stubs
26+
mbed-stubs-cellular
2627
mbed-stubs-headers
2728
gmock_main
2829
)

connectivity/cellular/tests/UNITTESTS/framework/AT/at_cellularstack/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ target_link_libraries(${TEST_NAME}
2828
PRIVATE
2929
mbed-headers
3030
mbed-stubs
31+
mbed-stubs-cellular
3132
mbed-stubs-headers
3233
gmock_main
3334
)

connectivity/cellular/tests/UNITTESTS/framework/device/athandler/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ target_link_libraries(${TEST_NAME}
2424
PRIVATE
2525
mbed-headers
2626
mbed-stubs
27+
mbed-stubs-cellular
2728
mbed-stubs-headers
2829
gmock_main
2930
)

connectivity/cellular/tests/UNITTESTS/framework/device/cellularcontext/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ target_link_libraries(${TEST_NAME}
3636
PRIVATE
3737
mbed-headers
3838
mbed-stubs
39+
mbed-stubs-cellular
3940
mbed-stubs-headers
4041
gmock_main
4142
)

connectivity/cellular/tests/UNITTESTS/framework/device/cellulardevice/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ target_link_libraries(${TEST_NAME}
2828
PRIVATE
2929
mbed-headers
3030
mbed-stubs
31+
mbed-stubs-cellular
3132
mbed-stubs-headers
3233
gmock_main
3334
)

connectivity/cellular/tests/UNITTESTS/framework/device/cellularstatemachine/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ target_link_libraries(${TEST_NAME}
2929
PRIVATE
3030
mbed-headers
3131
mbed-stubs
32+
mbed-stubs-cellular
3233
mbed-stubs-headers
3334
gmock_main
3435
)

connectivity/netsocket/tests/UNITTESTS/netsocket/CellularNonIPSocket/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ target_link_libraries(${TEST_NAME}
2424
PRIVATE
2525
mbed-headers
2626
mbed-stubs
27+
mbed-stubs-cellular
2728
mbed-stubs-headers
2829
gmock_main
2930
)

0 commit comments

Comments
 (0)