From 5d1985019f8e8f51a533ac3143a27baa7ef34aeb Mon Sep 17 00:00:00 2001 From: David Saada Date: Wed, 9 Jan 2019 16:25:13 +0200 Subject: [PATCH] Remove kvstore's mbed_lib.json file (not relevant any more) In addition, use the NOT_SUPPORTED directive to skip the tests. --- .../kvstore/filesystemstore_tests/main.cpp | 10 +++---- .../kvstore/general_tests_phase_1/main.cpp | 13 +++------ .../kvstore/general_tests_phase_2/main.cpp | 13 +++------ .../kvstore/securestore_whitebox/main.cpp | 11 ++++---- .../TESTS/kvstore/static_tests/main.cpp | 4 --- .../TESTS/kvstore/tdbstore_whitebox/main.cpp | 4 --- features/storage/kvstore/mbed_lib.json | 27 ------------------- 7 files changed, 16 insertions(+), 66 deletions(-) delete mode 100644 features/storage/kvstore/mbed_lib.json diff --git a/features/storage/TESTS/kvstore/filesystemstore_tests/main.cpp b/features/storage/TESTS/kvstore/filesystemstore_tests/main.cpp index 184ca7b121..4c718a8d23 100644 --- a/features/storage/TESTS/kvstore/filesystemstore_tests/main.cpp +++ b/features/storage/TESTS/kvstore/filesystemstore_tests/main.cpp @@ -27,8 +27,8 @@ #include "utest.h" #include -#if !KVSTORE_ENABLED -#error [NOT_SUPPORTED] KVStore needs to be enabled for this test +#if !defined(TARGET_K64F) +#error [NOT_SUPPORTED] Kvstore API tests run only on K64F devices #endif #define FSST_TEST_NUM_OF_THREADS 5 @@ -38,11 +38,7 @@ static const int heap_alloc_threshold_size = 4096; using namespace utest::v1; using namespace mbed; -BlockDevice *bd = NULL; - -#if defined(TARGET_K64F) -bd = BlockDevice::get_default_instance(); -#endif +BlockDevice *bd = BlockDevice::get_default_instance(); typedef struct { int thread_num; diff --git a/features/storage/TESTS/kvstore/general_tests_phase_1/main.cpp b/features/storage/TESTS/kvstore/general_tests_phase_1/main.cpp index 6260e5e98a..6f5f3bf9ab 100644 --- a/features/storage/TESTS/kvstore/general_tests_phase_1/main.cpp +++ b/features/storage/TESTS/kvstore/general_tests_phase_1/main.cpp @@ -26,13 +26,13 @@ #include "utest/utest.h" #include "FileSystemStore.h" -#if !KVSTORE_ENABLED -#error [NOT_SUPPORTED] KVStore needs to be enabled for this test -#endif - using namespace utest::v1; using namespace mbed; +#if !defined(TARGET_K64F) +#error [NOT_SUPPORTED] Kvstore API tests run only on K64F devices +#endif + static const char data[] = "data"; static const char key[] = "key"; static char buffer[20] = {}; @@ -73,11 +73,6 @@ static const int heap_alloc_threshold_size = 4096; //init the blockdevice static void kvstore_init() { - -#if !defined(TARGET_K64F) - TEST_SKIP_MESSAGE("Kvstore API tests run only on K64F devices"); -#endif - int res; res = bd->init(); diff --git a/features/storage/TESTS/kvstore/general_tests_phase_2/main.cpp b/features/storage/TESTS/kvstore/general_tests_phase_2/main.cpp index 0e1c777ea0..fbfaad9f8c 100644 --- a/features/storage/TESTS/kvstore/general_tests_phase_2/main.cpp +++ b/features/storage/TESTS/kvstore/general_tests_phase_2/main.cpp @@ -26,13 +26,13 @@ #include "utest/utest.h" #include "FileSystemStore.h" -#if !KVSTORE_ENABLED -#error [NOT_SUPPORTED] KVStore needs to be enabled for this test -#endif - using namespace utest::v1; using namespace mbed; +#if !defined(TARGET_K64F) +#error [NOT_SUPPORTED] Kvstore API tests run only on K64F devices +#endif + static const char data[] = "data"; static const char key[] = "key"; static char buffer[20] = {}; @@ -73,11 +73,6 @@ static const int heap_alloc_threshold_size = 4096; //init the blockdevice static void kvstore_init() { - -#if !defined(TARGET_K64F) - TEST_SKIP_MESSAGE("Kvstore API tests run only on K64F devices"); -#endif - int res; res = bd->init(); diff --git a/features/storage/TESTS/kvstore/securestore_whitebox/main.cpp b/features/storage/TESTS/kvstore/securestore_whitebox/main.cpp index 364deb94fa..be8319b973 100644 --- a/features/storage/TESTS/kvstore/securestore_whitebox/main.cpp +++ b/features/storage/TESTS/kvstore/securestore_whitebox/main.cpp @@ -34,7 +34,11 @@ #include #include -#if !SECURESTORE_ENABLED || !KVSTORE_ENABLED +#if !defined(TARGET_K64F) +#error [NOT_SUPPORTED] Kvstore API tests run only on K64F devices +#endif + +#if !SECURESTORE_ENABLED #error [NOT_SUPPORTED] KVStore & SecureStore need to be enabled for this test #endif @@ -92,11 +96,6 @@ static const char *const key7_val1 = "7 is a lucky number"; static void white_box_test() { - -#if !defined(TARGET_K64F) - TEST_SKIP_MESSAGE("Kvstore API tests run only on K64F devices"); -#endif - uint8_t get_buf[256]; size_t actual_data_size; int result; diff --git a/features/storage/TESTS/kvstore/static_tests/main.cpp b/features/storage/TESTS/kvstore/static_tests/main.cpp index 166567604a..db6379c8b3 100644 --- a/features/storage/TESTS/kvstore/static_tests/main.cpp +++ b/features/storage/TESTS/kvstore/static_tests/main.cpp @@ -22,10 +22,6 @@ #include "utest/utest.h" #include "kvstore_global_api.h" -#if !KVSTORE_ENABLED -#error [NOT_SUPPORTED] KVStore needs to be enabled for this test -#endif - using namespace utest::v1; using namespace mbed; diff --git a/features/storage/TESTS/kvstore/tdbstore_whitebox/main.cpp b/features/storage/TESTS/kvstore/tdbstore_whitebox/main.cpp index af99aee851..eb43e6c601 100644 --- a/features/storage/TESTS/kvstore/tdbstore_whitebox/main.cpp +++ b/features/storage/TESTS/kvstore/tdbstore_whitebox/main.cpp @@ -33,10 +33,6 @@ #include #include -#if !KVSTORE_ENABLED -#error [NOT_SUPPORTED] KVStore needs to be enabled for this test -#endif - using namespace mbed; using namespace utest::v1; diff --git a/features/storage/kvstore/mbed_lib.json b/features/storage/kvstore/mbed_lib.json deleted file mode 100644 index 5b8884e85b..0000000000 --- a/features/storage/kvstore/mbed_lib.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "name": "kvstore", - "config": { - "enabled": { - "macro_name": "KVSTORE_ENABLED", - "value": true, - "help": "Enabled" - } - }, - "target_overrides": { - "REALTEK_RTL8195AM": { - "enabled": false - }, - "NRF51_DK": { - "enabled": false - }, - "KL82Z": { - "enabled": false - }, - "USENSE": { - "enabled": false - }, - "NCS36510": { - "enabled": false - } - } -}