Skip to content

Commit eee0647

Browse files
Jamie SmithJohnK1987
andauthored
Reactivate some Network & Netsocket tests, Mbed TLS tests, Device Key test. Also fix lots of deprecation warnings (#189)
* Reactivate some Network & Netsocket tests, Mbed TLS tests, Device Key test. Also fix lots of deprecation warnings * Style fix tcpsocket_endpoint_close.cpp * Style fix ../lp_ticker/main.cpp * Style fix ../lp_ticker/main.cpp * Handle tests which require an RTOS --------- Co-authored-by: JohnK1987 <[email protected]>
1 parent 9f4987d commit eee0647

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+189
-157
lines changed

connectivity/mbedtls/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
# SPDX-License-Identifier: Apache-2.0
33

44
if(MBED_ENABLE_OS_INTERNAL_TESTS)
5-
if(NOT MBED_BUILD_GREENTEA_TESTS)
5+
if(MBED_BUILD_GREENTEA_TESTS)
6+
add_subdirectory(tests/TESTS)
7+
else()
68
add_subdirectory(tests/UNITTESTS)
79
endif()
810
endif()

connectivity/mbedtls/include/mbedtls/config.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1396,7 +1396,7 @@
13961396
*
13971397
* Enable the checkup functions (*_self_test).
13981398
*/
1399-
//#define MBEDTLS_SELF_TEST
1399+
#define MBEDTLS_SELF_TEST
14001400

14011401
/**
14021402
* \def MBEDTLS_SHA256_SMALLER
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
add_subdirectory(mbedtls)
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
add_subdirectory(multi)
2+
add_subdirectory(sanity)
3+
add_subdirectory(selftest)

connectivity/mbedtls/tests/TESTS/mbedtls/multi/CMakeLists.txt

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,9 @@
11
# Copyright (c) 2021 ARM Limited. All rights reserved.
22
# SPDX-License-Identifier: Apache-2.0
33

4-
cmake_minimum_required(VERSION 3.19.0 FATAL_ERROR)
5-
6-
set(MBED_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../../../../.. CACHE INTERNAL "")
7-
set(TEST_TARGET mbed-connectivity-mbedtls-multi)
8-
9-
include(${MBED_PATH}/tools/cmake/mbed_greentea.cmake)
10-
11-
project(${TEST_TARGET})
12-
134
mbed_greentea_add_test(
145
TEST_NAME
15-
${TEST_TARGET}
6+
mbed-connectivity-mbedtls-multi
167
TEST_SOURCES
178
main.cpp
189
TEST_REQUIRED_LIBS
Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
11
# Copyright (c) 2021 ARM Limited. All rights reserved.
22
# SPDX-License-Identifier: Apache-2.0
33

4-
cmake_minimum_required(VERSION 3.19.0 FATAL_ERROR)
5-
6-
set(MBED_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../../../../.. CACHE INTERNAL "")
7-
set(TEST_TARGET mbed-connectivity-mbedtls-sanity)
8-
9-
include(${MBED_PATH}/tools/cmake/mbed_greentea.cmake)
10-
11-
project(${TEST_TARGET})
4+
if((NOT "FEATURE_EXPERIMENTAL_API=1" IN_LIST MBED_TARGET_DEFINITIONS)
5+
OR (NOT "FEATURE_PSA=1" IN_LIST MBED_TARGET_DEFINITIONS)
6+
OR (NOT "TARGET_MBED_PSA_SRV=1" IN_LIST MBED_TARGET_DEFINITIONS))
7+
set(TEST_SKIPPED "Only PSA targets (Arm-v7M) in emulation mode are supported.")
8+
endif()
129

1310
mbed_greentea_add_test(
1411
TEST_NAME
15-
${TEST_TARGET}
12+
mbed-connectivity-mbedtls-sanity
1613
TEST_SOURCES
1714
main.cpp
1815
TEST_REQUIRED_LIBS
1916
mbed-mbedtls
17+
TEST_SKIPPED
18+
${TEST_SKIPPED}
2019
)
Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,17 @@
11
# Copyright (c) 2021 ARM Limited. All rights reserved.
22
# SPDX-License-Identifier: Apache-2.0
33

4-
cmake_minimum_required(VERSION 3.19.0 FATAL_ERROR)
5-
6-
set(MBED_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../../../../.. CACHE INTERNAL "")
7-
set(TEST_TARGET mbed-connectivity-mbedtls-selftest)
8-
9-
include(${MBED_PATH}/tools/cmake/mbed_greentea.cmake)
10-
11-
project(${TEST_TARGET})
4+
if(MBED_GREENTEA_TEST_BAREMETAL)
5+
set(TEST_SKIPPED "This test requires an RTOS!")
6+
endif()
127

138
mbed_greentea_add_test(
149
TEST_NAME
15-
${TEST_TARGET}
10+
mbed-connectivity-mbedtls-selftest
1611
TEST_SOURCES
1712
main.cpp
1813
TEST_REQUIRED_LIBS
1914
mbed-mbedtls
15+
TEST_SKIPPED
16+
${TEST_SKIPPED}
2017
)
Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11

22
# Only build the netsocket tests if this target has at least one network interface
33
string(FIND "${MBED_CONFIG_DEFINITIONS}" MBED_CONF_TARGET_NETWORK_DEFAULT_INTERFACE_TYPE DEFAULT_IFC_IDX)
4-
if(NOT DEFAULT_IFC_IDX EQUAL -1)
5-
add_subdirectory(netsocket)
6-
endif()
4+
if(DEFAULT_IFC_IDX EQUAL -1)
5+
set(TEST_SKIPPED "No default network interface on this target")
6+
endif()
7+
8+
add_subdirectory(netsocket)
9+
add_subdirectory(network)
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
1-
add_subdirectory(udp)
1+
add_subdirectory(dns)
2+
add_subdirectory(nidd)
3+
add_subdirectory(tcp)
4+
add_subdirectory(tls)
5+
add_subdirectory(udp)

connectivity/netsocket/tests/TESTS/netsocket/dns/CMakeLists.txt

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

4-
cmake_minimum_required(VERSION 3.19.0 FATAL_ERROR)
5-
6-
set(MBED_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../../../../../ CACHE INTERNAL "")
7-
set(TEST_TARGET mbed-connectivity-netsocket-dns)
8-
9-
include(${MBED_PATH}/tools/cmake/mbed_greentea.cmake)
10-
11-
project(${TEST_TARGET})
12-
134
list(
145
APPEND
156
TEST_SOURCE_LIST
@@ -32,11 +23,17 @@ list(
3223
asynchronous_dns_cache.cpp
3324
)
3425

26+
if(MBED_GREENTEA_TEST_BAREMETAL)
27+
set(TEST_SKIPPED "This test requires an RTOS!")
28+
endif()
29+
3530
mbed_greentea_add_test(
3631
TEST_NAME
37-
${TEST_TARGET}
32+
mbed-connectivity-netsocket-dns
3833
TEST_SOURCES
3934
${TEST_SOURCE_LIST}
4035
TEST_REQUIRED_LIBS
4136
mbed-netsocket
37+
TEST_SKIPPED
38+
${TEST_SKIPPED}
4239
)

0 commit comments

Comments
 (0)