| .. | ||
| python_tests | ||
| CMakeLists.txt | ||
| README.md | ||
| test_data_store.c | ||
Diagnostics data store unit tests
Please take a look at how to build, flash, and run esp-idf unit tests.
Follow the steps mentioned below to unit test the diagnostics data store
- Change to the unit test app directory
cd $IDF_PATH/tools/unit-test-app
- Append
/path/to/esp-insights/componentsdirectory toEXTRA_COMPONENT_DIRSinCMakeLists.txt
Required configuration to unit test RTC store
- Let's add the config option for RTC store in sdkconfig.defaults.
echo CONFIG_DIAG_DATA_STORE_RTC=y >> $IDF_PATH/tools/unit-test-app/sdkconfig.defaults
Required configuration to unit test flash store
- Let's add the config option for Flash store in sdkconfig.defaults.
echo CONFIG_DIAG_DATA_STORE_FLASH=y >> $IDF_PATH/tools/unit-test-app/sdkconfig.defaults
- Flash store requires the partition table entry of at lease 16KB, include the below line at the end of partition table csv file
diag_data, data, nvs, , 16K,
Build, flash and run tests
# Clean any previous configuration and builds
rm -r sdkconfig build
# Set the target
idf.py set-target esp32
# Building the firmware
idf.py -T esp_diag_data_store build
# Flash and run the test cases
idf.py -p <serial-port> -T esp_diag_data_store flash monitor