diff --git a/events/CMakeLists.txt b/events/CMakeLists.txt index 6e7a6c6bda9d..61a606aecf86 100644 --- a/events/CMakeLists.txt +++ b/events/CMakeLists.txt @@ -3,7 +3,7 @@ if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME AND BUILD_TESTING) if(BUILD_GREENTEA_TESTS) - # add greentea test + add_subdirectory(tests/TESTS) else() add_subdirectory(tests/UNITTESTS) endif() diff --git a/events/tests/TESTS/CMakeLists.txt b/events/tests/TESTS/CMakeLists.txt new file mode 100644 index 000000000000..d62badeee32b --- /dev/null +++ b/events/tests/TESTS/CMakeLists.txt @@ -0,0 +1,6 @@ +# Copyright (c) 2021 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +add_subdirectory(events/equeue) +add_subdirectory(events/queue) +add_subdirectory(events/timing) diff --git a/events/tests/TESTS/events/equeue/CMakeLists.txt b/events/tests/TESTS/events/equeue/CMakeLists.txt index f49813e1b285..9211b02d23b9 100644 --- a/events/tests/TESTS/events/equeue/CMakeLists.txt +++ b/events/tests/TESTS/events/equeue/CMakeLists.txt @@ -1,18 +1,11 @@ -# Copyright (c) 2020 ARM Limited. All rights reserved. +# Copyright (c) 2021 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -cmake_minimum_required(VERSION 3.19.0 FATAL_ERROR) - -set(MBED_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../../../.. CACHE INTERNAL "") -set(TEST_TARGET mbed-events-equeue) - -include(${MBED_PATH}/tools/cmake/mbed_greentea.cmake) - -project(${TEST_TARGET}) +include(mbed_greentea) mbed_greentea_add_test( TEST_NAME - ${TEST_TARGET} + mbed-events-equeue TEST_SOURCES main.cpp TEST_REQUIRED_LIBS diff --git a/events/tests/TESTS/events/queue/CMakeLists.txt b/events/tests/TESTS/events/queue/CMakeLists.txt index 06183db4b466..198677f402b1 100644 --- a/events/tests/TESTS/events/queue/CMakeLists.txt +++ b/events/tests/TESTS/events/queue/CMakeLists.txt @@ -1,20 +1,19 @@ -# Copyright (c) 2020 ARM Limited. All rights reserved. +# Copyright (c) 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-events-queue) - -include(${MBED_PATH}/tools/cmake/mbed_greentea.cmake) - -project(${TEST_TARGET}) +if(NOT "DEVICE_USTICKER=1" IN_LIST MBED_TARGET_DEFINITIONS) + set(TEST_SKIPPED "Microsecond ticker required") +endif() mbed_greentea_add_test( TEST_NAME - ${TEST_TARGET} + mbed-events-queue TEST_SOURCES main.cpp TEST_REQUIRED_LIBS mbed-events + TEST_SKIPPED + ${TEST_SKIPPED} ) diff --git a/events/tests/TESTS/events/timing/CMakeLists.txt b/events/tests/TESTS/events/timing/CMakeLists.txt index f979ea3c7200..9e906603c9b5 100644 --- a/events/tests/TESTS/events/timing/CMakeLists.txt +++ b/events/tests/TESTS/events/timing/CMakeLists.txt @@ -1,20 +1,19 @@ -# Copyright (c) 2020 ARM Limited. All rights reserved. +# Copyright (c) 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-events-timing) - -include(${MBED_PATH}/tools/cmake/mbed_greentea.cmake) - -project(${TEST_TARGET}) +if(NOT "DEVICE_USTICKER=1" IN_LIST MBED_TARGET_DEFINITIONS) + set(TEST_SKIPPED "Microsecond ticker required") +endif() mbed_greentea_add_test( TEST_NAME - ${TEST_TARGET} + mbed-events-timing TEST_SOURCES main.cpp TEST_REQUIRED_LIBS mbed-events + TEST_SKIPPED + ${TEST_SKIPPED} )