Commit Graph

32 Commits

Author SHA1 Message Date
radek.tandler
8740888967 feat(nvs_flash): Added function nvs_find_key
Closes https://github.com/espressif/esp-idf/issues/12155
2023-12-08 17:12:00 +01:00
Ivan Grokhotkov
88e77ba1ed
ci(nvs_flash): upgrade to Catch2 as a component, fix warnings 2023-11-29 12:38:47 +01:00
radek.tandler
d4aa9ccb0c change(nvs_flash): Host tests were migrated from CMock to esp_partition linux emulation 2023-10-13 13:17:28 +02:00
Adam Múdry
ab1eb37fe8 feat(partition_table): Add read-only partition flag and functionality 2023-10-11 00:01:05 +02:00
radek.tandler
4f659b70e1 fix(nvs_flash): fixed failing nvs_page test 2023-09-26 15:05:20 +00:00
radek.tandler
e8992f500c fix(nvs_flash): nvs_set with same key and different data type
Function now always rewrites old value under same key
regardless existing data type. Users requiring old API behaviour
can enable it by kconfig option CONFIG_NVS_LEGACY_DUP_KEYS_COMPATIBILITY
2023-09-26 15:05:20 +00:00
Cody P Schafer
f2af1c5305 nvs: support iteration over namespace by index
Users of the nvs API are likely to have `nvs_handle_t` in all cases, but
not all of them carry around the partition name and namespace name (as
they aren't needed after creating an `nvs_handle_t`).

Allow this common case to use nvs iteration without them tracking
additional data by using the `nvs_handle_t` to locate the namespace
index and the partition name by introducing an alterate to
`nvs_entry_find` called `nvs_entry_find_in_handle`, which operates
similarly except that it is given a `nvs_handle_t` instead of partition
and namespace strings.

This is somewhat more limited than the `nvs_entry_find` API as one
cannot examine all keys in a given partition.
2023-08-29 13:59:34 +02:00
Martin Vychodil
e44d4260ad Merge branch 'feature/storage_host_test_nvs_flash2' into 'master'
nvs_flash: finished migration of host tests to the linux emulator of esp_partition

See merge request espressif/esp-idf!23926
2023-08-28 20:20:16 +08:00
radek.tandler
28f82d8de7 refactor(nvs_flash): Host test migrated to esp_partition emulation for linux 2023-08-09 14:14:21 +02:00
radek.tandler
ac6c03fad1 change(nvs_flash): nvs_get_stats extended, API documentation improved 2023-08-08 08:43:19 +02:00
Cody P Schafer
cbe906e53c
nvs_host_test: replace sprintf with snprintf
With some libc impls (ie: Xcode 13.1), sprintf is marked as deprecated
and causes the build with `-Werror` to fail. Switch the `sprintf` usage
in test_nvs.cpp to use `snprintf` to allow builds to complete without
warning.
2023-04-03 16:33:57 -04:00
Jakob Hasse
bed81f450d ci(nvs_flash): Increase timeout of nvs_page_test
* nvs_page_test runs into timeout in CI. According to log,
  test ran run around halfway, so increasing from 10 to 90 seconds.

* Also increased timeout of nvs_host_test, just to be sure
2023-02-13 12:35:52 +08:00
Martin Vychodil
a2b0068478 Merge branch 'bugfix/linux_build_errors' into 'master'
fix(linux): fix build errors without --skip-setting-flags

See merge request espressif/esp-idf!22063
2023-01-20 14:46:36 +08:00
Ivan Grokhotkov
cef0744299 Merge branch 'bugfix/linux_target_gen_partition_table' into 'master'
multiple fixes for linux target

Closes IDF-6641

See merge request espressif/esp-idf!21993
2023-01-18 11:57:08 +08:00
Jakob Hasse
9991862a10 fix(linux): fix build errors and warnings, remove ignore file 2023-01-18 09:24:28 +08:00
Fu Hanxi
b02687a6c4 test: migrate linux target host test jobs into pytest-embedded 2023-01-16 10:25:55 +08:00
Ivan Grokhotkov
e7540dbe0e
docs: remove the outdated "IDF monitor doesn't work on linux" notes 2023-01-13 08:14:56 +01:00
Ivan Grokhotkov
ec8f38c9da
build system: generate the partition table by default for linux target
This fixes the issue that "idf.py partition-table" had to be run
manually in order for the partition table to be generated, when
building for linux target.
2023-01-13 08:14:56 +01:00
Jakob Hasse
91f04aa877 refactor(nvs): custom allocator for all objects allocated in NVS 2022-12-05 18:59:33 +01:00
radek.tandler
ca7f073e7b nvs_flash/host_test: migrated to the CMake build system and nvs flash Linux implementation
Host tests of nvs_flash eligible to run in Linux implementation of nvs flash were migrated. Remaining test cases
were left in original folder. Migrated test cases use CMake instead of make.
2022-11-16 14:15:23 +01:00
Martin Vychodil
c9c7573f71 Storage: Partition APIs moved to the new component 'esp_partition'
All the partition handling API functions and data-types were moved from the 'spi_flash' component to the new one named 'esp_partition'. See Storage 5.x migration guide for more details
2022-11-02 21:54:45 +01:00
Ivan Grokhotkov
c392c06216
cmake: remove -D prefix from COMPILE_DEFINITIONS property
Unlike COMPILE_OPTIONS, COMPILE_DEFINITIONS CMake property assumes
values without the -D prefix, such as NAME or NAME=VAL.
Previously, IDF build system was passing COMPILE_DEFINITIONS build
property to CMake COMPILE_OPTIONS property, so -D prefix was not
a problem.
Now that COMPILE_DEFINITIONS CMake property is used, -D prefix has
to be removed.

(Note that this doesn't affect 'target_compile_definitions' function,
which strips -D prefix before adding the definition to the property.)
2022-09-20 11:08:02 +02:00
Shubham Kulkarni
3689035b7c tests: Fix CI build failures 2022-08-03 05:18:37 +00:00
Fu Hanxi
c0568611dd docs: changes docs supported targets tables 2022-07-14 08:26:32 +08:00
Djordje Nedic
facab8c5a7 tools: Increase the minimal supported CMake version to 3.16
This updates the minimal supported version of CMake to 3.16, which in turn enables us to use more CMake features and have a cleaner build system.
This is the version that provides most new features and also the one we use in our latest docker image for CI.
2022-06-01 06:35:02 +00:00
Matus Fabo
58cca07104 add: Kconfig assert or errorcode option
add: private include header
add: macro encapsulation for assertion or error check
add: ESP_FAIL return code documentation in public headers
change: replaced all assertions by NVS_ASSERT_OR_RETURN macro
change: few internal function return values from void to esp_err_t
change: ESP_ERR_NVS_VALUE_TOO_LONG macro comment
2022-05-28 20:29:05 +02:00
Jakob Hasse
46e59e7194 [mocks]: moved already added spi_flash mocks
[nvs]: page test works with new overriden mock

[spi_flash]: Removed mocking code from CMake

* Renamed nvs test to be consistent with other
  host test
2021-08-18 11:05:51 +08:00
Jakob Hasse
7029f0537e [build system]: Fixed common requirement for Linux 2021-08-13 16:50:29 +08:00
Jakob Hasse
de6b54de66 [nvs_flash]: Entries with state == 1 don't crash 2021-07-30 18:33:27 +08:00
Jakob Hasse
68393c41c4 doc: linux host test documentation 2021-04-23 09:27:35 +08:00
Jakob Hasse
2fb5b42eb1 [nvs] add nvs page host test to CI
Closes IDF-2425
2021-04-20 14:40:16 +08:00
Jakob Hasse
00819a3022 NVS flash: host-based unit test of nvs::Page
* General tests like page loading from flash
* Rough test of fixed-size data types
* Rough test of blob read
* Added coverage target in cmake, also accessible
  via `idf.py coverage`
* Fixed unsigned comparison in comp. enum table
* introducing temporary LINUX_TARGET define
2020-12-14 18:53:14 +08:00