-
Notifications
You must be signed in to change notification settings - Fork 3k
CMake: Refactor UNITTESTS CMake #14426
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
d9db59f
sort stubs into libraries
rajkan01 ba04c1c
CMake: Add add_subdirectory of unittests
rajkan01 9e62179
CMake: Remove duplicate documents
rajkan01 2bafdf8
CMake: Refactor drivers unittest cmake
rajkan01 c0a8fe6
CMake: Refactor storage TDBstore and FileSystemStore unittest cmake
rajkan01 4536fff
CMake: Refactor storage blockdevice and SFDP unittests cmake
rajkan01 98215d3
CMake: Fix ChainingBlockDevice unittest
rajkan01 5ad5179
CMake: Refactor platform unittest CMake
rajkan01 b664735
CMake: Refactor event unittest cmake
rajkan01 c5a4fec
CMake: Refactor netsocket unittest CMake
rajkan01 37d4bc2
CMake: Refactore cellular framework unittest
rajkan01 bf4ec4a
CMake: Refactor lorawan unittest cmake
rajkan01 452c45b
CMake: Update target_h stub headers
paul-szczepanek-arm 4ade0bd
CMake: Fix DTLS socket unittest
rajkan01 a88f43f
CMake: Update mbed os, unittest CMake and add CMAKE_CROSSCOMPILING guard
rajkan01 f93f71b
CMake: Update build tools python modules to pick refactored way of un…
rajkan01 7288835
CMake: Run the unit tests in travis CI
rajkan01 91051cb
CMake: fix lifflefs filesystem header include path
rajkan01 f096b3b
Fix missing newline
rajkan01 10625b3
CMake: Update hal and platform stub CMake linker options for coverage
rajkan01 6d4caad
CMake: Move CMAKE_CROSSCOMPILING check inside library CMake
rajkan01 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
CMake: Refactor netsocket unittest CMake
- Add Cmake configuration file - Fix the header inclusion in DTLSSocketWrapper and TLSSocketWrapper test
- Loading branch information
commit c5a4fecd28b56a203be17266952159c89de5e7d5
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Copyright (c) 2021 ARM Limited. All rights reserved. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
add_subdirectory(netsocket) |
18 changes: 18 additions & 0 deletions
18
connectivity/netsocket/tests/UNITTESTS/netsocket/CMakeLists.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Copyright (c) 2021 ARM Limited. All rights reserved. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
add_subdirectory(CellularNonIPSocket) | ||
add_subdirectory(DTLSSocket) | ||
add_subdirectory(DTLSSocketWrapper) | ||
add_subdirectory(EthernetInterface) | ||
add_subdirectory(IfaceDnsSocket) | ||
add_subdirectory(InternetSocket) | ||
add_subdirectory(NetworkInterface) | ||
add_subdirectory(NetworkStack) | ||
add_subdirectory(PPPInterface) | ||
add_subdirectory(SocketAddress) | ||
add_subdirectory(TCPSocket) | ||
add_subdirectory(TLSSocket) | ||
add_subdirectory(TLSSocketWrapper) | ||
add_subdirectory(UDPSocket) | ||
add_subdirectory(WiFiAccessPoint) | ||
33 changes: 33 additions & 0 deletions
33
connectivity/netsocket/tests/UNITTESTS/netsocket/CellularNonIPSocket/CMakeLists.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Copyright (c) 2021 ARM Limited. All rights reserved. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
set(TEST_NAME netsocket-cellular-nonip-socket-unittest) | ||
|
||
add_executable(${TEST_NAME}) | ||
|
||
target_compile_definitions(${TEST_NAME} | ||
PRIVATE | ||
MBED_CONF_CELLULAR_PRESENT=1 | ||
DEVICE_SERIAL=1 | ||
DEVICE_INTERRUPTIN=1 | ||
MBED_CONF_PLATFORM_DEFAULT_SERIAL_BAUD_RATE=115200 | ||
|
||
) | ||
|
||
target_sources(${TEST_NAME} | ||
PRIVATE | ||
${mbed-os_SOURCE_DIR}/connectivity/netsocket/source/CellularNonIPSocket.cpp | ||
test_CellularNonIPSocket.cpp | ||
) | ||
|
||
target_link_libraries(${TEST_NAME} | ||
PRIVATE | ||
mbed-headers | ||
mbed-stubs | ||
mbed-stubs-headers | ||
gmock_main | ||
) | ||
|
||
add_test(NAME "${TEST_NAME}" COMMAND ${TEST_NAME}) | ||
|
||
set_tests_properties(${TEST_NAME} PROPERTIES LABELS "netsocket") |
47 changes: 47 additions & 0 deletions
47
connectivity/netsocket/tests/UNITTESTS/netsocket/DTLSSocket/CMakeLists.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# Copyright (c) 2021 ARM Limited. All rights reserved. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
set(TEST_NAME netsocket-dtls-socket-unittest) | ||
|
||
add_executable(${TEST_NAME}) | ||
|
||
target_compile_definitions(${TEST_NAME} | ||
PRIVATE | ||
MBED_CONF_NSAPI_DNS_ADDRESSES_LIMIT=10 | ||
) | ||
|
||
target_sources(${TEST_NAME} | ||
PRIVATE | ||
${mbed-os_SOURCE_DIR}/connectivity/netsocket/source/SocketAddress.cpp | ||
${mbed-os_SOURCE_DIR}/connectivity/netsocket/source/NetworkStack.cpp | ||
${mbed-os_SOURCE_DIR}/connectivity/netsocket/source/InternetSocket.cpp | ||
${mbed-os_SOURCE_DIR}/connectivity/netsocket/source/InternetDatagramSocket.cpp | ||
${mbed-os_SOURCE_DIR}/connectivity/netsocket/source/UDPSocket.cpp | ||
${mbed-os_SOURCE_DIR}/connectivity/netsocket/source/DTLSSocket.cpp | ||
${mbed-os_SOURCE_DIR}/connectivity/netsocket/source/DTLSSocketWrapper.cpp | ||
${mbed-os_SOURCE_DIR}/connectivity/netsocket/source/TLSSocketWrapper.cpp | ||
${mbed-os_SOURCE_DIR}/connectivity/libraries/nanostack-libservice/source/libip4string/ip4tos.c | ||
${mbed-os_SOURCE_DIR}/connectivity/libraries/nanostack-libservice/source/libip6string/ip6tos.c | ||
${mbed-os_SOURCE_DIR}/connectivity/libraries/nanostack-libservice/source/libip4string/stoip4.c | ||
${mbed-os_SOURCE_DIR}/connectivity/libraries/nanostack-libservice/source/libip6string/stoip6.c | ||
${mbed-os_SOURCE_DIR}/connectivity/libraries/nanostack-libservice/source/libBits/common_functions.c | ||
test_DTLSSocket.cpp | ||
) | ||
|
||
target_link_libraries(${TEST_NAME} | ||
PRIVATE | ||
mbed-headers | ||
mbed-stubs | ||
mbed-stubs-headers | ||
gmock_main | ||
) | ||
|
||
set(MBEDTLS_USER_CONFIG_FILE_PATH "\"${mbed-os_SOURCE_DIR}/connectivity/netsocket/tests/UNITTESTS/netsocket/DTLSSocket/dtls_test_config.h\"") | ||
set_source_files_properties(${mbed-os_SOURCE_DIR}/connectivity/netsocket/tests/UNITTESTS/netsocket/DTLSSocket/test_DTLSSocket.cpp PROPERTIES COMPILE_DEFINITIONS MBEDTLS_USER_CONFIG_FILE=${MBEDTLS_USER_CONFIG_FILE_PATH}) | ||
set_source_files_properties(${mbed-os_SOURCE_DIR}/connectivity/netsocket/source/DTLSSocket.cpp PROPERTIES COMPILE_DEFINITIONS MBEDTLS_USER_CONFIG_FILE=${MBEDTLS_USER_CONFIG_FILE_PATH}) | ||
set_source_files_properties(${mbed-os_SOURCE_DIR}/connectivity/netsocket/source/DTLSSocketWrapper.cpp PROPERTIES COMPILE_DEFINITIONS MBEDTLS_USER_CONFIG_FILE=${MBEDTLS_USER_CONFIG_FILE_PATH}) | ||
set_source_files_properties(${mbed-os_SOURCE_DIR}/connectivity/netsocket/source/TLSSocketWrapper.cpp PROPERTIES COMPILE_DEFINITIONS MBEDTLS_USER_CONFIG_FILE=${MBEDTLS_USER_CONFIG_FILE_PATH}) | ||
|
||
add_test(NAME "${TEST_NAME}" COMMAND ${TEST_NAME}) | ||
|
||
set_tests_properties(${TEST_NAME} PROPERTIES LABELS "netsocket") |
46 changes: 46 additions & 0 deletions
46
connectivity/netsocket/tests/UNITTESTS/netsocket/DTLSSocketWrapper/CMakeLists.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# Copyright (c) 2021 ARM Limited. All rights reserved. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
set(TEST_NAME netsocket-dtls-socket-wrapper-unittest) | ||
|
||
add_executable(${TEST_NAME}) | ||
|
||
target_compile_definitions(${TEST_NAME} | ||
PRIVATE | ||
MBED_CONF_NSAPI_DNS_ADDRESSES_LIMIT=10 | ||
) | ||
|
||
target_sources(${TEST_NAME} | ||
PRIVATE | ||
${mbed-os_SOURCE_DIR}/connectivity/netsocket/source/SocketAddress.cpp | ||
${mbed-os_SOURCE_DIR}/connectivity/netsocket/source/NetworkStack.cpp | ||
${mbed-os_SOURCE_DIR}/connectivity/netsocket/source/InternetSocket.cpp | ||
${mbed-os_SOURCE_DIR}/connectivity/netsocket/source/InternetDatagramSocket.cpp | ||
${mbed-os_SOURCE_DIR}/connectivity/netsocket/source/UDPSocket.cpp | ||
${mbed-os_SOURCE_DIR}/connectivity/netsocket/source/DTLSSocketWrapper.cpp | ||
${mbed-os_SOURCE_DIR}/connectivity/netsocket/source/TLSSocketWrapper.cpp | ||
${mbed-os_SOURCE_DIR}/connectivity/libraries/nanostack-libservice/source/libip4string/ip4tos.c | ||
${mbed-os_SOURCE_DIR}/connectivity/libraries/nanostack-libservice/source/libip6string/ip6tos.c | ||
${mbed-os_SOURCE_DIR}/connectivity/libraries/nanostack-libservice/source/libip4string/stoip4.c | ||
${mbed-os_SOURCE_DIR}/connectivity/libraries/nanostack-libservice/source/libip6string/stoip6.c | ||
${mbed-os_SOURCE_DIR}/connectivity/libraries/nanostack-libservice/source/libBits/common_functions.c | ||
test_DTLSSocketWrapper.cpp | ||
) | ||
|
||
target_link_libraries(${TEST_NAME} | ||
PRIVATE | ||
mbed-headers | ||
mbed-stubs | ||
mbed-stubs-headers | ||
gmock_main | ||
) | ||
|
||
|
||
set(MBEDTLS_USER_CONFIG_FILE_PATH "\"${mbed-os_SOURCE_DIR}/connectivity/netsocket/tests/UNITTESTS/netsocket/DTLSSocketWrapper/dtls_test_config.h\"") | ||
set_source_files_properties(${mbed-os_SOURCE_DIR}/connectivity/netsocket/tests/UNITTESTS/netsocket/DTLSSocketWrapper/test_DTLSSocketWrapper.cpp PROPERTIES COMPILE_DEFINITIONS MBEDTLS_USER_CONFIG_FILE=${MBEDTLS_USER_CONFIG_FILE_PATH}) | ||
set_source_files_properties(${mbed-os_SOURCE_DIR}/connectivity/netsocket/source/DTLSSocketWrapper.cpp PROPERTIES COMPILE_DEFINITIONS MBEDTLS_USER_CONFIG_FILE=${MBEDTLS_USER_CONFIG_FILE_PATH}) | ||
set_source_files_properties(${mbed-os_SOURCE_DIR}/connectivity/netsocket/source/TLSSocketWrapper.cpp PROPERTIES COMPILE_DEFINITIONS MBEDTLS_USER_CONFIG_FILE=${MBEDTLS_USER_CONFIG_FILE_PATH}) | ||
|
||
add_test(NAME "${TEST_NAME}" COMMAND ${TEST_NAME}) | ||
|
||
set_tests_properties(${TEST_NAME} PROPERTIES LABELS "netsocket") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
connectivity/netsocket/tests/UNITTESTS/netsocket/EthernetInterface/CMakeLists.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# Copyright (c) 2021 ARM Limited. All rights reserved. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
set(TEST_NAME netsocket-ethernet-interface-unittest) | ||
|
||
add_executable(${TEST_NAME}) | ||
|
||
target_compile_definitions(${TEST_NAME} | ||
PRIVATE | ||
MBED_CONF_NSAPI_DNS_ADDRESSES_LIMIT=10 | ||
) | ||
|
||
target_sources(${TEST_NAME} | ||
PRIVATE | ||
${mbed-os_SOURCE_DIR}/connectivity/netsocket/source/SocketAddress.cpp | ||
${mbed-os_SOURCE_DIR}/connectivity/netsocket/source/EthernetInterface.cpp | ||
${mbed-os_SOURCE_DIR}/connectivity/netsocket/source/EMACInterface.cpp | ||
${mbed-os_SOURCE_DIR}/connectivity/netsocket/source/NetworkInterface.cpp | ||
${mbed-os_SOURCE_DIR}/connectivity/netsocket/source/NetworkStack.cpp | ||
${mbed-os_SOURCE_DIR}/connectivity/libraries/nanostack-libservice/source/libip4string/ip4tos.c | ||
${mbed-os_SOURCE_DIR}/connectivity/libraries/nanostack-libservice/source/libip6string/ip6tos.c | ||
${mbed-os_SOURCE_DIR}/connectivity/libraries/nanostack-libservice/source/libip4string/stoip4.c | ||
${mbed-os_SOURCE_DIR}/connectivity/libraries/nanostack-libservice/source/libip6string/stoip6.c | ||
${mbed-os_SOURCE_DIR}/connectivity/libraries/nanostack-libservice/source/libBits/common_functions.c | ||
${mbed-os_SOURCE_DIR}/connectivity/libraries/nanostack-libservice/source/libList/ns_list.c | ||
test_EthernetInterface.cpp | ||
) | ||
|
||
target_link_libraries(${TEST_NAME} | ||
PRIVATE | ||
mbed-headers | ||
mbed-stubs | ||
mbed-stubs-headers | ||
gmock_main | ||
) | ||
|
||
add_test(NAME "${TEST_NAME}" COMMAND ${TEST_NAME}) | ||
|
||
set_tests_properties(${TEST_NAME} PROPERTIES LABELS "netsocket") |
53 changes: 53 additions & 0 deletions
53
connectivity/netsocket/tests/UNITTESTS/netsocket/IfaceDnsSocket/CMakeLists.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# Copyright (c) 2021 ARM Limited. All rights reserved. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
set(TEST_NAME netsocket-iface-dns-socket-unittest) | ||
|
||
add_executable(${TEST_NAME}) | ||
|
||
target_compile_definitions(${TEST_NAME} | ||
PRIVATE | ||
MBED_CONF_NSAPI_DNS_ADDRESSES_LIMIT=10 | ||
DEVICE_EMAC | ||
MBED_CONF_TARGET_NETWORK_DEFAULT_INTERFACE_TYPE=ETHERNET | ||
MBED_CONF_NSAPI_DNS_RESPONSE_WAIT_TIME=10000 | ||
MBED_CONF_NSAPI_DNS_RETRIES=1 | ||
MBED_CONF_NSAPI_DNS_TOTAL_ATTEMPTS=10 | ||
MBED_CONF_NSAPI_DNS_CACHE_SIZE=5 | ||
) | ||
|
||
target_sources(${TEST_NAME} | ||
PRIVATE | ||
${mbed-os_SOURCE_DIR}/connectivity/netsocket/source/SocketAddress.cpp | ||
${mbed-os_SOURCE_DIR}/connectivity/netsocket/source/NetworkInterface.cpp | ||
${mbed-os_SOURCE_DIR}/connectivity/netsocket/source/NetworkInterfaceDefaults.cpp | ||
${mbed-os_SOURCE_DIR}/connectivity/netsocket/source/NetworkStack.cpp #nsapi_create_stack | ||
${mbed-os_SOURCE_DIR}/connectivity/netsocket/source/InternetSocket.cpp | ||
${mbed-os_SOURCE_DIR}/connectivity/netsocket/source/TCPSocket.cpp | ||
${mbed-os_SOURCE_DIR}/connectivity/netsocket/source/InternetDatagramSocket.cpp | ||
${mbed-os_SOURCE_DIR}/connectivity/netsocket/source/UDPSocket.cpp | ||
${mbed-os_SOURCE_DIR}/connectivity/netsocket/source/SocketStats.cpp | ||
${mbed-os_SOURCE_DIR}/connectivity/netsocket/source/EthernetInterface.cpp | ||
${mbed-os_SOURCE_DIR}/connectivity/netsocket/source/EMACInterface.cpp | ||
${mbed-os_SOURCE_DIR}/connectivity/netsocket/source/nsapi_dns.cpp | ||
${mbed-os_SOURCE_DIR}/connectivity/libraries/nanostack-libservice/source/libip4string/ip4tos.c | ||
${mbed-os_SOURCE_DIR}/connectivity/libraries/nanostack-libservice/source/libip6string/ip6tos.c | ||
${mbed-os_SOURCE_DIR}/connectivity/libraries/nanostack-libservice/source/libip4string/stoip4.c | ||
${mbed-os_SOURCE_DIR}/connectivity/libraries/nanostack-libservice/source/libip6string/stoip6.c | ||
${mbed-os_SOURCE_DIR}/connectivity/libraries/nanostack-libservice/source/libBits/common_functions.c | ||
${mbed-os_SOURCE_DIR}/connectivity/libraries/nanostack-libservice/source/libBits/common_functions.c | ||
${mbed-os_SOURCE_DIR}/connectivity/libraries/nanostack-libservice/source/libList/ns_list.c | ||
moduletest.cpp | ||
) | ||
|
||
target_link_libraries(${TEST_NAME} | ||
PRIVATE | ||
mbed-headers | ||
mbed-stubs | ||
mbed-stubs-headers | ||
gmock_main | ||
) | ||
|
||
add_test(NAME "${TEST_NAME}" COMMAND ${TEST_NAME}) | ||
|
||
set_tests_properties(${TEST_NAME} PROPERTIES LABELS "netsocket") |
36 changes: 36 additions & 0 deletions
36
connectivity/netsocket/tests/UNITTESTS/netsocket/InternetSocket/CMakeLists.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Copyright (c) 2021 ARM Limited. All rights reserved. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
set(TEST_NAME netsocket-internet-socket-unittest) | ||
|
||
add_executable(${TEST_NAME}) | ||
|
||
target_compile_definitions(${TEST_NAME} | ||
PRIVATE | ||
MBED_CONF_NSAPI_DNS_ADDRESSES_LIMIT=10 | ||
) | ||
|
||
target_sources(${TEST_NAME} | ||
PRIVATE | ||
${mbed-os_SOURCE_DIR}/connectivity/netsocket/source/SocketAddress.cpp | ||
${mbed-os_SOURCE_DIR}/connectivity/netsocket/source/NetworkStack.cpp | ||
${mbed-os_SOURCE_DIR}/connectivity/netsocket/source/InternetSocket.cpp | ||
${mbed-os_SOURCE_DIR}/connectivity/libraries/nanostack-libservice/source/libip4string/ip4tos.c | ||
${mbed-os_SOURCE_DIR}/connectivity/libraries/nanostack-libservice/source/libip6string/ip6tos.c | ||
${mbed-os_SOURCE_DIR}/connectivity/libraries/nanostack-libservice/source/libip4string/stoip4.c | ||
${mbed-os_SOURCE_DIR}/connectivity/libraries/nanostack-libservice/source/libip6string/stoip6.c | ||
${mbed-os_SOURCE_DIR}/connectivity/libraries/nanostack-libservice/source/libBits/common_functions.c | ||
test_InternetSocket.cpp | ||
) | ||
|
||
target_link_libraries(${TEST_NAME} | ||
PRIVATE | ||
mbed-headers | ||
mbed-stubs | ||
mbed-stubs-headers | ||
gmock_main | ||
) | ||
|
||
add_test(NAME "${TEST_NAME}" COMMAND ${TEST_NAME}) | ||
|
||
set_tests_properties(${TEST_NAME} PROPERTIES LABELS "netsocket") |
39 changes: 39 additions & 0 deletions
39
connectivity/netsocket/tests/UNITTESTS/netsocket/NetworkInterface/CMakeLists.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# Copyright (c) 2021 ARM Limited. All rights reserved. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
set(TEST_NAME netsocket-network-interface-unittest) | ||
|
||
add_executable(${TEST_NAME}) | ||
|
||
target_compile_definitions(${TEST_NAME} | ||
PRIVATE | ||
MBED_CONF_PLATFORM_CALLBACK_COMPARABLE | ||
MBED_CONF_NSAPI_DNS_ADDRESSES_LIMIT=10 | ||
|
||
) | ||
|
||
target_sources(${TEST_NAME} | ||
PRIVATE | ||
${mbed-os_SOURCE_DIR}/connectivity/netsocket/source/SocketAddress.cpp | ||
${mbed-os_SOURCE_DIR}/connectivity/netsocket/source/NetworkStack.cpp | ||
${mbed-os_SOURCE_DIR}/connectivity/netsocket/source/NetworkInterface.cpp | ||
${mbed-os_SOURCE_DIR}/connectivity/libraries/nanostack-libservice/source/libip4string/ip4tos.c | ||
${mbed-os_SOURCE_DIR}/connectivity/libraries/nanostack-libservice/source/libip6string/ip6tos.c | ||
${mbed-os_SOURCE_DIR}/connectivity/libraries/nanostack-libservice/source/libip4string/stoip4.c | ||
${mbed-os_SOURCE_DIR}/connectivity/libraries/nanostack-libservice/source/libip6string/stoip6.c | ||
${mbed-os_SOURCE_DIR}/connectivity/libraries/nanostack-libservice/source/libBits/common_functions.c | ||
${mbed-os_SOURCE_DIR}/connectivity/libraries/nanostack-libservice/source/libList/ns_list.c | ||
test_NetworkInterface.cpp | ||
) | ||
|
||
target_link_libraries(${TEST_NAME} | ||
PRIVATE | ||
mbed-headers | ||
mbed-stubs | ||
mbed-stubs-headers | ||
gmock_main | ||
) | ||
|
||
add_test(NAME "${TEST_NAME}" COMMAND ${TEST_NAME}) | ||
|
||
set_tests_properties(${TEST_NAME} PROPERTIES LABELS "netsocket") |
35 changes: 35 additions & 0 deletions
35
connectivity/netsocket/tests/UNITTESTS/netsocket/NetworkStack/CMakeLists.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Copyright (c) 2021 ARM Limited. All rights reserved. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
set(TEST_NAME netsocket-network-stack-unittest) | ||
|
||
add_executable(${TEST_NAME}) | ||
|
||
target_compile_definitions(${TEST_NAME} | ||
PRIVATE | ||
MBED_CONF_NSAPI_DNS_ADDRESSES_LIMIT=10 | ||
) | ||
|
||
target_sources(${TEST_NAME} | ||
PRIVATE | ||
${mbed-os_SOURCE_DIR}/connectivity/netsocket/source/SocketAddress.cpp | ||
${mbed-os_SOURCE_DIR}/connectivity/netsocket/source/NetworkStack.cpp | ||
${mbed-os_SOURCE_DIR}/connectivity/libraries/nanostack-libservice/source/libip4string/ip4tos.c | ||
${mbed-os_SOURCE_DIR}/connectivity/libraries/nanostack-libservice/source/libip6string/ip6tos.c | ||
${mbed-os_SOURCE_DIR}/connectivity/libraries/nanostack-libservice/source/libip4string/stoip4.c | ||
${mbed-os_SOURCE_DIR}/connectivity/libraries/nanostack-libservice/source/libip6string/stoip6.c | ||
${mbed-os_SOURCE_DIR}/connectivity/libraries/nanostack-libservice/source/libBits/common_functions.c | ||
test_NetworkStack.cpp | ||
) | ||
|
||
target_link_libraries(${TEST_NAME} | ||
PRIVATE | ||
mbed-headers | ||
mbed-stubs | ||
mbed-stubs-headers | ||
gmock_main | ||
) | ||
|
||
add_test(NAME "${TEST_NAME}" COMMAND ${TEST_NAME}) | ||
|
||
set_tests_properties(${TEST_NAME} PROPERTIES LABELS "netsocket") |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.