Skip to content

Commit

Permalink
CMake: greentea: Migrate the NFC EEPROM test to CTest
Browse files Browse the repository at this point in the history
  • Loading branch information
LDong-Arm committed Sep 20, 2021
1 parent cbec61a commit 58f8359
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 9 deletions.
1 change: 1 addition & 0 deletions connectivity/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME AND BUILD_TESTING)
add_subdirectory(lorawan)
add_subdirectory(mbedtls)
add_subdirectory(netsocket)
add_subdirectory(nfc)
else()
# The directories below contain optional target libraries
add_subdirectory(FEATURE_BLE EXCLUDE_FROM_ALL)
Expand Down
6 changes: 6 additions & 0 deletions connectivity/nfc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@

add_subdirectory(libraries)

if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME AND BUILD_TESTING)
if(BUILD_GREENTEA_TESTS)
add_subdirectory(tests/TESTS)
endif()
endif()

target_include_directories(mbed-nfc
INTERFACE
.
Expand Down
4 changes: 4 additions & 0 deletions connectivity/nfc/tests/TESTS/CMakeLists.txt
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(nfc/eeprom)
17 changes: 8 additions & 9 deletions connectivity/nfc/tests/TESTS/nfc/eeprom/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
# Copyright (c) 2020 ARM Limited. All rights reserved.
# Copyright (c) 2020-2021 ARM Limited. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

cmake_minimum_required(VERSION 3.19.0 FATAL_ERROR)
include(mbed_greentea)

set(MBED_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../../../../.. CACHE INTERNAL "")
set(TEST_TARGET mbed-connectivity-nfc-eeprom)

include(${MBED_PATH}/tools/cmake/mbed_greentea.cmake)

project(${TEST_TARGET})
if(NOT "MBED_CONF_NFCEEPROM=1" IN_LIST MBED_CONFIG_DEFINITIONS)
set(TEST_SKIPPED "NFC EEPROM required")
endif()

mbed_greentea_add_test(
TEST_NAME
${TEST_TARGET}
mbed-connectivity-nfc-eeprom
TEST_SOURCES
main.cpp
TEST_REQUIRED_LIBS
mbed-nfc
TEST_SKIPPED
${TEST_SKIPPED}
)

0 comments on commit 58f8359

Please sign in to comment.