Skip to content
Closed
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
7 changes: 4 additions & 3 deletions .astyleignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
^features/netsocket/ppp/include
^features/netsocket/ppp/polarssl
^features/netsocket/ppp/source
^features/storage/filesystem/fat/ChaN
^features/storage/filesystem/littlefs/littlefs/
^features/storage/filesystem/littlefsv2/littlefs/
^storage/filesystem/fat/ChaN
^storage/filesystem/littlefs/littlefs/
^storage/filesystem/littlefsv2/littlefs/
^features/unsupported/
^hal/storage_abstraction
^platform/cxxsupport
Expand All @@ -27,3 +27,4 @@
^TESTS/mbed_hal/trng/pithy
^tools
^UNITTESTS
^storage/blockdevice/tests/UNITTESTS
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ matrix:

- <<: *extended-vm
name: "littlefs"
env: NAME=littlefs LITTLEFS=features/storage/filesystem/littlefs
env: NAME=littlefs LITTLEFS=storage/filesystem/littlefs
install:
# Install gcc
- source_pkg gcc
Expand Down
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ Folders containing files under different permissive license than Apache 2.0 are
- [features/lorawan](./features/lorawan) - Revised BSD
- [features/lwipstack](./features/lwipstack) - BSD-style, MIT-style
- [features/nanostack/sal-stack-nanostack](./features/nanostack/sal-stack-nanostack) - BSD-3-Clause
- [features/storage](./features/storage) - BSD-style, MIT
- [features/netsocket/emac-drivers](./features/netsocket/emac-drivers) - BSD-style
- [features/frameworks/unity/unity](./features/frameworks/unity/unity) - MIT
- [features/unsupported](./features/unsupported) - MIT-style, BSD-style
- [storage](./storage) - BSD-style, MIT
- [rtos](./rtos) - MIT
- [drivers](./drivers) - MIT
- [TESTS/mbed_hal/trng/pithy](./TESTS/mbed_hal/trng/pithy) - BSD-3-Clause
Expand Down
11 changes: 8 additions & 3 deletions UNITTESTS/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,10 @@ set(unittest-includes-base
"${PROJECT_SOURCE_DIR}/../features"
"${PROJECT_SOURCE_DIR}/../features/netsocket"
"${PROJECT_SOURCE_DIR}/../platform"
"${PROJECT_SOURCE_DIR}/../storage/filesystem/littlefs/include"
"${PROJECT_SOURCE_DIR}/../storage/filesystem/fat/include"
"${PROJECT_SOURCE_DIR}/../storage/blockdevice/include"
"${PROJECT_SOURCE_DIR}/../storage/filesystem/include"
"${PROJECT_SOURCE_DIR}/../drivers"
"${PROJECT_SOURCE_DIR}/../hal"
"${PROJECT_SOURCE_DIR}/../events"
Expand Down Expand Up @@ -144,15 +148,15 @@ set(unittest-includes-base
"${PROJECT_SOURCE_DIR}/../features/lorawan/system"
"${PROJECT_SOURCE_DIR}/../features/mbedtls"
"${PROJECT_SOURCE_DIR}/../features/mbedtls/inc"
"${PROJECT_SOURCE_DIR}/../features/storage/kvstore/conf"
"${PROJECT_SOURCE_DIR}/../storage/kvstore/conf"
)

# Create a list for test suites.
set(TEST_SUITES)

# Get all matched tests.
file(GLOB_RECURSE unittest-file-list
"unittest.cmake"
"../unittest.cmake" # matches any ../**/unittest.cmake
)

if ("${unittest-file-list}" STREQUAL "")
Expand All @@ -175,10 +179,11 @@ foreach(testfile ${unittest-file-list})
include("${testfile}")

get_filename_component(TEST_SUITE_DIR ${testfile} DIRECTORY)
message( STATUS ${PROJECT_SOURCE_DIR} )

file(RELATIVE_PATH
TEST_SUITE_NAME # output
${PROJECT_SOURCE_DIR} # root
"${PROJECT_SOURCE_DIR}/.."
${TEST_SUITE_DIR} #abs dirpath
)

Expand Down
36 changes: 8 additions & 28 deletions UNITTESTS/empty_baseline/unittest.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -12,34 +12,14 @@ set(unittest-includes ${unittest-includes}
)

set(unittest-sources
../features/device_key/source/DeviceKey.cpp
../components/storage/blockdevice/COMPONENT_SPIF/SPIFBlockDevice.cpp
../components/storage/blockdevice/COMPONENT_I2CEE/I2CEEBlockDevice.cpp
../components/storage/blockdevice/COMPONENT_DATAFLASH/DataFlashBlockDevice.cpp
../components/storage/blockdevice/COMPONENT_FLASHIAP/FlashIAPBlockDevice.cpp
../components/storage/blockdevice/COMPONENT_SD/SDBlockDevice.cpp
../components/storage/blockdevice/COMPONENT_QSPIF/QSPIFBlockDevice.cpp
../features/storage/filesystem/Dir.cpp
../features/storage/filesystem/FileSystem.cpp
../features/storage/filesystem/File.cpp
../features/storage/kvstore/global_api/kvstore_global_api.cpp
../features/storage/kvstore/securestore/SecureStore.cpp
../features/storage/kvstore/kv_map/KVMap.cpp
../features/storage/kvstore/tdbstore/TDBStore.cpp
../features/storage/kvstore/direct_access_devicekey/DirectAccessDevicekey.cpp
../features/storage/kvstore/conf/kv_config.cpp
../features/storage/kvstore/filesystemstore/FileSystemStore.cpp
../features/storage/system_storage/SystemStorage.cpp
../features/storage/blockdevice/ChainingBlockDevice.cpp
../features/storage/blockdevice/ReadOnlyBlockDevice.cpp
../features/storage/blockdevice/SlicingBlockDevice.cpp
../features/storage/blockdevice/MBRBlockDevice.cpp
../features/storage/blockdevice/HeapBlockDevice.cpp
../features/storage/blockdevice/FlashSimBlockDevice.cpp
../features/storage/blockdevice/ObservingBlockDevice.cpp
../features/storage/blockdevice/ProfilingBlockDevice.cpp
../features/storage/blockdevice/BufferedBlockDevice.cpp
../features/storage/blockdevice/ExhaustibleBlockDevice.cpp
../storage/kvstore/global_api/kvstore_global_api.cpp
../storage/kvstore/securestore/SecureStore.cpp
../storage/kvstore/kv_map/KVMap.cpp
../storage/kvstore/tdbstore/TDBStore.cpp
../storage/kvstore/direct_access_devicekey/DirectAccessDevicekey.cpp
../storage/kvstore/conf/kv_config.cpp
../storage/kvstore/filesystemstore/FileSystemStore.cpp
../storage/system_storage/SystemStorage.cpp
)

set(unittest-test-sources
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
*/

#include "gtest/gtest.h"
#include "features/storage/blockdevice/HeapBlockDevice.h"
#include "features/storage/kvstore/filesystemstore/FileSystemStore.h"
#include "features/storage/filesystem/littlefs/LittleFileSystem.h"
#include "blockdevice/HeapBlockDevice.h"
#include "storage/kvstore/filesystemstore/FileSystemStore.h"
#include "littlefs/LittleFileSystem.h"
#include "mbed_error.h"
#include <stdlib.h>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ set(unittest-includes ${unittest-includes}
)

set(unittest-sources
../features/storage/blockdevice/HeapBlockDevice.cpp
../features/storage/kvstore/filesystemstore/FileSystemStore.cpp
../features/storage/filesystem/littlefs/LittleFileSystem.cpp
../features/storage/filesystem/Dir.cpp
../features/storage/filesystem/File.cpp
../features/storage/filesystem/FileSystem.cpp
../storage/blockdevice/source/HeapBlockDevice.cpp
../storage/kvstore/filesystemstore/FileSystemStore.cpp
../storage/filesystem/littlefs/source/LittleFileSystem.cpp
../storage/filesystem/source/Dir.cpp
../storage/filesystem/source/File.cpp
../storage/filesystem/source/FileSystem.cpp
../features/frameworks/mbed-trace/source/mbed_trace.c
../features/storage/filesystem/littlefs/littlefs/lfs_util.c
../features/storage/filesystem/littlefs/littlefs/lfs.c
../storage/filesystem/littlefs/littlefs/lfs_util.c
../storage/filesystem/littlefs/littlefs/lfs.c
../platform/source/FileBase.cpp
../platform/source/FileSystemHandle.cpp
../platform/source/FileHandle.cpp
Expand Down
6 changes: 3 additions & 3 deletions UNITTESTS/moduletests/storage/kvstore/TDBStore/moduletest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
*/

#include "gtest/gtest.h"
#include "features/storage/blockdevice/HeapBlockDevice.h"
#include "features/storage/blockdevice/FlashSimBlockDevice.h"
#include "features/storage/kvstore/tdbstore/TDBStore.h"
#include "blockdevice/HeapBlockDevice.h"
#include "blockdevice/FlashSimBlockDevice.h"
#include "storage/kvstore/tdbstore/TDBStore.h"
#include <stdlib.h>

#define BLOCK_SIZE (512)
Expand Down
8 changes: 4 additions & 4 deletions UNITTESTS/moduletests/storage/kvstore/TDBStore/unittest.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ set(unittest-includes ${unittest-includes}
)

set(unittest-sources
../features/storage/blockdevice/FlashSimBlockDevice.cpp
../features/storage/blockdevice/HeapBlockDevice.cpp
../features/storage/blockdevice/BufferedBlockDevice.cpp
../features/storage/kvstore/tdbstore/TDBStore.cpp
../storage/blockdevice/source/FlashSimBlockDevice.cpp
../storage/blockdevice/source/HeapBlockDevice.cpp
../storage/blockdevice/source/BufferedBlockDevice.cpp
../storage/kvstore/tdbstore/TDBStore.cpp
../features/frameworks/mbed-trace/source/mbed_trace.c
stubs/mbed_atomic_stub.c
stubs/mbed_assert_stub.cpp
Expand Down
2 changes: 1 addition & 1 deletion UNITTESTS/stubs/BlockDevice_mock.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

#include "gtest/gtest.h"
#include "gmock/gmock.h"
#include "features/storage/blockdevice/BlockDevice.h"
#include "blockdevice/BlockDevice.h"

class BlockDeviceMock : public BlockDevice {
public:
Expand Down
2 changes: 1 addition & 1 deletion UNITTESTS/stubs/EmulatedSD.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#ifndef EMULATEDSD_H
#define EMULATEDSD_H

#include "features/storage/blockdevice/BlockDevice.h"
#include "blockdevice/BlockDevice.h"

class EmulatedSD_Private;

Expand Down
2 changes: 1 addition & 1 deletion UNITTESTS/stubs/kv_config_stub.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

#include "features/storage/kvstore/conf/kv_config.h"
#include "storage/kvstore/conf/kv_config.h"

const char *get_filesystemstore_folder_path()
{
Expand Down
2 changes: 1 addition & 1 deletion drivers/internal/SFDP.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

#include <cstddef>
#include <cstdint>
#include "features/storage/blockdevice/BlockDevice.h"
#include "blockdevice/BlockDevice.h"
#include "platform/Callback.h"

namespace mbed {
Expand Down
8 changes: 4 additions & 4 deletions features/device_key/source/DeviceKey.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
#if DEVICEKEY_ENABLED
#include "mbedtls/cmac.h"
#include "mbedtls/platform.h"
#include "features/storage/kvstore/include/KVStore.h"
#include "features/storage/kvstore/tdbstore/TDBStore.h"
#include "features/storage/kvstore/kv_map/KVMap.h"
#include "features/storage/kvstore/conf/kv_config.h"
#include "storage/kvstore/include/KVStore.h"
#include "storage/kvstore/tdbstore/TDBStore.h"
#include "storage/kvstore/kv_map/KVMap.h"
#include "storage/kvstore/conf/kv_config.h"
#include "mbed_wait_api.h"
#include <stdlib.h>
#include "platform/mbed_error.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

#include "platform/PlatformMutex.h"
#include "PinNames.h"
#include "features/storage/blockdevice/BlockDevice.h"
#include "blockdevice/BlockDevice.h"
#include "drivers/SPI.h"
#include "drivers/DigitalOut.h"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#if DEVICE_FLASH

#include "FlashIAP.h"
#include "features/storage/blockdevice/BlockDevice.h"
#include "blockdevice/BlockDevice.h"
#include "platform/mbed_toolchain.h"

/** BlockDevice using the FlashIAP API
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#ifndef MBED_I2CEEPROM_BLOCK_DEVICE_H
#define MBED_I2CEEPROM_BLOCK_DEVICE_H

#include "features/storage/blockdevice/BlockDevice.h"
#include "blockdevice/BlockDevice.h"
#include "drivers/I2C.h"

/** BlockDevice for I2C based flash device such as
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

#include "drivers/QSPI.h"
#include "drivers/internal/SFDP.h"
#include "features/storage/blockdevice/BlockDevice.h"
#include "blockdevice/BlockDevice.h"
#include "platform/Callback.h"

#ifndef MBED_CONF_QSPIF_QSPI_IO0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
/* If the target has no SPI support, then SD Card is not supported. */
#if DEVICE_SPI

#include "features/storage/blockdevice/BlockDevice.h"
#include "blockdevice/BlockDevice.h"
#include "drivers/SPI.h"
#include "drivers/Timer.h"
#include "drivers/MbedCRC.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include "drivers/SPI.h"
#include "drivers/DigitalOut.h"
#include "drivers/internal/SFDP.h"
#include "features/storage/blockdevice/BlockDevice.h"
#include "blockdevice/BlockDevice.h"

#ifndef MBED_CONF_SPIF_DRIVER_SPI_MOSI
#define MBED_CONF_SPIF_DRIVER_SPI_MOSI NC
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

#include "BufferedBlockDevice.h"
#include "blockdevice/BufferedBlockDevice.h"
#include "platform/mbed_assert.h"
#include "platform/mbed_atomic.h"
#include <algorithm>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

#include "ChainingBlockDevice.h"
#include "blockdevice/ChainingBlockDevice.h"
#include "platform/mbed_atomic.h"
#include "platform/mbed_assert.h"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

#include "ExhaustibleBlockDevice.h"
#include "blockdevice/ExhaustibleBlockDevice.h"
#include "platform/mbed_atomic.h"
#include "platform/mbed_assert.h"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

#include "FlashSimBlockDevice.h"
#include "blockdevice/FlashSimBlockDevice.h"
#include "platform/mbed_assert.h"
#include "platform/mbed_atomic.h"
#include <algorithm>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

#include "HeapBlockDevice.h"
#include "blockdevice/HeapBlockDevice.h"
#include "platform/mbed_atomic.h"
#include <stdlib.h>
#include <string.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

#include "MBRBlockDevice.h"
#include "blockdevice/MBRBlockDevice.h"
#include "platform/mbed_atomic.h"
#include "platform/mbed_toolchain.h"
#include "platform/mbed_assert.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
* SOFTWARE.
*/

#include "ObservingBlockDevice.h"
#include "ReadOnlyBlockDevice.h"
#include "blockdevice/ObservingBlockDevice.h"
#include "blockdevice/ReadOnlyBlockDevice.h"

namespace mbed {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

#include "ProfilingBlockDevice.h"
#include "blockdevice/ProfilingBlockDevice.h"
#include "stddef.h"

namespace mbed {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
/** \addtogroup storage */
/** @{*/

#include "ReadOnlyBlockDevice.h"
#include "blockdevice/ReadOnlyBlockDevice.h"
#include "platform/mbed_error.h"

namespace mbed {
Expand Down
Loading