Skip to content

Restructure storage kvstore directory #13307

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

Merged
merged 5 commits into from
Jul 23, 2020
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
1 change: 1 addition & 0 deletions .astyleignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,4 @@
^tools
^UNITTESTS
^storage/blockdevice/tests/UNITTESTS
^storage/kvstore/tests/UNITTESTS
5 changes: 1 addition & 4 deletions TESTS/configs/baremetal.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,12 @@
"network-emac",
"flashiap-block-device",
"system-storage",
"filesystemstore",
"SecureStore",
"storage",
"kv-map",
"kv-global-api",
"direct-access-devicekey",
"tdbstore",
"kv-config",
"events",
"kv-global-api",
"sd",
"qspif",
"spif-driver",
Expand Down
4 changes: 3 additions & 1 deletion UNITTESTS/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,9 @@ set(unittest-includes-base
"${PROJECT_SOURCE_DIR}/../storage/filesystem/fat/include"
"${PROJECT_SOURCE_DIR}/../storage/blockdevice/include"
"${PROJECT_SOURCE_DIR}/../storage/filesystem/include"
"${PROJECT_SOURCE_DIR}/../storage/kvstore/include"
"${PROJECT_SOURCE_DIR}/../storage/kvstore/kv_config"
"${PROJECT_SOURCE_DIR}/../storage/kvstore/kv_config/include"
"${PROJECT_SOURCE_DIR}/../drivers"
"${PROJECT_SOURCE_DIR}/../hal"
"${PROJECT_SOURCE_DIR}/../events"
Expand Down Expand Up @@ -146,7 +149,6 @@ set(unittest-includes-base
"${PROJECT_SOURCE_DIR}/../features/lorawan/system"
"${PROJECT_SOURCE_DIR}/../features/mbedtls"
"${PROJECT_SOURCE_DIR}/../features/mbedtls/inc"
"${PROJECT_SOURCE_DIR}/../storage/kvstore/conf"
)

# Create a list for test suites.
Expand Down
7 changes: 0 additions & 7 deletions UNITTESTS/empty_baseline/unittest.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,6 @@ set(unittest-includes ${unittest-includes}
)

set(unittest-sources
../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
)

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 "storage/kvstore/conf/kv_config.h"
#include "kv_config/kv_config.h"

const char *get_filesystemstore_folder_path()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"mbedtls",
"storage",
"flashiap-block-device",
"tdbstore",
"kv-global-api",
"storage_tdb_internal"
]
}
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 "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 "kvstore/KVStore.h"
#include "kvstore/TDBStore.h"
#include "kvstore/KVMap.h"
#include "kv_config/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 @@ -16,7 +16,7 @@

// ----------------------------------------------------------- Includes -----------------------------------------------------------
#if DEVICE_FLASH
#include "DirectAccessDevicekey.h"
#include "direct_access_devicekey/DirectAccessDevicekey.h"
#include "drivers/FlashIAP.h"
#include <string.h>
#include <stdio.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@
#include <stdio.h>
#include <string.h>
#include "DeviceKey.h"
#include "KVStore.h"
#include "KVMap.h"
#include "kv_config.h"
#include "TDBStore.h"
#include "kvstore/KVStore.h"
#include "kvstore/KVMap.h"
#include "kv_config/kv_config.h"
#include "kvstore/TDBStore.h"
#include "FlashIAP.h"
#include "FlashIAPBlockDevice.h"
#include "DirectAccessDevicekey.h"
#include "direct_access_devicekey/DirectAccessDevicekey.h"
#include "greentea-client/test_env.h"
#include "unity.h"
#include "utest.h"
Expand Down
3 changes: 0 additions & 3 deletions storage/kvstore/filesystemstore/mbed_lib.json

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#ifndef MBED_FILE_SYSTEM_STORE_H
#define MBED_FILE_SYSTEM_STORE_H

#include "storage/kvstore/include/KVStore.h"
#include "kvstore/KVStore.h"
#include "filesystem/FileSystem.h"

namespace mbed {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#ifndef _KV_MAP
#define _KV_MAP

#include "storage/kvstore/include/KVStore.h"
#include "kvstore/KVStore.h"
#include "platform/PlatformMutex.h"
#include "platform/SingletonPtr.h"
#include "blockdevice/BlockDevice.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

#include <stdint.h>
#include <stdio.h>
#include "storage/kvstore/include/KVStore.h"
#include "kvstore/KVStore.h"
#include "blockdevice/BlockDevice.h"
#include "blockdevice/BufferedBlockDevice.h"
#include "PlatformMutex.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"external_base_address": {
"help": "The default will set start address to address 0",
"value": "0"
},
},
"mount_point": {
"help": "Where to mount the filesystem.",
"value": "kv"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"external_base_address": {
"help": "The default will set start address to address 0",
"value": "0"
},
},
"mount_point": {
"help": "Where to mount the filesystem.",
"value": "kv"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,20 @@
*/

#include "kv_config.h"
#include "storage/kvstore/include/KVStore.h"
#include "storage/kvstore/kv_map/KVMap.h"
#include "kvstore/KVStore.h"
#include "kvstore/KVMap.h"
#include "blockdevice/BlockDevice.h"
#include "filesystem/FileSystem.h"
#include "storage/kvstore/filesystemstore/FileSystemStore.h"
#include "kvstore/FileSystemStore.h"
#include "blockdevice/SlicingBlockDevice.h"
#include "fat/FATFileSystem.h"
#include "littlefs/LittleFileSystem.h"
#include "storage/kvstore/tdbstore/TDBStore.h"
#include "kvstore/TDBStore.h"
#include "mbed_error.h"
#include "drivers/FlashIAP.h"
#include "blockdevice/FlashSimBlockDevice.h"
#include "mbed_trace.h"
#include "storage/kvstore/securestore/SecureStore.h"
#include "securestore/SecureStore.h"
#define TRACE_GROUP "KVCFG"

#if COMPONENT_FLASHIAP
Expand Down
3 changes: 0 additions & 3 deletions storage/kvstore/kv_map/mbed_lib.json

This file was deleted.

File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

// ----------------------------------------------------------- Includes -----------------------------------------------------------

#include "SecureStore.h"
#include "securestore/SecureStore.h"

#if SECURESTORE_ENABLED

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

#include "SecureStore.h"
#include "TDBStore.h"
#include "securestore/SecureStore.h"
#include "kvstore/TDBStore.h"
#ifdef MBED_CONF_RTOS_PRESENT
#include "Thread.h"
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
* limitations under the License.
*/

#include "FileSystemStore.h"
#include "storage/kvstore/conf/kv_config.h"
#include "kvstore/FileSystemStore.h"
#include "kv_config/kv_config.h"
#include "filesystem/Dir.h"
#include "filesystem/File.h"
#include "blockdevice/BlockDevice.h"
Expand Down Expand Up @@ -635,6 +635,3 @@ static char *string_ndup(const char *src, size_t size)
string_copy[size] = '\0';
return string_copy;
}



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

