Skip to content

Commit fa0ab53

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 8902a0c commit fa0ab53

File tree

26 files changed

+54
-16
lines changed

26 files changed

+54
-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
@@ -21,19 +19,7 @@ target_compile_definitions(mbed-stubs-connectivity
2119
target_sources(mbed-stubs-connectivity
2220
PRIVATE
2321
aes_stub.c
24-
AT_CellularContext_stub.cpp
25-
AT_CellularDevice_stub.cpp
26-
AT_CellularInformation_stub.cpp
27-
AT_CellularNetwork_stub.cpp
28-
AT_CellularSMS_stub.cpp
29-
AT_CellularStack_stub.cpp
30-
AT_ControlPlane_netif_stub.cpp
31-
ATHandler_stub.cpp
32-
CellularContext_stub.cpp
33-
CellularDevice_stub.cpp
3422
CellularInterface_stub.cpp
35-
CellularStateMachine_stub.cpp
36-
CellularUtil_stub.cpp
3723
cipher_stub.c
3824
cmac_stub.c
3925
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: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
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+
MBED_CONF_CELLULAR_AT_HANDLER_BUFFER_SIZE=32
14+
MDMTXD=NC
15+
MDMRXD=NC
16+
)
17+
18+
target_sources(mbed-stubs-cellular
19+
PRIVATE
20+
AT_CellularContext_stub.cpp
21+
AT_CellularDevice_stub.cpp
22+
AT_CellularInformation_stub.cpp
23+
AT_CellularNetwork_stub.cpp
24+
AT_CellularSMS_stub.cpp
25+
AT_CellularStack_stub.cpp
26+
AT_ControlPlane_netif_stub.cpp
27+
ATHandler_stub.cpp
28+
CellularContext_stub.cpp
29+
CellularDevice_stub.cpp
30+
CellularStateMachine_stub.cpp
31+
CellularUtil_stub.cpp
32+
)
33+
34+
target_link_libraries(mbed-stubs-cellular
35+
PRIVATE
36+
mbed-headers
37+
mbed-stubs-headers
38+
gtest
39+
)

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ target_link_libraries(${TEST_NAME}
2525
PRIVATE
2626
mbed-headers
2727
mbed-stubs
28+
mbed-stubs-cellular
2829
mbed-stubs-headers
2930
mbed-stubs-rtos-headers
3031
gmock_main

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ target_link_libraries(${TEST_NAME}
3131
PRIVATE
3232
mbed-headers
3333
mbed-stubs
34+
mbed-stubs-cellular
3435
mbed-stubs-headers
3536
mbed-stubs-rtos
3637
gmock_main

connectivity/cellular/tests/UNITTESTS/framework/AT/at_cellularinformation/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_cellularnetwork/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_cellularsms/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_cellularstack/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
mbed-stubs-rtos-headers
3435
gmock_main

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

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

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

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

connectivity/cellular/tests/UNITTESTS/framework/device/cellulardevice/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/cellular/tests/UNITTESTS/framework/device/cellularstatemachine/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
mbed-stubs-rtos-headers
3536
gmock_main

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)