-
Notifications
You must be signed in to change notification settings - Fork 7.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feature/storage_host_test' into 'master'
spiffs: convert host tests from Make to CMake See merge request espressif/esp-idf!19786
- Loading branch information
Showing
19 changed files
with
188 additions
and
285 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
|
||
# Core Components | ||
|
||
## Overview | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
components/spiffs/host_test: | ||
enable: | ||
- if: IDF_TARGET == "linux" | ||
reason: only test on linux |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
cmake_minimum_required(VERSION 3.16) | ||
|
||
include($ENV{IDF_PATH}/tools/cmake/project.cmake) | ||
set(COMPONENTS main) | ||
# Freertos is included via common components, however, currently only the mock component is compatible with linux | ||
# target. | ||
list(APPEND EXTRA_COMPONENT_DIRS "$ENV{IDF_PATH}/tools/mocks/freertos/") | ||
|
||
project(host_test_spiffs) | ||
|
||
# Custom procedure to build/clean image.bin | ||
add_custom_target(image.bin) | ||
|
||
# Expand image.bin to the same size as "spiffs" partition in partition_table.csv - 2*1024*1024 = 2097152 = 2M | ||
add_custom_command( | ||
TARGET image.bin | ||
POST_BUILD | ||
COMMAND python ../../spiffsgen.py 2097152 ../../spiffs ../image.bin | ||
) | ||
|
||
set_property( | ||
DIRECTORY | ||
APPEND PROPERTY ADDITIONAL_CLEAN_FILES "../image.bin") | ||
|
||
add_dependencies(host_test_spiffs.elf partition-table image.bin) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
| Supported Targets | Linux | | ||
| ----------------- | ----- | | ||
|
||
This is a test project for spiffs-related APIs on Linux target (CONFIG_IDF_TARGET_LINUX). | ||
|
||
# Build | ||
Source the IDF environment as usual. | ||
|
||
Once this is done, build the application: | ||
```bash | ||
idf.py build | ||
``` | ||
|
||
# Run | ||
```bash | ||
build/host_test_spiffs.elf | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
idf_component_register(SRCS "host_test_spiffs.c" | ||
PRIV_INCLUDE_DIRS "../.." "../../spiffs/src" | ||
REQUIRES spiffs unity) |
Oops, something went wrong.