#include "storage/kvstore/include/KVStore.h"
#include "storage/kvstore/kv_map/KVMap.h"
#include "storage/kvstore/conf/kv_config.h"
#include "kvstore/KVStore.h"
#include "kvstore/KVMap.h"
#include "kv_config/kv_config.h"
#include <stdlib.h>
#include "string.h"
#include "mbed_error.h"
Expand Down Expand Up @@ -333,4 +333,3 @@ FileSystem *KVMap::get_external_filesystem_instance(const char *name)
}

} // namespace mbed

Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

// ----------------------------------------------------------- Includes -----------------------------------------------------------

#include "TDBStore.h"
#include "kvstore/TDBStore.h"

#include <algorithm>
#include <string.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
*/
#include "kvstore_global_api.h"

#include "storage/kvstore/conf/kv_config.h"
#include "storage/kvstore/kv_map/KVMap.h"
#include "storage/kvstore/include/KVStore.h"
#include "kv_config/kv_config.h"
#include "kvstore/KVMap.h"
#include "kvstore/KVStore.h"
#include "mbed_error.h"

using namespace mbed;
Expand Down Expand Up @@ -201,4 +201,3 @@ int kv_reset(const char *kvstore_name)
return ret;

}

3 changes: 0 additions & 3 deletions storage/kvstore/tdbstore/mbed_lib.json

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "SecureStore.h"
#include "TDBStore.h"
#include "securestore/SecureStore.h"
#include "kvstore/TDBStore.h"
#ifdef MBED_CONF_RTOS_PRESENT
#include "Thread.h"
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "SecureStore.h"
#include "TDBStore.h"
#include "securestore/SecureStore.h"
#include "kvstore/TDBStore.h"
#include "mbed_error.h"
#include "FlashSimBlockDevice.h"
#include "SlicingBlockDevice.h"
Expand Down
1 change: 1 addition & 0 deletions storage/kvstore/tests/UNITTESTS/.mbedignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

#include "gtest/gtest.h"
#include "blockdevice/HeapBlockDevice.h"
#include "storage/kvstore/filesystemstore/FileSystemStore.h"
#include "kvstore/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 @@ -10,7 +10,7 @@ set(unittest-includes ${unittest-includes}

set(unittest-sources
../storage/blockdevice/source/HeapBlockDevice.cpp
../storage/kvstore/filesystemstore/FileSystemStore.cpp
../storage/kvstore/source/FileSystemStore.cpp
../storage/filesystem/littlefs/source/LittleFileSystem.cpp
../storage/filesystem/source/Dir.cpp
../storage/filesystem/source/File.cpp
Expand All @@ -24,7 +24,7 @@ set(unittest-sources
)

set(unittest-test-sources
moduletests/storage/kvstore/FileSystemStore/moduletest.cpp
${CMAKE_CURRENT_LIST_DIR}/moduletest.cpp
stubs/mbed_atomic_stub.c
stubs/mbed_assert_stub.cpp
stubs/mbed_error.c
Expand All @@ -37,4 +37,4 @@ set(unittest-test-flags
-DMBED_LFS_PROG_SIZE=64
-DMBED_LFS_BLOCK_SIZE=512
-DMBED_LFS_LOOKAHEAD=512
)
)
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#include "gtest/gtest.h"
#include "blockdevice/HeapBlockDevice.h"
#include "blockdevice/FlashSimBlockDevice.h"
#include "storage/kvstore/tdbstore/TDBStore.h"
#include "kvstore/TDBStore.h"
#include <stdlib.h>

#define BLOCK_SIZE (512)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ set(unittest-sources
../storage/blockdevice/source/FlashSimBlockDevice.cpp
../storage/blockdevice/source/HeapBlockDevice.cpp
../storage/blockdevice/source/BufferedBlockDevice.cpp
../storage/kvstore/tdbstore/TDBStore.cpp
../storage/kvstore/source/TDBStore.cpp
../features/frameworks/mbed-trace/source/mbed_trace.c
stubs/mbed_atomic_stub.c
stubs/mbed_assert_stub.cpp
stubs/mbed_error.c
)

set(unittest-test-sources
moduletests/storage/kvstore/TDBStore/moduletest.cpp
${CMAKE_CURRENT_LIST_DIR}/moduletest.cpp
)

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")