From d42e9287defde76341e4d7f055add755c1bbe017 Mon Sep 17 00:00:00 2001 From: Hugues Kamba Date: Thu, 24 Dec 2020 15:34:55 +0000 Subject: [PATCH] CMake: Add support for Blockdevice Greentea tests The Blockdevice Greentea tests can now be built with CMake --- .../buffered_block_device/CMakeLists.txt | 17 +++++++ .../flashsim_block_device/CMakeLists.txt | 17 +++++++ .../general_block_device/CMakeLists.txt | 47 +++++++++++++++++++ .../heap_block_device/CMakeLists.txt | 17 +++++++ .../mbr_block_device/CMakeLists.txt | 17 +++++++ .../util_block_device/CMakeLists.txt | 17 +++++++ 6 files changed, 132 insertions(+) create mode 100644 storage/blockdevice/tests/TESTS/blockdevice/buffered_block_device/CMakeLists.txt create mode 100644 storage/blockdevice/tests/TESTS/blockdevice/flashsim_block_device/CMakeLists.txt create mode 100644 storage/blockdevice/tests/TESTS/blockdevice/general_block_device/CMakeLists.txt create mode 100644 storage/blockdevice/tests/TESTS/blockdevice/heap_block_device/CMakeLists.txt create mode 100644 storage/blockdevice/tests/TESTS/blockdevice/mbr_block_device/CMakeLists.txt create mode 100644 storage/blockdevice/tests/TESTS/blockdevice/util_block_device/CMakeLists.txt diff --git a/storage/blockdevice/tests/TESTS/blockdevice/buffered_block_device/CMakeLists.txt b/storage/blockdevice/tests/TESTS/blockdevice/buffered_block_device/CMakeLists.txt new file mode 100644 index 0000000000..0f7889c3ee --- /dev/null +++ b/storage/blockdevice/tests/TESTS/blockdevice/buffered_block_device/CMakeLists.txt @@ -0,0 +1,17 @@ +# Copyright (c) 2020 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-storage-blockdevice-buffered_block_device) + +include(${MBED_PATH}/tools/cmake/mbed_greentea.cmake) + +project(${TEST_TARGET}) + +mbed_greentea_cmake_macro( + TEST_NAME ${TEST_TARGET} + TEST_REQUIRED_LIBS + mbed-storage-blockdevice +) diff --git a/storage/blockdevice/tests/TESTS/blockdevice/flashsim_block_device/CMakeLists.txt b/storage/blockdevice/tests/TESTS/blockdevice/flashsim_block_device/CMakeLists.txt new file mode 100644 index 0000000000..814c9194bc --- /dev/null +++ b/storage/blockdevice/tests/TESTS/blockdevice/flashsim_block_device/CMakeLists.txt @@ -0,0 +1,17 @@ +# Copyright (c) 2020 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-storage-blockdevice-flashsim_block_device) + +include(${MBED_PATH}/tools/cmake/mbed_greentea.cmake) + +project(${TEST_TARGET}) + +mbed_greentea_cmake_macro( + TEST_NAME ${TEST_TARGET} + TEST_REQUIRED_LIBS + mbed-storage-blockdevice +) diff --git a/storage/blockdevice/tests/TESTS/blockdevice/general_block_device/CMakeLists.txt b/storage/blockdevice/tests/TESTS/blockdevice/general_block_device/CMakeLists.txt new file mode 100644 index 0000000000..02c4a75206 --- /dev/null +++ b/storage/blockdevice/tests/TESTS/blockdevice/general_block_device/CMakeLists.txt @@ -0,0 +1,47 @@ +# Copyright (c) 2020 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-storage-blockdevice-general_block_device) + +include(${MBED_PATH}/tools/cmake/mbed_greentea.cmake) + +project(${TEST_TARGET}) + +if("DATAFLASH" IN_LIST MBED_TARGET_LABELS) + list(APPEND mbed_blockdevice_libs mbed-storage-dataflash) +endif() + +if("FLASHIAP" IN_LIST MBED_TARGET_LABELS) + list(APPEND mbed_blockdevice_libs mbed-storage-flashiap) +endif() + +if("I2CEE" IN_LIST MBED_TARGET_LABELS) + list(APPEND mbed_blockdevice_libs mbed-storage-i2cee) +endif() + +if("OSPIF" IN_LIST MBED_TARGET_LABELS) + list(APPEND mbed_blockdevice_libs mbed-storage-ospif) +endif() + +if("QSPIF" IN_LIST MBED_TARGET_LABELS) + list(APPEND mbed_blockdevice_libs mbed-storage-qspif) +endif() + +if("SD" IN_LIST MBED_TARGET_LABELS) + list(APPEND mbed_blockdevice_libs mbed-storage-sd) +endif() + +if("SPIF" IN_LIST MBED_TARGET_LABELS) + list(APPEND mbed_blockdevice_libs mbed-storage-spif) +endif() + +mbed_greentea_cmake_macro( + TEST_NAME ${TEST_TARGET} + TEST_REQUIRED_LIBS + mbed-storage-blockdevice + mbed-storage + ${mbed_blockdevice_libs} +) diff --git a/storage/blockdevice/tests/TESTS/blockdevice/heap_block_device/CMakeLists.txt b/storage/blockdevice/tests/TESTS/blockdevice/heap_block_device/CMakeLists.txt new file mode 100644 index 0000000000..889c770f52 --- /dev/null +++ b/storage/blockdevice/tests/TESTS/blockdevice/heap_block_device/CMakeLists.txt @@ -0,0 +1,17 @@ +# Copyright (c) 2020 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-storage-blockdevice-heap_block_device) + +include(${MBED_PATH}/tools/cmake/mbed_greentea.cmake) + +project(${TEST_TARGET}) + +mbed_greentea_cmake_macro( + TEST_NAME ${TEST_TARGET} + TEST_REQUIRED_LIBS + mbed-storage-blockdevice +) diff --git a/storage/blockdevice/tests/TESTS/blockdevice/mbr_block_device/CMakeLists.txt b/storage/blockdevice/tests/TESTS/blockdevice/mbr_block_device/CMakeLists.txt new file mode 100644 index 0000000000..baf4678913 --- /dev/null +++ b/storage/blockdevice/tests/TESTS/blockdevice/mbr_block_device/CMakeLists.txt @@ -0,0 +1,17 @@ +# Copyright (c) 2020 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-storage-blockdevice-mbr_block_device) + +include(${MBED_PATH}/tools/cmake/mbed_greentea.cmake) + +project(${TEST_TARGET}) + +mbed_greentea_cmake_macro( + TEST_NAME ${TEST_TARGET} + TEST_REQUIRED_LIBS + mbed-storage-blockdevice +) diff --git a/storage/blockdevice/tests/TESTS/blockdevice/util_block_device/CMakeLists.txt b/storage/blockdevice/tests/TESTS/blockdevice/util_block_device/CMakeLists.txt new file mode 100644 index 0000000000..f52e941fd7 --- /dev/null +++ b/storage/blockdevice/tests/TESTS/blockdevice/util_block_device/CMakeLists.txt @@ -0,0 +1,17 @@ +# Copyright (c) 2020 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-storage-blockdevice-util_block_device) + +include(${MBED_PATH}/tools/cmake/mbed_greentea.cmake) + +project(${TEST_TARGET}) + +mbed_greentea_cmake_macro( + TEST_NAME ${TEST_TARGET} + TEST_REQUIRED_LIBS + mbed-storage-blockdevice +)