Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor platform greentea cmake #15019

Merged
merged 3 commits into from
Sep 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion platform/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
27 changes: 27 additions & 0 deletions platform/tests/TESTS/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Copyright (c) 2021 ARM Limited. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

add_subdirectory(mbed_functional/callback)
add_subdirectory(mbed_functional/callback_big)
add_subdirectory(mbed_functional/callback_small)
add_subdirectory(mbed_micro/attributes)
add_subdirectory(mbed_micro/call_before_main)
add_subdirectory(mbed_micro/cpp)
add_subdirectory(mbed_micro/div)
add_subdirectory(mbed_micro/static_assert)
add_subdirectory(mbed_platform/atomic)
add_subdirectory(mbed_platform/CircularBuffer)
add_subdirectory(mbed_platform/crash_reporting)
add_subdirectory(mbed_platform/error_handling)
add_subdirectory(mbed_platform/FileHandle)
add_subdirectory(mbed_platform/minimal-printf/compliance)
add_subdirectory(mbed_platform/SharedPtr)
add_subdirectory(mbed_platform/SingletonPtr)
add_subdirectory(mbed_platform/Stream)
add_subdirectory(mbed_platform/system_reset)
add_subdirectory(mbed_platform/Transaction)
add_subdirectory(mbed_platform/wait_ns)
add_subdirectory(mbed_platform/stats_cpu)
add_subdirectory(mbed_platform/stats_heap)
add_subdirectory(mbed_platform/stats_sys)
add_subdirectory(mbed_platform/stats_thread)
13 changes: 3 additions & 10 deletions platform/tests/TESTS/mbed_functional/callback/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,18 +1,11 @@
# 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)

set(MBED_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../../../.. CACHE INTERNAL "")
set(TEST_TARGET mbed-platform-mbed-functional-callback)

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

project(${TEST_TARGET})
include(mbed_greentea)

mbed_greentea_add_test(
TEST_NAME
${TEST_TARGET}
mbed-platform-mbed-functional-callback
TEST_SOURCES
main.cpp
)
13 changes: 3 additions & 10 deletions platform/tests/TESTS/mbed_functional/callback_big/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,18 +1,11 @@
# 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)

set(MBED_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../../../.. CACHE INTERNAL "")
set(TEST_TARGET mbed-platform-mbed-functional-callback-big)

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

project(${TEST_TARGET})
include(mbed_greentea)

mbed_greentea_add_test(
TEST_NAME
${TEST_TARGET}
mbed-platform-mbed-functional-callback-big
TEST_SOURCES
main.cpp
)
13 changes: 3 additions & 10 deletions platform/tests/TESTS/mbed_functional/callback_small/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,18 +1,11 @@
# 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)

set(MBED_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../../../.. CACHE INTERNAL "")
set(TEST_TARGET mbed-platform-mbed-functional-callback-small)

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

project(${TEST_TARGET})
include(mbed_greentea)

mbed_greentea_add_test(
TEST_NAME
${TEST_TARGET}
mbed-platform-mbed-functional-callback-small
TEST_SOURCES
main.cpp
)
13 changes: 3 additions & 10 deletions platform/tests/TESTS/mbed_micro/attributes/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
# 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)

set(MBED_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../../../.. CACHE INTERNAL "")
set(TEST_TARGET mbed-platform-mbed-micro-attributes)

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

project(${TEST_TARGET})
include(mbed_greentea)

