Skip to content

Commit 58f8359

Browse files
committed
CMake: greentea: Migrate the NFC EEPROM test to CTest
1 parent cbec61a commit 58f8359

File tree

4 files changed

+19
-9
lines changed

4 files changed

+19
-9
lines changed

connectivity/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME AND BUILD_TESTING)
3333
add_subdirectory(lorawan)
3434
add_subdirectory(mbedtls)
3535
add_subdirectory(netsocket)
36+
add_subdirectory(nfc)
3637
else()
3738
# The directories below contain optional target libraries
3839
add_subdirectory(FEATURE_BLE EXCLUDE_FROM_ALL)

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
)

0 commit comments

Comments
 (0)