Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMake: Add CMake to mbed-psa greentea tests #14828

Merged
merged 11 commits into from
Jun 29, 2021
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ include(${MBED_PATH}/tools/cmake/mbed_greentea.cmake)
project(${TEST_TARGET})

mbed_greentea_add_test(
TEST_NAME ${TEST_TARGET}
TEST_REQUIRED_LIBS mbed-ble mbed-events
TEST_NAME
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The style change - was it done by a tool or just follow CMake docs style?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was done to follow style pointers from Lingkai for previous commits

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Possibly a bit of an over-interpretation - is it best as it was?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the kind of indentation we have when calling a macro function with parameters, so it looks good to me. I guess what @0xc0170 means is whether it was done manually or by some tool, and the former is the case.

Copy link
Contributor

@rwalton-arm rwalton-arm Jun 29, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should set-up cmake-format as a pre-commit check and specify the style we want to use. It would be great to run the cmake-format check as part of the CI. That way we will auto-enforce the style and it will always be consistent. We can add a new issue to add cmake-format to the CI in a separate PR.

${TEST_TARGET}
TEST_SOURCES
main.cpp
TEST_REQUIRED_LIBS
mbed-ble
mbed-events
)
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ include(${MBED_PATH}/tools/cmake/mbed_greentea.cmake)
project(${TEST_TARGET})

mbed_greentea_add_test(
TEST_NAME ${TEST_TARGET}
TEST_REQUIRED_LIBS mbed-ble
TEST_NAME
${TEST_TARGET}
TEST_SOURCES
main.cpp
TEST_REQUIRED_LIBS
mbed-ble
)
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ include(${MBED_PATH}/tools/cmake/mbed_greentea.cmake)
project(${TEST_TARGET})

mbed_greentea_add_test(
TEST_NAME ${TEST_TARGET}
TEST_REQUIRED_LIBS mbed-lorawan
TEST_NAME
${TEST_TARGET}
TEST_SOURCES
main.cpp
TEST_REQUIRED_LIBS
mbed-lorawan
)
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ include(${MBED_PATH}/tools/cmake/mbed_greentea.cmake)
project(${TEST_TARGET})

mbed_greentea_add_test(
TEST_NAME ${TEST_TARGET}
TEST_NAME
${TEST_TARGET}
TEST_SOURCES
main.cpp
TEST_REQUIRED_LIBS
mbed-mbedtls
)
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ include(${MBED_PATH}/tools/cmake/mbed_greentea.cmake)
project(${TEST_TARGET})

mbed_greentea_add_test(
TEST_NAME ${TEST_TARGET}
TEST_NAME
${TEST_TARGET}
TEST_SOURCES
main.cpp
TEST_REQUIRED_LIBS
mbed-mbedtls
)
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ include(${MBED_PATH}/tools/cmake/mbed_greentea.cmake)
project(${TEST_TARGET})