list(
APPEND
Expand All @@ -20,7 +13,7 @@ list(

mbed_greentea_add_test(
TEST_NAME
${TEST_TARGET}
mbed-platform-mbed-micro-attributes
TEST_SOURCES
${TEST_SOURCE_LIST}
)
13 changes: 3 additions & 10 deletions platform/tests/TESTS/mbed_micro/call_before_main/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,18 +1,11 @@
# 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)

set(MBED_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../../../.. CACHE INTERNAL "")
set(TEST_TARGET mbed-platform-mbed-micro-call-before-main)

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

project(${TEST_TARGET})
include(mbed_greentea)

mbed_greentea_add_test(
TEST_NAME
${TEST_TARGET}
mbed-platform-mbed-micro-call-before-main
TEST_SOURCES
main.cpp
)
13 changes: 3 additions & 10 deletions platform/tests/TESTS/mbed_micro/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,18 +1,11 @@
# 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)

set(MBED_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../../../.. CACHE INTERNAL "")
set(TEST_TARGET mbed-platform-mbed-micro-cpp)

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

project(${TEST_TARGET})
include(mbed_greentea)

mbed_greentea_add_test(
TEST_NAME
${TEST_TARGET}
mbed-platform-mbed-micro-cpp
TEST_SOURCES
main.cpp
)
13 changes: 3 additions & 10 deletions platform/tests/TESTS/mbed_micro/div/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,18 +1,11 @@
# 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)

set(MBED_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../../../.. CACHE INTERNAL "")
set(TEST_TARGET mbed-platform-mbed-micro-div)

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

project(${TEST_TARGET})
include(mbed_greentea)

mbed_greentea_add_test(
TEST_NAME
${TEST_TARGET}
mbed-platform-mbed-micro-div
TEST_SOURCES
main.cpp
)
13 changes: 3 additions & 10 deletions platform/tests/TESTS/mbed_micro/static_assert/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
# 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)

set(MBED_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../../../.. CACHE INTERNAL "")
set(TEST_TARGET mbed-platform-mbed-micro-static-assert)

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

project(${TEST_TARGET})
include(mbed_greentea)

list(
APPEND
Expand All @@ -20,7 +13,7 @@ list(

mbed_greentea_add_test(
TEST_NAME
${TEST_TARGET}
mbed-platform-mbed-micro-static-assert
TEST_SOURCES
${TEST_SOURCE_LIST}
)
13 changes: 3 additions & 10 deletions platform/tests/TESTS/mbed_platform/CircularBuffer/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,18 +1,11 @@
# 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)

set(MBED_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../../../.. CACHE INTERNAL "")
set(TEST_TARGET mbed-platform-circular-buffer)

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

project(${TEST_TARGET})
include(mbed_greentea)

mbed_greentea_add_test(
TEST_NAME
${TEST_TARGET}
mbed-platform-circular-buffer
TEST_SOURCES
main.cpp
)
15 changes: 5 additions & 10 deletions platform/tests/TESTS/mbed_platform/FileHandle/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
# 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)

set(MBED_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../../../.. CACHE INTERNAL "")
set(TEST_TARGET mbed-platform-filehandle)

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

project(${TEST_TARGET})
include(mbed_greentea)

mbed_greentea_add_test(
TEST_NAME
${TEST_TARGET}
mbed-platform-filehandle
TEST_INCLUDE_DIRS
.
TEST_SOURCES
main.cpp
)
13 changes: 3 additions & 10 deletions platform/tests/TESTS/mbed_platform/SharedPtr/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,18 +1,11 @@
# 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)

set(MBED_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../../../.. CACHE INTERNAL "")
set(TEST_TARGET mbed-platform-sharedptr)

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

project(${TEST_TARGET})
include(mbed_greentea)

mbed_greentea_add_test(
TEST_NAME
${TEST_TARGET}
mbed-platform-sharedptr
TEST_SOURCES
main.cpp
)
13 changes: 3 additions & 10 deletions platform/tests/TESTS/mbed_platform/SingletonPtr/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,18 +1,11 @@
# 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)

set(MBED_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../../../.. CACHE INTERNAL "")
set(TEST_TARGET mbed-platform-singletonptr)

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

project(${TEST_TARGET})
include(mbed_greentea)

mbed_greentea_add_test(
TEST_NAME
${TEST_TARGET}
mbed-platform-singletonptr
TEST_SOURCES
main.cpp
)
15 changes: 5 additions & 10 deletions platform/tests/TESTS/mbed_platform/Stream/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
# 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)

set(MBED_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../../../.. CACHE INTERNAL "")
set(TEST_TARGET mbed-platform-stream)

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

project(${TEST_TARGET})
include(mbed_greentea)

mbed_greentea_add_test(
TEST_NAME
${TEST_TARGET}
mbed-platform-stream
TEST_SOURCES
main.cpp
HOST_TESTS_DIR
"${CMAKE_CURRENT_LIST_DIR}/../../host_tests"
)
15 changes: 5 additions & 10 deletions platform/tests/TESTS/mbed_platform/Transaction/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
# 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)

set(MBED_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../../../.. CACHE INTERNAL "")
set(TEST_TARGET mbed-platform-transaction)

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

project(${TEST_TARGET})
include(mbed_greentea)

mbed_greentea_add_test(
TEST_NAME
${TEST_TARGET}
mbed-platform-transaction
TEST_SOURCES
main.cpp
HOST_TESTS_DIR
"${CMAKE_CURRENT_LIST_DIR}/../../host_tests"
)
17 changes: 8 additions & 9 deletions platform/tests/TESTS/mbed_platform/atomic/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
# 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-platform-atomic)

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

project(${TEST_TARGET})
if(MBED_GREENTEA_TEST_BAREMETAL)
set(TEST_SKIPPED "atomic test cases require a RTOS to run.")
endif()

mbed_greentea_add_test(
TEST_NAME
${TEST_TARGET}
mbed-platform-atomic
TEST_SOURCES
main.cpp
TEST_SKIPPED
${TEST_SKIPPED}
)
Loading