Skip to content

Commit ff6d401

Browse files
authored
Merge pull request ARMmbed#15095 from LDong-Arm/ctest_nfc
CMake: greentea: Migrate the NFC EEPROM test to CTest
2 parents 94c7463 + 58f8359 commit ff6d401

File tree

9 files changed

+41
-23
lines changed

9 files changed

+41
-23
lines changed

connectivity/CMakeLists.txt

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,17 @@ add_library(mbed-nfc INTERFACE)
2424
add_library(mbed-ppp INTERFACE)
2525
add_library(mbed-wifi INTERFACE)
2626

27-
if(${CMAKE_CROSSCOMPILING})
27+
if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME AND BUILD_TESTING)
28+
# Add these subdirectories for tests
29+
add_subdirectory(cellular)
30+
add_subdirectory(drivers)
31+
add_subdirectory(FEATURE_BLE)
32+
add_subdirectory(libraries)
33+
add_subdirectory(lorawan)
34+
add_subdirectory(mbedtls)
35+
add_subdirectory(netsocket)
36+
add_subdirectory(nfc)
37+
else()
2838
# The directories below contain optional target libraries
2939
add_subdirectory(FEATURE_BLE EXCLUDE_FROM_ALL)
3040
add_subdirectory(cellular EXCLUDE_FROM_ALL)
@@ -36,12 +46,4 @@ if(${CMAKE_CROSSCOMPILING})
3646
add_subdirectory(nanostack EXCLUDE_FROM_ALL)
3747
add_subdirectory(netsocket EXCLUDE_FROM_ALL)
3848
add_subdirectory(nfc EXCLUDE_FROM_ALL)
39-
else()
40-
# Add these subdirectories for the Unit test
41-
add_subdirectory(cellular)
42-
add_subdirectory(lorawan)
43-
add_subdirectory(netsocket)
44-
add_subdirectory(mbedtls)
45-
add_subdirectory(libraries)
46-
add_subdirectory(FEATURE_BLE)
4749
endif()

connectivity/FEATURE_BLE/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(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME AND BUILD_TESTING)
5-
add_subdirectory(tests/UNITTESTS)
5+
if(NOT BUILD_GREENTEA_TESTS)
6+
add_subdirectory(tests/UNITTESTS)
7+
endif()
68
endif()
79

810
add_subdirectory(libraries)

connectivity/libraries/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(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME AND BUILD_TESTING)
5-
add_subdirectory(tests/UNITTESTS)
5+
if(NOT BUILD_GREENTEA_TESTS)
6+
add_subdirectory(tests/UNITTESTS)
7+
endif()
68
endif()
79

810
add_subdirectory(mbed-coap)

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(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME AND BUILD_TESTING)
5-
add_subdirectory(tests/UNITTESTS)
5+
if(NOT BUILD_GREENTEA_TESTS)
6+
add_subdirectory(tests/UNITTESTS)
7+
endif()
68
endif()
79

810
target_include_directories(mbed-mbedtls

connectivity/nfc/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@
33

44
add_subdirectory(libraries)
55

6+
if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME AND BUILD_TESTING)
7+
if(BUILD_GREENTEA_TESTS)
8+
add_subdirectory(tests/TESTS)
9+
endif()
10+
endif()
11+
612
target_include_directories(mbed-nfc
713
INTERFACE
814
.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Copyright (c) 2021 ARM Limited. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
add_subdirectory(nfc/eeprom)
Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
1-
# Copyright (c) 2020 ARM Limited. All rights reserved.
1+
# Copyright (c) 2020-2021 ARM Limited. All rights reserved.
22
# SPDX-License-Identifier: Apache-2.0
33

4-
cmake_minimum_required(VERSION 3.19.0 FATAL_ERROR)
4+
include(mbed_greentea)
55

6-
set(MBED_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../../../../.. CACHE INTERNAL "")
7-
set(TEST_TARGET mbed-connectivity-nfc-eeprom)
8-
9-
include(${MBED_PATH}/tools/cmake/mbed_greentea.cmake)
10-
11-
project(${TEST_TARGET})
6+
if(NOT "MBED_CONF_NFCEEPROM=1" IN_LIST MBED_CONFIG_DEFINITIONS)
7+
set(TEST_SKIPPED "NFC EEPROM required")
8+
endif()
129

1310
mbed_greentea_add_test(
1411
TEST_NAME
15-
${TEST_TARGET}
12+
mbed-connectivity-nfc-eeprom
1613
TEST_SOURCES
1714
main.cpp
1815
TEST_REQUIRED_LIBS
1916
mbed-nfc
17+
TEST_SKIPPED
18+
${TEST_SKIPPED}
2019
)

targets/targets.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3920,7 +3920,8 @@
39203920
],
39213921
"extra_labels_add": [
39223922
"CORDIO",
3923-
"MX25R6435F"
3923+
"MX25R6435F",
3924+
"M24SR"
39243925
],
39253926
"supported_form_factors": [
39263927
"ARDUINO_UNO"

tools/memap.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ def parse_mapfile(self, file_desc):
247247
class _ArmccParser(_Parser):
248248
RE = re.compile(
249249
r'^\s+0x(\w{8})\s+0x(\w{8})\s+(\w+)\s+(\w+)\s+(\d+)\s+[*]?.+\s+(.+)$')
250-
RE_OBJECT = re.compile(r'(.+\.(l|ar))\((.+\.o(bj)?)\)')
250+
RE_OBJECT = re.compile(r'(.+\.(l|a|ar))\((.+\.o(bj)?)\)')
251251
OBJECT_EXTENSIONS = (".o", ".obj")
252252

253253
def parse_object_name(self, line):

0 commit comments

Comments
 (0)