mbed_greentea_add_test(
TEST_NAME ${TEST_TARGET}
TEST_NAME
${TEST_TARGET}
TEST_SOURCES
main.cpp
TEST_REQUIRED_LIBS
mbed-mbedtls
)
10 changes: 7 additions & 3 deletions connectivity/netsocket/tests/TESTS/netsocket/dns/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ project(${TEST_TARGET})
list(
APPEND
TEST_SOURCE_LIST
main.cpp
synchronous_dns_multiple.cpp
synchronous_dns_multi_ip.cpp
synchronous_dns_invalid.cpp
Expand All @@ -32,7 +33,10 @@ list(
)

mbed_greentea_add_test(
TEST_NAME ${TEST_TARGET}
TEST_SOURCES ${TEST_SOURCE_LIST}
TEST_REQUIRED_LIBS mbed-netsocket
TEST_NAME
${TEST_TARGET}
TEST_SOURCES
${TEST_SOURCE_LIST}
TEST_REQUIRED_LIBS
mbed-netsocket
)
10 changes: 7 additions & 3 deletions connectivity/netsocket/tests/TESTS/netsocket/nidd/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ project(${TEST_TARGET})
list(
APPEND
TEST_SOURCE_LIST
main.cpp
niddsocket_send_timeout.cpp
niddsocket_send_repeat.cpp
niddsocket_send_invalid.cpp
Expand All @@ -27,7 +28,10 @@ list(
)

mbed_greentea_add_test(
TEST_NAME ${TEST_TARGET}
TEST_SOURCES ${TEST_SOURCE_LIST}
TEST_REQUIRED_LIBS mbed-netsocket
TEST_NAME
${TEST_TARGET}
TEST_SOURCES
${TEST_SOURCE_LIST}
TEST_REQUIRED_LIBS
mbed-netsocket
)
10 changes: 7 additions & 3 deletions connectivity/netsocket/tests/TESTS/netsocket/tcp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ project(${TEST_TARGET})
list(
APPEND
TEST_SOURCE_LIST
main.cpp
tcpsocket_thread_per_socket_safety.cpp
tcpsocket_setsockopt_keepalive_valid.cpp
tcpsocket_send_timeout.cpp
Expand All @@ -36,7 +37,10 @@ list(
)

mbed_greentea_add_test(
TEST_NAME ${TEST_TARGET}
TEST_SOURCES ${TEST_SOURCE_LIST}
TEST_REQUIRED_LIBS mbed-netsocket
TEST_NAME
${TEST_TARGET}
TEST_SOURCES
${TEST_SOURCE_LIST}
TEST_REQUIRED_LIBS
mbed-netsocket
)
10 changes: 7 additions & 3 deletions connectivity/netsocket/tests/TESTS/netsocket/tls/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ project(${TEST_TARGET})
list(
APPEND
TEST_SOURCE_LIST
main.cpp
tlssocket_simultaneous.cpp
tlssocket_send_unconnected.cpp
tlssocket_send_timeout.cpp
Expand All @@ -31,7 +32,10 @@ list(
)

mbed_greentea_add_test(
TEST_NAME ${TEST_TARGET}
TEST_SOURCES ${TEST_SOURCE_LIST}
TEST_REQUIRED_LIBS mbed-netsocket
TEST_NAME
${TEST_TARGET}
TEST_SOURCES
${TEST_SOURCE_LIST}
TEST_REQUIRED_LIBS
mbed-netsocket
)
10 changes: 7 additions & 3 deletions connectivity/netsocket/tests/TESTS/netsocket/udp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ project(${TEST_TARGET})
list(
APPEND
TEST_SOURCE_LIST
main.cpp
udpsocket_bind_port.cpp
udpsocket_bind_address_null.cpp
udpsocket_bind_address_invalid.cpp
Expand All @@ -33,7 +34,10 @@ list(
)

mbed_greentea_add_test(
TEST_NAME ${TEST_TARGET}
TEST_SOURCES ${TEST_SOURCE_LIST}
TEST_REQUIRED_LIBS mbed-netsocket
TEST_NAME
${TEST_TARGET}
TEST_SOURCES
${TEST_SOURCE_LIST}
TEST_REQUIRED_LIBS
mbed-netsocket
)
40 changes: 23 additions & 17 deletions connectivity/netsocket/tests/TESTS/network/emac/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,30 @@ include(${MBED_PATH}/tools/cmake/mbed_greentea.cmake)

project(${TEST_TARGET})

list(APPEND TEST_SOURCE_LIST
emac_TestMemoryManager.cpp
emac_TestNetworkStack.cpp
emac_ctp.cpp
emac_membuf.cpp
emac_test_broadcast.cpp
emac_test_initialize.cpp
emac_test_memory.cpp
emac_test_multicast_filter.cpp
emac_test_unicast.cpp
emac_test_unicast_burst.cpp
emac_test_unicast_frame_len.cpp
emac_test_unicast_long.cpp
emac_util.cpp
list(
APPEND
TEST_SOURCE_LIST
main.cpp
emac_TestMemoryManager.cpp
emac_TestNetworkStack.cpp
emac_ctp.cpp
emac_membuf.cpp
emac_test_broadcast.cpp
emac_test_initialize.cpp
emac_test_memory.cpp
emac_test_multicast_filter.cpp
emac_test_unicast.cpp
emac_test_unicast_burst.cpp
emac_test_unicast_frame_len.cpp
emac_test_unicast_long.cpp
emac_util.cpp
)

mbed_greentea_add_test(
TEST_NAME ${TEST_TARGET}
TEST_SOURCES ${TEST_SOURCE_LIST}
TEST_REQUIRED_LIBS mbed-emac
TEST_NAME
${TEST_TARGET}
TEST_SOURCES
${TEST_SOURCE_LIST}
TEST_REQUIRED_LIBS
mbed-emac
)
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,19 @@ include(${MBED_PATH}/tools/cmake/mbed_greentea.cmake)

project(${TEST_TARGET})

list(APPEND TEST_SOURCE_LIST
networkinterface_conn_disc_repeat.cpp
networkinterface_status.cpp
list(
APPEND
TEST_SOURCE_LIST
main.cpp
networkinterface_conn_disc_repeat.cpp
networkinterface_status.cpp
)

mbed_greentea_add_test(
TEST_NAME ${TEST_TARGET}
TEST_SOURCES ${TEST_SOURCE_LIST}
TEST_REQUIRED_LIBS mbed-netsocket
TEST_NAME
${TEST_TARGET}
TEST_SOURCES
${TEST_SOURCE_LIST}
TEST_REQUIRED_LIBS
mbed-netsocket
)
16 changes: 12 additions & 4 deletions connectivity/netsocket/tests/TESTS/network/l3ip/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,18 @@ include(${MBED_PATH}/tools/cmake/mbed_greentea.cmake)

project(${TEST_TARGET})

list(APPEND TEST_SOURCE_LIST cellular_driver_l3ip.cpp)
list(
APPEND
TEST_SOURCE_LIST
main.cpp
cellular_driver_l3ip.cpp
)

mbed_greentea_add_test(
TEST_NAME ${TEST_TARGET}
TEST_SOURCES ${TEST_SOURCE_LIST}
TEST_REQUIRED_LIBS mbed-netsocket
TEST_NAME
${TEST_TARGET}
TEST_SOURCES
${TEST_SOURCE_LIST}
TEST_REQUIRED_LIBS
mbed-netsocket
)
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,21 @@ include(${MBED_PATH}/tools/cmake/mbed_greentea.cmake)

project(${TEST_TARGET})

list(APPEND TEST_SOURCE_LIST
multihoming_asynchronous_dns.cpp
multihoming_synchronous_dns.cpp
multihoming_udpsocket_echotest.cpp
list(
APPEND
TEST_SOURCE_LIST
main.cpp
multihoming_asynchronous_dns.cpp
multihoming_synchronous_dns.cpp
multihoming_udpsocket_echotest.cpp
)

mbed_greentea_add_test(
TEST_NAME ${TEST_TARGET}
TEST_SOURCES ${TEST_SOURCE_LIST}
TEST_REQUIRED_LIBS mbed-netsocket mbed-nanostack
TEST_NAME
${TEST_TARGET}
TEST_SOURCES
${TEST_SOURCE_LIST}
TEST_REQUIRED_LIBS
mbed-netsocket
mbed-nanostack
)
50 changes: 28 additions & 22 deletions connectivity/netsocket/tests/TESTS/network/wifi/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,29 +10,35 @@ include(${MBED_PATH}/tools/cmake/mbed_greentea.cmake)

project(${TEST_TARGET})

list(APPEND TEST_SOURCE_LIST
get_interface.cpp
get_security.cpp
wifi-constructor.cpp
wifi_connect.cpp
wifi_connect_disconnect_nonblock.cpp
wifi_connect_disconnect_repeat.cpp
wifi_connect_nocredentials.cpp
wifi_connect_params_channel.cpp
wifi_connect_params_channel_fail.cpp
wifi_connect_params_null.cpp
wifi_connect_params_valid_secure.cpp
wifi_connect_secure.cpp
wifi_connect_secure_fail.cpp
wifi_get_rssi.cpp
wifi_scan.cpp
wifi_scan_null.cpp
wifi_set_channel.cpp
wifi_set_credential.cpp
list(
APPEND
TEST_SOURCE_LIST
main.cpp
get_interface.cpp
get_security.cpp
wifi-constructor.cpp
wifi_connect.cpp
wifi_connect_disconnect_nonblock.cpp
wifi_connect_disconnect_repeat.cpp
wifi_connect_nocredentials.cpp
wifi_connect_params_channel.cpp
wifi_connect_params_channel_fail.cpp
wifi_connect_params_null.cpp
wifi_connect_params_valid_secure.cpp
wifi_connect_secure.cpp
wifi_connect_secure_fail.cpp
wifi_get_rssi.cpp
wifi_scan.cpp
wifi_scan_null.cpp
wifi_set_channel.cpp
wifi_set_credential.cpp
)

mbed_greentea_add_test(
TEST_NAME ${TEST_TARGET}
TEST_SOURCES ${TEST_SOURCE_LIST}
TEST_REQUIRED_LIBS mbed-netsocket
TEST_NAME
${TEST_TARGET}
TEST_SOURCES
${TEST_SOURCE_LIST}
TEST_REQUIRED_LIBS
mbed-netsocket
)
5 changes: 4 additions & 1 deletion connectivity/nfc/tests/TESTS/nfc/eeprom/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ include(${MBED_PATH}/tools/cmake/mbed_greentea.cmake)
project(${TEST_TARGET})

mbed_greentea_add_test(
TEST_NAME ${TEST_TARGET}
TEST_NAME
${TEST_TARGET}
TEST_SOURCES
main.cpp
TEST_REQUIRED_LIBS
mbed-nfc
)
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,9 @@ include(${MBED_PATH}/tools/cmake/mbed_greentea.cmake)

project(${TEST_TARGET})

mbed_greentea_add_test(TEST_NAME ${TEST_TARGET})
mbed_greentea_add_test(
TEST_NAME
${TEST_TARGET}
TEST_SOURCES
main.cpp
)
Loading